Commit 8c843902 by 郑永强

feat: [1006277] H5落地页新增新的风格

parent dca47acc
package com.pcloud.book.consumer.promotion; package com.pcloud.book.consumer.promotion;
import cn.hutool.core.collection.CollUtil;
import com.pcloud.common.core.aspect.ParamLog; import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ResponseHandleUtil; import com.pcloud.common.utils.ResponseHandleUtil;
import com.pcloud.promotion.couponsnew.dto.CouponMapRequestDto;
import com.pcloud.promotion.couponsnew.dto.CouponsNewDto;
import com.pcloud.promotion.couponsnew.service.CouponsNewService;
import com.pcloud.promotion.fission.dto.UpdateQrDTO; import com.pcloud.promotion.fission.dto.UpdateQrDTO;
import com.pcloud.promotion.groupFission.service.GroupFissionService; import com.pcloud.promotion.groupFission.service.GroupFissionService;
...@@ -11,6 +15,10 @@ import org.slf4j.LoggerFactory; ...@@ -11,6 +15,10 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Component("promotionConsr") @Component("promotionConsr")
public class PromotionConsr { public class PromotionConsr {
/** /**
...@@ -21,6 +29,8 @@ public class PromotionConsr { ...@@ -21,6 +29,8 @@ public class PromotionConsr {
@Autowired @Autowired
private GroupFissionService groupFissionService; private GroupFissionService groupFissionService;
@Autowired
private CouponsNewService couponsNewService;
@ParamLog("获取备用二维码") @ParamLog("获取备用二维码")
public String getSpareQr() throws BizException { public String getSpareQr() throws BizException {
...@@ -40,4 +50,20 @@ public class PromotionConsr { ...@@ -40,4 +50,20 @@ public class PromotionConsr {
LOGGER.warn("同步更新二维码失败:" + e.getMessage(), e); LOGGER.warn("同步更新二维码失败:" + e.getMessage(), e);
} }
} }
@ParamLog("获取优惠券信息")
public Map<Long, CouponsNewDto> mapByCouponIds(List<Long> couponsIds, Long wechatUserId) throws BizException {
if(CollUtil.isEmpty(couponsIds)){
return new HashMap<>();
}
try {
CouponMapRequestDto dto = new CouponMapRequestDto();
dto.setCouponIds(couponsIds);
dto.setWechatUserId(wechatUserId);
return ResponseHandleUtil.parseMap(couponsNewService.mapByCouponIds(dto), Long.class, CouponsNewDto.class);
} catch (Exception e) {
LOGGER.warn("同步更新二维码失败:" + e.getMessage(), e);
}
return new HashMap<>();
}
} }
package com.pcloud.book.group.biz; package com.pcloud.book.group.biz;
import com.pcloud.book.group.entity.ResourcePageBookstore; import com.pcloud.book.group.entity.ResourcePageBookstore;
import com.pcloud.book.group.enums.ResourcePageFixtureTypeEnum;
import com.pcloud.book.group.vo.ResourcePageBookstoreVO; import com.pcloud.book.group.vo.ResourcePageBookstoreVO;
import com.pcloud.common.page.PageBeanNew; import com.pcloud.common.page.PageBeanNew;
import java.util.List; import java.util.List;
...@@ -43,7 +44,7 @@ public interface ResourcePageBookstoreBiz { ...@@ -43,7 +44,7 @@ public interface ResourcePageBookstoreBiz {
*/ */
void deleteById(Long id); void deleteById(Long id);
void deleteByResourcePageId(Long resourcePageId); void deleteByResourcePageId(Long resourcePageId, Integer fixtureType);
List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId, Long channelId); List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId, Long channelId, Long wechatUserId, ResourcePageFixtureTypeEnum fixtureTypeEnum);
} }
...@@ -5,19 +5,21 @@ import cn.hutool.core.util.ObjectUtil; ...@@ -5,19 +5,21 @@ import cn.hutool.core.util.ObjectUtil;
import com.pcloud.appcenter.app.dto.AppDto; import com.pcloud.appcenter.app.dto.AppDto;
import com.pcloud.book.consumer.app.AppConsr; import com.pcloud.book.consumer.app.AppConsr;
import com.pcloud.book.consumer.channel.QrcodeSceneConsr; import com.pcloud.book.consumer.channel.QrcodeSceneConsr;
import com.pcloud.book.consumer.promotion.PromotionConsr;
import com.pcloud.book.consumer.resource.ProductConsr; import com.pcloud.book.consumer.resource.ProductConsr;
import com.pcloud.book.group.entity.ResourcePageBookstore; import com.pcloud.book.group.entity.ResourcePageBookstore;
import com.pcloud.book.group.dao.ResourcePageBookstoreDao; import com.pcloud.book.group.dao.ResourcePageBookstoreDao;
import com.pcloud.book.group.biz.ResourcePageBookstoreBiz; import com.pcloud.book.group.biz.ResourcePageBookstoreBiz;
import com.pcloud.book.group.enums.ResourcePageFixtureTypeEnum;
import com.pcloud.book.group.tools.SendWeixinRequestTools; import com.pcloud.book.group.tools.SendWeixinRequestTools;
import com.pcloud.book.group.vo.ResourcePageBookstoreVO; import com.pcloud.book.group.vo.ResourcePageBookstoreVO;
import com.pcloud.channelcenter.wechat.dto.AccountSettingDto; import com.pcloud.channelcenter.wechat.dto.AccountSettingDto;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.page.PageBeanNew; import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.page.PageParam; import com.pcloud.common.page.PageParam;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ListUtils; import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.NumberUtil; import com.pcloud.common.utils.NumberUtil;
import com.pcloud.promotion.couponsnew.dto.CouponsNewDto;
import com.pcloud.resourcecenter.product.dto.ProductDto; import com.pcloud.resourcecenter.product.dto.ProductDto;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -46,6 +48,8 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz { ...@@ -46,6 +48,8 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz {
private ProductConsr productConsr; private ProductConsr productConsr;
@Autowired @Autowired
private QrcodeSceneConsr qrcodeSceneConsr; private QrcodeSceneConsr qrcodeSceneConsr;
@Autowired
private PromotionConsr promotionConsr;
@Override @Override
public ResourcePageBookstore getById(Long id) { public ResourcePageBookstore getById(Long id) {
...@@ -89,16 +93,43 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz { ...@@ -89,16 +93,43 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz {
} }
@Override @Override
public void deleteByResourcePageId(Long resourcePageId) { public void deleteByResourcePageId(Long resourcePageId, Integer fixtureType) {
resourcePageBookstoreDao.deleteByResourcePageId(resourcePageId); resourcePageBookstoreDao.deleteByResourcePageId(resourcePageId, fixtureType);
} }
@Override @Override
public List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId, Long channelId) { public List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId, Long channelId, Long wechatUserId, ResourcePageFixtureTypeEnum fixtureTypeEnum) {
List<ResourcePageBookstoreVO> list = resourcePageBookstoreDao.getByResourcePageId(resourcePageId); List<ResourcePageBookstoreVO> list = resourcePageBookstoreDao.getByResourcePageId(resourcePageId, fixtureTypeEnum.fixtureType);
if(CollUtil.isEmpty(list) || channelId == null){ if(CollUtil.isEmpty(list)){
return CollUtil.toList(); return CollUtil.toList();
} }
switch (fixtureTypeEnum){
case BOOKSTORE:
if(channelId != null){
this.fillBookstore(list, channelId);
}
break;
case COUPONS:
this.fillCoupons(list, wechatUserId);
break;
}
return CollUtil.defaultIfEmpty(list, CollUtil.toList());
}
private void fillCoupons(List<ResourcePageBookstoreVO> list, Long wechatUserId) {
List<Long> couponIds = list.stream().map(x -> x.getServeId()).collect(Collectors.toList());
Map<Long, CouponsNewDto> couponsNewMap = promotionConsr.mapByCouponIds(couponIds, wechatUserId);
for (int i = list.size() - 1; i >= 0; i--) {
ResourcePageBookstoreVO vo = list.get(i);
CouponsNewDto couponsNewDto = couponsNewMap.get(vo.getServeId());
if(couponsNewDto.getState() == -1){
list.remove(vo);
}
vo.setCouponsNewDto(couponsNewDto);
}
}
private void fillBookstore(List<ResourcePageBookstoreVO> list, Long channelId) {
List<Long> appIds = list.stream().filter(x -> ObjectUtil.equal(x.getServeType(), "APP")).map(x -> x.getServeId()).collect(Collectors.toList()); List<Long> appIds = list.stream().filter(x -> ObjectUtil.equal(x.getServeType(), "APP")).map(x -> x.getServeId()).collect(Collectors.toList());
List<Long> productIds = list.stream().filter(x -> ObjectUtil.equal(x.getServeType(), "PRODUCT")).map(x -> x.getServeId()).collect(Collectors.toList()); List<Long> productIds = list.stream().filter(x -> ObjectUtil.equal(x.getServeType(), "PRODUCT")).map(x -> x.getServeId()).collect(Collectors.toList());
Map<Long, AppDto> appDtoMap = appConsr.getBaseByIds(appIds); Map<Long, AppDto> appDtoMap = appConsr.getBaseByIds(appIds);
...@@ -106,7 +137,7 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz { ...@@ -106,7 +137,7 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz {
AccountSettingDto accountSettingDto = qrcodeSceneConsr.getWechatInfo(channelId); AccountSettingDto accountSettingDto = qrcodeSceneConsr.getWechatInfo(channelId);
if (null == accountSettingDto) { if (null == accountSettingDto) {
LOGGER.info("未配置公众号"); LOGGER.info("未配置公众号");
return CollUtil.toList(); return;
} }
for (ResourcePageBookstoreVO vo : list) { for (ResourcePageBookstoreVO vo : list) {
if(ObjectUtil.equal(vo.getServeType(), "APP")){ if(ObjectUtil.equal(vo.getServeType(), "APP")){
...@@ -134,6 +165,5 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz { ...@@ -134,6 +165,5 @@ public class ResourcePageBookstoreBizImpl implements ResourcePageBookstoreBiz {
vo.setResultUrl(SendWeixinRequestTools.splitUrl(accountSettingDto, vo.getLinkUrl())); vo.setResultUrl(SendWeixinRequestTools.splitUrl(accountSettingDto, vo.getLinkUrl()));
} }
} }
return list;
} }
} }
...@@ -343,7 +343,8 @@ public class ResourcePageConstants { ...@@ -343,7 +343,8 @@ public class ResourcePageConstants {
BOOK_SERVE(1,"本书配套"), BOOK_SERVE(1,"本书配套"),
APPLET_QA(2,"书友互助"), APPLET_QA(2,"书友互助"),
CUSTOM(3,"自定义"), CUSTOM(3,"自定义"),
CLOCK(4,"阅读打卡"); CLOCK(4,"阅读打卡"),
CUSTOM_SERVE(5,"自定义服务跳转");
private Integer code; private Integer code;
private String name; private String name;
......
...@@ -13,8 +13,8 @@ import java.util.List; ...@@ -13,8 +13,8 @@ import java.util.List;
*/ */
public interface ResourcePageBookstoreDao extends BaseDao<ResourcePageBookstore> { public interface ResourcePageBookstoreDao extends BaseDao<ResourcePageBookstore> {
Integer deleteByResourcePageId(Long resourcePageId); Integer deleteByResourcePageId(Long resourcePageId, Integer fixtureType);
List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId); List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId, Integer fixtureType);
} }
...@@ -120,5 +120,5 @@ public interface ResourcePageDao extends BaseDao<ResourcePage>{ ...@@ -120,5 +120,5 @@ public interface ResourcePageDao extends BaseDao<ResourcePage>{
* @date:2021/8/18 16:46 * @date:2021/8/18 16:46
* * @param null * * @param null
*/ */
void updateNavigationFormat(Long resourcePageId, Integer navigationColor, Integer navigationFormat); void updateNavigationFormat(Long resourcePageId, Integer navigationColor, Integer navigationFormat, Integer navigationJumpType);
} }
...@@ -6,7 +6,10 @@ import com.pcloud.book.group.vo.ResourcePageBookstoreVO; ...@@ -6,7 +6,10 @@ import com.pcloud.book.group.vo.ResourcePageBookstoreVO;
import com.pcloud.common.core.dao.BaseDaoImpl; import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 实体书购买(ResourcePageBookstore)表数据库访问层 * 实体书购买(ResourcePageBookstore)表数据库访问层
...@@ -18,12 +21,18 @@ import java.util.List; ...@@ -18,12 +21,18 @@ import java.util.List;
public class ResourcePageBookstoreDaoImpl extends BaseDaoImpl<ResourcePageBookstore> implements ResourcePageBookstoreDao { public class ResourcePageBookstoreDaoImpl extends BaseDaoImpl<ResourcePageBookstore> implements ResourcePageBookstoreDao {
@Override @Override
public Integer deleteByResourcePageId(Long resourcePageId) { public Integer deleteByResourcePageId(Long resourcePageId, Integer fixtureType) {
return super.sqlSessionTemplate.delete(getStatement("deleteByResourcePageId"), resourcePageId); Map<String, Object> params = new HashMap<>();
params.put("resourcePageId", resourcePageId);
params.put("fixtureType", fixtureType);
return super.sqlSessionTemplate.delete(getStatement("deleteByResourcePageId"), params);
} }
@Override @Override
public List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId) { public List<ResourcePageBookstoreVO> getByResourcePageId(Long resourcePageId, Integer fixtureType) {
return super.sqlSessionTemplate.selectList(getStatement("getByResourcePageId"), resourcePageId); Map<String, Object> params = new HashMap<>();
params.put("resourcePageId", resourcePageId);
params.put("fixtureType", fixtureType);
return super.sqlSessionTemplate.selectList(getStatement("getByResourcePageId"), params);
} }
} }
...@@ -140,11 +140,12 @@ public class ResourcePageDaoImpl extends BaseDaoImpl<ResourcePage> implements Re ...@@ -140,11 +140,12 @@ public class ResourcePageDaoImpl extends BaseDaoImpl<ResourcePage> implements Re
} }
@Override @Override
public void updateNavigationFormat(Long resourcePageId, Integer navigationColor, Integer navigationFormat) { public void updateNavigationFormat(Long resourcePageId, Integer navigationColor, Integer navigationFormat, Integer navigationJumpType) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("id", resourcePageId); map.put("id", resourcePageId);
map.put("navigationColor", navigationColor); map.put("navigationColor", navigationColor);
map.put("navigationFormat", navigationFormat); map.put("navigationFormat", navigationFormat);
map.put("navigationJumpType", navigationJumpType);
getSessionTemplate().update(getStatement("updateNavigationFormat"), map); getSessionTemplate().update(getStatement("updateNavigationFormat"), map);
} }
} }
...@@ -37,4 +37,8 @@ public class NavigationParamDTO { ...@@ -37,4 +37,8 @@ public class NavigationParamDTO {
* 导航版式 * 导航版式
*/ */
private Integer navigationFormat; private Integer navigationFormat;
/**
* 导航跳转模式
*/
private Integer navigationJumpType;
} }
...@@ -95,4 +95,9 @@ public class ResourcePage extends BaseEntity { ...@@ -95,4 +95,9 @@ public class ResourcePage extends BaseEntity {
* 透明度 * 透明度
*/ */
private Integer transparency; private Integer transparency;
/**
* 导航使用场景;1:菜单切换;2:功能跳转
*/
private Integer navigationJumpType;
} }
...@@ -29,6 +29,9 @@ public class ResourcePageBookstore extends BaseEntity { ...@@ -29,6 +29,9 @@ public class ResourcePageBookstore extends BaseEntity {
@ApiModelProperty("资源页id") @ApiModelProperty("资源页id")
private Long resourcePageId; private Long resourcePageId;
@ApiModelProperty("固定项类型;1:书店;2:优惠券;")
private Integer fixtureType;
@ApiModelProperty("服务id") @ApiModelProperty("服务id")
private Long serveId; private Long serveId;
......
...@@ -4,6 +4,7 @@ import com.pcloud.common.entity.BaseEntity; ...@@ -4,6 +4,7 @@ import com.pcloud.common.entity.BaseEntity;
import java.util.Date; import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/** /**
...@@ -40,4 +41,50 @@ public class ResourcePageNavigation extends BaseEntity { ...@@ -40,4 +41,50 @@ public class ResourcePageNavigation extends BaseEntity {
*/ */
private Long createUser; private Long createUser;
/**
* 服务id
*/
private Long serveId;
/**
* 服务类型
*/
private String serveType;
/**
* 资源类型
*/
private String typeCode;
/**
* 链接地址
*/
private String linkUrl;
/**
* 是否隐藏
*/
private Integer isHide;
@ApiModelProperty("应用或作品图片")
private String servePic;
@ApiModelProperty("应用或作品名称")
private String serveName;
@ApiModelProperty("应用或作品类型名称")
private String typeName;
@ApiModelProperty("是否第三方链接")
private Boolean hasThirdLink;
@ApiModelProperty("跳转结果链接")
private String resultUrl;
@ApiModelProperty("是否配置了公众号工具")
private Boolean hasOfficialAccountsTool;
} }
package com.pcloud.book.group.enums;
public enum ResourcePageFixtureTypeEnum {
BOOKSTORE(1, "书店"),
COUPONS(2, "优惠券");
public final Integer fixtureType;
public final String desc;
ResourcePageFixtureTypeEnum(Integer fixtureType, String desc) {
this.fixtureType = fixtureType;
this.desc = desc;
}
}
...@@ -3,9 +3,11 @@ package com.pcloud.book.group.vo; ...@@ -3,9 +3,11 @@ package com.pcloud.book.group.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.pcloud.common.entity.BaseEntity; import com.pcloud.common.entity.BaseEntity;
import com.pcloud.promotion.couponsnew.dto.CouponsNewDto;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
...@@ -24,6 +26,9 @@ public class ResourcePageBookstoreVO { ...@@ -24,6 +26,9 @@ public class ResourcePageBookstoreVO {
@ApiModelProperty("资源页id") @ApiModelProperty("资源页id")
private Long resourcePageId; private Long resourcePageId;
@ApiModelProperty("固定资源类型")
private Integer fixtureType;
@ApiModelProperty("服务id") @ApiModelProperty("服务id")
private Long serveId; private Long serveId;
...@@ -52,4 +57,8 @@ public class ResourcePageBookstoreVO { ...@@ -52,4 +57,8 @@ public class ResourcePageBookstoreVO {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime; private Date createTime;
@ApiModelProperty("优惠券对象")
private CouponsNewDto couponsNewDto;
} }
...@@ -95,6 +95,9 @@ public class ResourcePageVO extends BaseDto { ...@@ -95,6 +95,9 @@ public class ResourcePageVO extends BaseDto {
@ApiModelProperty("实体书购买") @ApiModelProperty("实体书购买")
private List<ResourcePageBookstoreVO> resourcePageBookstoreList; private List<ResourcePageBookstoreVO> resourcePageBookstoreList;
@ApiModelProperty("优惠券")
private List<ResourcePageBookstoreVO> resourcePageCouponList;
/** /**
* 导航 * 导航
*/ */
...@@ -128,4 +131,8 @@ public class ResourcePageVO extends BaseDto { ...@@ -128,4 +131,8 @@ public class ResourcePageVO extends BaseDto {
* 透明度 * 透明度
*/ */
private Integer transparency; private Integer transparency;
/**
* 导航使用场景;1:菜单切换;2:功能跳转
*/
private Integer navigationJumpType;
} }
...@@ -63,6 +63,9 @@ public class UpdateResourcePageVO { ...@@ -63,6 +63,9 @@ public class UpdateResourcePageVO {
@ApiModelProperty("实体书购买") @ApiModelProperty("实体书购买")
private List<ResourcePageBookstore> resourcePageBookstoreList; private List<ResourcePageBookstore> resourcePageBookstoreList;
@ApiModelProperty("优惠券")
private List<ResourcePageBookstore> resourcePageCouponList;
/** /**
* 字体颜色 * 字体颜色
*/ */
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<resultMap id="BaseResultMap" type="com.pcloud.book.group.entity.ResourcePageBookstore"> <resultMap id="BaseResultMap" type="com.pcloud.book.group.entity.ResourcePageBookstore">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="id" property="id" jdbcType="BIGINT"/>
<result column="resource_page_id" property="resourcePageId" jdbcType="BIGINT"/> <result column="resource_page_id" property="resourcePageId" jdbcType="BIGINT"/>
<result column="fixture_type" property="fixtureType" jdbcType="INTEGER"/>
<result column="serve_id" property="serveId" jdbcType="BIGINT"/> <result column="serve_id" property="serveId" jdbcType="BIGINT"/>
<result column="serve_type" property="serveType" jdbcType="VARCHAR"/> <result column="serve_type" property="serveType" jdbcType="VARCHAR"/>
<result column="link_url" property="linkUrl" jdbcType="VARCHAR"/> <result column="link_url" property="linkUrl" jdbcType="VARCHAR"/>
...@@ -15,7 +16,7 @@ ...@@ -15,7 +16,7 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, resource_page_id, serve_id, serve_type, link_url, create_time id, resource_page_id, fixture_type, serve_id, serve_type, link_url, create_time
</sql> </sql>
<select id="getById" resultMap="BaseResultMap"> <select id="getById" resultMap="BaseResultMap">
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM resource_page_bookstore FROM resource_page_bookstore
WHERE resource_page_id = #{resourcePageId} WHERE resource_page_id = #{resourcePageId}
AND fixture_type = #{fixtureType}
</select> </select>
<select id="getList" resultMap="BaseResultMap"> <select id="getList" resultMap="BaseResultMap">
...@@ -41,12 +43,14 @@ ...@@ -41,12 +43,14 @@
<insert id="insert" keyProperty="id" useGeneratedKeys="true"> <insert id="insert" keyProperty="id" useGeneratedKeys="true">
INSERT INTO resource_page_bookstore( INSERT INTO resource_page_bookstore(
resource_page_id, resource_page_id,
fixture_type,
serve_id, serve_id,
serve_type, serve_type,
link_url, link_url,
create_time create_time
) VALUES ( ) VALUES (
#{resourcePageId, jdbcType=BIGINT}, #{resourcePageId, jdbcType=BIGINT},
#{fixtureType, jdbcType=INTEGER},
#{serveId, jdbcType=BIGINT}, #{serveId, jdbcType=BIGINT},
#{serveType, jdbcType=VARCHAR}, #{serveType, jdbcType=VARCHAR},
#{linkUrl, jdbcType=VARCHAR}, #{linkUrl, jdbcType=VARCHAR},
...@@ -57,6 +61,7 @@ ...@@ -57,6 +61,7 @@
<insert id="batchInsert" keyProperty="id" useGeneratedKeys="true"> <insert id="batchInsert" keyProperty="id" useGeneratedKeys="true">
INSERT INTO resource_page_bookstore ( INSERT INTO resource_page_bookstore (
resource_page_id, resource_page_id,
fixture_type,
serve_id, serve_id,
serve_type, serve_type,
link_url, link_url,
...@@ -65,6 +70,7 @@ ...@@ -65,6 +70,7 @@
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
#{item.resourcePageId, jdbcType=BIGINT}, #{item.resourcePageId, jdbcType=BIGINT},
#{item.fixtureType, jdbcType=INTEGER},
#{item.serveId, jdbcType=BIGINT}, #{item.serveId, jdbcType=BIGINT},
#{item.serveType, jdbcType=VARCHAR}, #{item.serveType, jdbcType=VARCHAR},
#{item.linkUrl, jdbcType=VARCHAR}, #{item.linkUrl, jdbcType=VARCHAR},
...@@ -80,6 +86,9 @@ ...@@ -80,6 +86,9 @@
<if test="resourcePageId != null"> <if test="resourcePageId != null">
resource_page_id = #{resourcePageId}, resource_page_id = #{resourcePageId},
</if> </if>
<if test="fixtureType != null">
fixture_type = #{fixtureType},
</if>
<if test="serveId != null"> <if test="serveId != null">
serve_id = #{serveId}, serve_id = #{serveId},
</if> </if>
...@@ -101,6 +110,9 @@ ...@@ -101,6 +110,9 @@
<!--通过主键删除--> <!--通过主键删除-->
<delete id="deleteByResourcePageId"> <delete id="deleteByResourcePageId">
DELETE FROM resource_page_bookstore WHERE resource_page_id = #{resourcePageId} DELETE FROM resource_page_bookstore WHERE resource_page_id = #{resourcePageId}
<if test="fixtureType != null">
AND fixture_type = #{fixtureType}
</if>
</delete> </delete>
</mapper> </mapper>
...@@ -26,12 +26,13 @@ ...@@ -26,12 +26,13 @@
<result property="watermarkStyle" column="watermark_style" jdbcType="TINYINT"/> <result property="watermarkStyle" column="watermark_style" jdbcType="TINYINT"/>
<result property="landingPageType" column="landing_page_type" jdbcType="INTEGER"/> <result property="landingPageType" column="landing_page_type" jdbcType="INTEGER"/>
<result property="transparency" column="transparency" jdbcType="INTEGER"/> <result property="transparency" column="transparency" jdbcType="INTEGER"/>
<result property="navigationJumpType" column="navigation_jump_type" jdbcType="INTEGER"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, book_group_id, style, show_book, open_rays, open_food, create_time, update_time, create_user, qrcode_url, scene_id, official_scene_id, id, book_group_id, style, show_book, open_rays, open_food, create_time, update_time, create_user, qrcode_url, scene_id, official_scene_id,
book_cover, book_id, channel_id, background_img, navigation_color, navigation_format, font_color,watermark, watermark_style, landing_page_type book_cover, book_id, channel_id, background_img, navigation_color, navigation_format, font_color,watermark, watermark_style, landing_page_type
,transparency ,transparency, navigation_jump_type
</sql> </sql>
<!--查询单个--> <!--查询单个-->
...@@ -46,9 +47,9 @@ ...@@ -46,9 +47,9 @@
<!--新增所有列--> <!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true"> <insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into book.resource_page(book_group_id, style, show_book, open_rays, open_food, create_time, update_time, create_user, insert into book.resource_page(book_group_id, style, show_book, open_rays, open_food, create_time, update_time, create_user,
qrcode_url, scene_id, book_cover, book_id, channel_id, background_img, font_color, watermark, watermark_style, landing_page_type, transparency) qrcode_url, scene_id, book_cover, book_id, channel_id, background_img, font_color, watermark, watermark_style, landing_page_type, transparency, navigation_jump_type)
values (#{bookGroupId}, #{style}, #{showBook}, #{openRays}, IFNULL(#{openFood},0), now(), now(), #{createUser}, #{qrcodeUrl}, #{sceneId}, #{bookCover}, values (#{bookGroupId}, #{style}, #{showBook}, #{openRays}, IFNULL(#{openFood},0), now(), now(), #{createUser}, #{qrcodeUrl}, #{sceneId}, #{bookCover},
#{bookId}, #{channelId}, #{backgroundImg}, #{fontColor}, #{watermark}, #{watermarkStyle}, IFNULL(#{landingPageType},1), IFNULL(#{transparency},0)) #{bookId}, #{channelId}, #{backgroundImg}, #{fontColor}, #{watermark}, #{watermarkStyle}, IFNULL(#{landingPageType},1), IFNULL(#{transparency},0), IFNULL(#{navigationJumpType},0))
</insert> </insert>
<!--通过主键修改数据--> <!--通过主键修改数据-->
...@@ -94,6 +95,9 @@ ...@@ -94,6 +95,9 @@
<if test="transparency != null"> <if test="transparency != null">
transparency = #{transparency}, transparency = #{transparency},
</if> </if>
<if test="navigationJumpType != null">
navigation_jump_type = #{navigationJumpType},
</if>
</set> </set>
where id = #{id} where id = #{id}
</update> </update>
...@@ -310,6 +314,9 @@ ...@@ -310,6 +314,9 @@
<if test="navigationFormat != null"> <if test="navigationFormat != null">
navigation_format = #{navigationFormat}, navigation_format = #{navigationFormat},
</if> </if>
<if test="navigationJumpType != null">
navigation_jump_type = #{navigationJumpType},
</if>
update_time = NOW(), update_time = NOW(),
</set> </set>
where id = #{id} where id = #{id}
......
...@@ -9,13 +9,18 @@ ...@@ -9,13 +9,18 @@
<result property="navigationName" column="navigation_name" jdbcType="VARCHAR"/> <result property="navigationName" column="navigation_name" jdbcType="VARCHAR"/>
<result property="navigationIcon" column="navigation_icon" jdbcType="VARCHAR"/> <result property="navigationIcon" column="navigation_icon" jdbcType="VARCHAR"/>
<result property="navigationSeq" column="navigation_seq" jdbcType="INTEGER"/> <result property="navigationSeq" column="navigation_seq" jdbcType="INTEGER"/>
<result property="serveId" column="serve_id" jdbcType="INTEGER"/>
<result property="serveType" column="serve_type" jdbcType="INTEGER"/>
<result property="typeCode" column="type_code" jdbcType="INTEGER"/>
<result property="linkUrl" column="link_url" jdbcType="INTEGER"/>
<result property="isHide" column="is_hide" jdbcType="INTEGER"/>
<result property="createUser" column="create_user" jdbcType="INTEGER"/> <result property="createUser" column="create_user" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, resource_page_id, navigation_type, navigation_name, navigation_icon, navigation_seq id, resource_page_id, navigation_type, navigation_name, navigation_icon, navigation_seq, serve_id, serve_type, type_code, link_url, is_hide
</sql> </sql>
<!--查询单个--> <!--查询单个-->
<select id="getById" resultMap="ResourcePageNavigationMap"> <select id="getById" resultMap="ResourcePageNavigationMap">
...@@ -27,15 +32,15 @@ ...@@ -27,15 +32,15 @@
<!--新增所有列--> <!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true"> <insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into book.resource_page_navigation(resource_page_id, navigation_type, navigation_name, navigation_icon, navigation_seq, create_user, create_time, update_time) insert into book.resource_page_navigation(resource_page_id, navigation_type, navigation_name, navigation_icon, navigation_seq, create_user, serve_id, serve_type, type_code, link_url, is_hide, create_time, update_time)
values (#{resourcePageId}, #{navigationType}, #{navigationName}, #{navigationIcon}, #{navigationSeq}, #{createUser}, now(), now()) values (#{resourcePageId}, #{navigationType}, #{navigationName}, #{navigationIcon}, #{navigationSeq}, #{createUser}, #{serveId}, #{serveType}, #{typeCode}, #{linkUrl}, IFNULL(#{isHide},0), now(), now())
</insert> </insert>
<insert id="batchInsert" keyProperty="id" useGeneratedKeys="true"> <insert id="batchInsert" keyProperty="id" useGeneratedKeys="true">
insert into book.resource_page_navigation(resource_page_id, navigation_type, navigation_name, navigation_icon, navigation_seq, create_user, create_time, update_time) insert into book.resource_page_navigation(resource_page_id, navigation_type, navigation_name, navigation_icon, navigation_seq, create_user, serve_id, serve_type, type_code, link_url, is_hide, create_time, update_time)
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.resourcePageId}, #{item.navigationType}, #{item.navigationName}, #{item.navigationIcon}, #{item.navigationSeq}, #{item.createUser}, now(), now()) (#{item.resourcePageId}, #{item.navigationType}, #{item.navigationName}, #{item.navigationIcon}, #{item.navigationSeq}, #{item.createUser}, #{item.serveId}, #{item.serveType}, #{item.typeCode}, #{item.linkUrl}, IFNULL(#{item.isHide}, 0), now(), now())
</foreach> </foreach>
</insert> </insert>
...@@ -50,6 +55,21 @@ ...@@ -50,6 +55,21 @@
<if test="navigationSeq != null"> <if test="navigationSeq != null">
navigation_seq = #{navigationSeq}, navigation_seq = #{navigationSeq},
</if> </if>
<if test="serveId != null">
serve_id = #{serveId},
</if>
<if test="serveType != null">
serve_type = #{serveType},
</if>
<if test="typeCode != null">
type_code = #{typeCode},
</if>
<if test="isHide != null">
is_hide = #{isHide},
</if>
<if test="linkUrl != null">
link_url = #{linkUrl},
</if>
update_time = now(), update_time = now(),
</set> </set>
where id = #{id} where id = #{id}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment