| @@ -1,14 +1,13 @@ | |||
| package com.iformall.controller.market; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.vo.TtCouponChannelVo; | |||
| import com.iformall.domain.vo.TtCouponVo; | |||
| import com.iformall.domain.vo.WxCouponChannelVo; | |||
| import com.iformall.douyin.web.bean.GoodsTemplateGet; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.service.*; | |||
| @@ -57,35 +56,42 @@ public class TtCouponGoodsController extends BaseController { | |||
| String coryColumn = "c."+ttCouponVo.getSortColumns(); | |||
| ttCouponVo.setSortColumns(coryColumn); | |||
| ttCouponVo.setSortColumn(null); | |||
| }else{ | |||
| ttCouponVo.setSortColumns(BaseEntity.SortField.CCreateDate_DESC, BaseEntity.SortField.CId_DESC); | |||
| } | |||
| if (ttCouponVo.getStatus() != null && ttCouponVo.getStatus() == -1) | |||
| ttCouponVo.setStatus(null); | |||
| return ttCouponGoodsService.couponList(ttCouponVo, pageNum, pageSize); | |||
| } | |||
| // @ApiOperation("分页列表接口") | |||
| // @GetMapping("channelList") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| // @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| // @SystemControllerLog(description = "-列表") | |||
| // public ResultData channelList(@ModelAttribute TtCouponChannelVo ttChannelVo, Integer pageNum, Integer pageSize) { | |||
| // logger.debug("[" + getIpAddr() + "] WxCouponController::channelList"); | |||
| // if (ttChannelVo == null) ttChannelVo = new TtCouponChannelVo(); | |||
| // if (ttChannelVo.getStatus() != null && ttChannelVo.getStatus() == -1) { | |||
| // ttChannelVo.setStatus(null); | |||
| // } | |||
| // ttChannelVo.updateTenantInfo(getTenantInfo()); | |||
| // ttCouponVo.setType(EnumCouponType.COUPON_DOUYIN.getCode()); | |||
| // if(StringUtils.isNotBlank(ttCouponVo.getSortColumn())){ | |||
| // String coryColumn = "c."+ttCouponVo.getSortColumns(); | |||
| // ttCouponVo.setSortColumns(coryColumn); | |||
| // ttCouponVo.setSortColumn(null); | |||
| // } | |||
| // if (ttCouponVo.getStatus() != null && ttCouponVo.getStatus() == -1) | |||
| // ttCouponVo.setStatus(null); | |||
| // return ttCouponGoodsService.channelList(ttCouponVo, pageNum, pageSize); | |||
| // } | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("channelList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "-列表") | |||
| public ResultData channelList(@ModelAttribute TtCouponChannelVo ttChannelVo, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponController::channelList"); | |||
| if (ttChannelVo == null) ttChannelVo = new TtCouponChannelVo(); | |||
| if (ttChannelVo.getStatus() != null && ttChannelVo.getStatus() == -1) { | |||
| ttChannelVo.setStatus(null); | |||
| } | |||
| ttChannelVo.updateTenantInfo(getTenantInfo()); | |||
| ttChannelVo.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN_LIST.getCode()); | |||
| if(null == ttChannelVo.getSourceType()){ | |||
| ttChannelVo.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | |||
| } | |||
| if(StringUtils.isNotBlank(ttChannelVo.getSortColumn())){ | |||
| String coryColumn = "cc."+ttChannelVo.getSortColumns(); | |||
| ttChannelVo.setSortColumns(coryColumn); | |||
| ttChannelVo.setSortColumn(null); | |||
| }else{ | |||
| ttChannelVo.setSortColumns(BaseEntity.SortField.CCUpdateDate_DESC); | |||
| } | |||
| return ttCouponGoodsService.channelList(ttChannelVo, pageNum, pageSize); | |||
| } | |||
| @ApiOperation("根据类目获取商品模板") | |||
| @GetMapping("getTemplate") | |||
| @@ -1,4 +0,0 @@ | |||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (679, '抖音商品库', 606, 'Y', NULL, 1, NULL, NULL, 'dygoods', NULL, 0, 679); | |||
| UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 4, 5, 6, 50, 105, 110, 201, 205, 202, 211, 212, 221, 222, 223, 251, 409, 410, 411, 416, 500, 502, 504, 505, 506, 507, 508, 511, 512, 521, 522, 523, 531, 532, 591, 592, 595, 602, 605, 606, 607, 610, 647, 671, 679, 680, 711, 901, 902, 904, 907, 60702]' WHERE `id` = 11; | |||
| @@ -20,185 +20,22 @@ import java.util.List; | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class TtCouponChannelVo extends WxCouponChannel implements Serializable { | |||
| public class TtCouponChannelVo extends WxCouponChannelVo implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @TableField(exist = false) | |||
| private Integer activityStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="spuId",name="spuId") | |||
| private String spuId; | |||
| @io.swagger.annotations.ApiModelProperty(value="总库存",name="inventory") | |||
| private Integer inventory; | |||
| @io.swagger.annotations.ApiModelProperty(value="剩余库存",name="remainInventory") | |||
| private Integer remainInventory; | |||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | |||
| private String coverImg; | |||
| @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") | |||
| private String title; | |||
| @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") | |||
| private String subTitle; | |||
| @io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5)",name="salePrice") | |||
| private Integer salePrice; | |||
| @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") | |||
| private Integer usePrice; | |||
| @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | |||
| private Integer price; | |||
| @io.swagger.annotations.ApiModelProperty(value="状态:0-审核中,1-上架,2-下架,3-审核拒绝 4-审核通过",name="poiStatus") | |||
| private Integer poiStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="尾款(适用于类型9)",name="tailPrice") | |||
| private Integer tailPrice; | |||
| @io.swagger.annotations.ApiModelProperty(value="原价(适用于类型9)",name="origPrice") | |||
| private Integer origPrice; | |||
| @io.swagger.annotations.ApiModelProperty(value="描述",name="statusDesc") | |||
| private String statusDesc; | |||
| @io.swagger.annotations.ApiModelProperty(value="单位0:钱分,1:小时",name="unit") | |||
| private Integer unit; | |||
| @io.swagger.annotations.ApiModelProperty(value="状态:0-审核中,1-上架,2-下架,3-审核拒绝 4-审核通过",name="lastStatus") | |||
| private Integer lastStatus; | |||
| //EnumCouponUseLimitRule | |||
| @io.swagger.annotations.ApiModelProperty(value="限领规则",name="useLimitRule") | |||
| private Integer useLimitRule; | |||
| @io.swagger.annotations.ApiModelProperty(value="限领张数",name="useLimitQuantity") | |||
| private Integer useLimitQuantity; | |||
| @io.swagger.annotations.ApiModelProperty(value="描述",name="lastStatusDesc") | |||
| private String lastStatusDesc; | |||
| @io.swagger.annotations.ApiModelProperty(value="1.主动领取2.定向投放",name="sendType") | |||
| private Integer sendType; | |||
| @io.swagger.annotations.ApiModelProperty(value="过期退款(0:正常,1不退)",name="autoRefund") | |||
| private Integer autoRefund; | |||
| @io.swagger.annotations.ApiModelProperty(value="有效时间类型1.时间范围(valid_start_date,valid_end_date). 2领取后几日有效(valid_days)",name="validType") | |||
| private Integer validType; | |||
| @io.swagger.annotations.ApiModelProperty(value="有效日期-开始",name="validStartDate") | |||
| private Date validStartDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="有效日期-结束",name="validEndDate") | |||
| private Date validEndDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="自领取之日几日有效,(停车券当天有效)",name="validDays") | |||
| private Integer validDays; | |||
| @io.swagger.annotations.ApiModelProperty(value="有效日期-开始",name="pickStartDate") | |||
| private Date pickStartDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="有效日期-结束",name="pickEndDate") | |||
| private Date pickEndDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="积分售价(适用于类型10,11)",name="creditPrice") | |||
| private Integer creditPrice; | |||
| @io.swagger.annotations.ApiModelProperty(value="领取条件",name="condition") | |||
| private String conditions; | |||
| @io.swagger.annotations.ApiModelProperty(value="内容类型(0:小程序页面类型,1:富文本类型)",name="contentType") | |||
| private Integer contentType; | |||
| @TableField(exist = false) | |||
| private String detail; | |||
| @TableField(exist = false) | |||
| private String salePriceStr; | |||
| @TableField(exist = false) | |||
| private String usePriceStr; | |||
| @TableField(exist = false) | |||
| private String priceStr; | |||
| @TableField(exist = false) | |||
| private String tailPriceStr; | |||
| @TableField(exist = false) | |||
| private String origPriceStr; | |||
| @TableField(exist = false) | |||
| private String qrCode; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户列表",name="merchantVoList") | |||
| private List<WxMerchantVo> merchantVoList; | |||
| @TableField(exist = false) | |||
| private Integer gameWeight; | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否可转赠", name = "supportTransfer") | |||
| private Integer supportTransfer; | |||
| @io.swagger.annotations.ApiModelProperty(value = "砍价/拼团人数", name = "pressLimitNum") | |||
| private Integer pressLimitNum; | |||
| @Override | |||
| public String getSalePriceStr() { | |||
| if(salePrice!=null) { | |||
| salePriceStr = new BigDecimal(salePrice).divide(new BigDecimal(100)).toString(); | |||
| } | |||
| return salePriceStr; | |||
| } | |||
| @Override | |||
| public String getUsePriceStr() { | |||
| if(usePrice!=null) { | |||
| usePriceStr = new BigDecimal(usePrice).divide(new BigDecimal(100)).toString(); | |||
| } | |||
| return usePriceStr; | |||
| } | |||
| @Override | |||
| public String getPriceStr() { | |||
| if(price!=null) { | |||
| priceStr = new BigDecimal(price).divide(new BigDecimal(100)).toString(); | |||
| } | |||
| return priceStr; | |||
| } | |||
| public String getTailPriceStr() { | |||
| if(tailPrice!=null) { | |||
| tailPriceStr = new BigDecimal(tailPrice).divide(new BigDecimal(100)).toString(); | |||
| } | |||
| return tailPriceStr; | |||
| } | |||
| public String getOrigPriceStr() { | |||
| if(origPrice!=null) { | |||
| origPriceStr = new BigDecimal(origPrice).divide(new BigDecimal(100)).toString(); | |||
| } | |||
| return origPriceStr; | |||
| } | |||
| @Override | |||
| public String getTitle() { | |||
| return title; | |||
| } | |||
| @Override | |||
| public void setTitle(String title) { | |||
| this.title = title; | |||
| } | |||
| /** | |||
| * 可能字段不全, 使用时先确认 | |||
| * @param c | |||
| */ | |||
| public void setWxCoupon(WxCoupon c){ | |||
| if(c != null){ | |||
| this.setRemainInventory(c.getRemainInventory()); | |||
| this.setSalePrice(c.getSalePrice()); | |||
| this.setInventory(c.getInventory()); | |||
| this.setCoverImg(c.getCoverImg()); | |||
| this.setSubTitle(c.getSubTitle()); | |||
| this.setUsePrice(c.getUsePrice()); | |||
| this.setPrice(c.getPrice()); | |||
| this.setTailPrice(c.getTailPrice()); | |||
| this.setOrigPrice(c.getOrigPrice()); | |||
| this.setUnit(c.getUnit()); | |||
| this.setUseLimitRule(c.getUseLimitRule()); | |||
| this.setUseLimitQuantity(c.getUseLimitQuantity()); | |||
| this.setSendType(c.getSendType()); | |||
| this.setSupportTransfer(c.getSupportTransfer()); | |||
| this.setPressLimitNum(c.getPressLimitNum()); | |||
| this.setAutoRefund(c.getAutoRefund()); | |||
| this.setConditions(c.getConditions()); | |||
| this.setValidType(c.getValidType()); | |||
| this.setValidStartDate(c.getValidStartDate()); | |||
| this.setValidEndDate(c.getValidEndDate()); | |||
| this.setPickStartDate(c.getPickStartDate()); | |||
| this.setPickEndDate(c.getPickEndDate()); | |||
| this.setValidDays(c.getValidDays()); | |||
| this.setCreditPrice(c.getCreditPrice()); | |||
| this.setContentType(c.getContentType()); | |||
| this.setSourceType(c.getSourceType()); | |||
| } | |||
| } | |||
| } | |||
| @@ -16,7 +16,6 @@ public enum EnumCouponChannelType { | |||
| COUPON_CHANNEL_ID_CREDIT(50, "积分商城"), | |||
| COUPON_CHANNEL_ID_H5(100, "DSP的H5页面"), | |||
| COUPON_CHANNEL_ID_DOUYIN_SAVE_LIST(11, "抖音商品库审核列表"), | |||
| COUPON_CHANNEL_ID_DOUYIN_LIST(101, "抖音列表"), | |||
| COUPON_CHANNEL_ID_WXLIVE_LIST(102, "微信直播列表") | |||
| @@ -5,6 +5,7 @@ import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxTopic; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxCouponChannel; | |||
| import com.iformall.domain.vo.TtCouponChannelVo; | |||
| import org.apache.ibatis.annotations.Param; | |||
| public interface WxCouponChannelMapper extends CommonMapper<WxCouponChannel, String> { | |||
| @@ -72,4 +73,5 @@ public interface WxCouponChannelMapper extends CommonMapper<WxCouponChannel, Str | |||
| WxCouponChannel getPriceAndStock(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| List<WxCouponChannel> batGetPriceAndStock(@Param("ids")List<Long> ids,@Param("tenantId")String tenantId); | |||
| List<TtCouponChannelVo> ttChannelList(TtCouponChannelVo ttChannelVo); | |||
| } | |||
| @@ -3,12 +3,14 @@ package com.iformall.service; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.TtCouponChannelPoi; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.vo.TtCouponChannelVo; | |||
| import com.iformall.domain.vo.TtCouponVo; | |||
| public interface TtCouponGoodsService { | |||
| ResultData couponList(TtCouponVo ttCouponVo, Integer pageNum, Integer pageSize); | |||
| ResultData channelList(TtCouponChannelVo ttChannelVo, Integer pageNum, Integer pageSize); | |||
| ResultData productSave(WxCoupon coupon) throws Exception; | |||
| @@ -18,4 +20,5 @@ public interface TtCouponGoodsService { | |||
| ResultData productDraftGet(Long id); | |||
| ResultData productOnlineGet(Long id); | |||
| } | |||
| @@ -5,6 +5,7 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxCouponChannel; | |||
| import com.iformall.domain.vo.TtCouponChannelVo; | |||
| import com.iformall.domain.vo.WxCouponCVo; | |||
| import com.iformall.domain.vo.WxCouponChannelAddVo; | |||
| import com.iformall.domain.vo.WxCouponChannelVo; | |||
| @@ -77,4 +78,6 @@ public interface WxCouponChannelService { | |||
| List<WxCouponChannel> getPriceAndStock(TenantEntity tenantEntity,List<Long> couponChannelIds); | |||
| ResultData getCouponChannelPoi(TenantEntity tenantInfo, Long id); | |||
| PageInfo<TtCouponChannelVo> ttChannelList(TtCouponChannelVo ttChannelVo, Integer pageNum, Integer pageSize); | |||
| } | |||
| @@ -47,6 +47,9 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||
| @Autowired | |||
| WxCouponChannelMapper wxCouponChannelMapper; | |||
| @Autowired | |||
| WxCouponChannelService wxCouponChannelService; | |||
| @Autowired | |||
| private TtMerchantPoiService ttMerchantPoiService; | |||
| @@ -58,9 +61,6 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||
| @Override | |||
| public ResultData couponList(TtCouponVo ttCouponVo, Integer pageNum, Integer pageSize) { | |||
| if(StringUtils.isBlank(ttCouponVo.getSortColumns())){ | |||
| ttCouponVo.setSortColumns(BaseEntity.SortField.CCreateDate_DESC, BaseEntity.SortField.CId_DESC); | |||
| } | |||
| PageInfo<TtCouponVo> pageInfo = PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponMapper.ttCouponList(ttCouponVo)); | |||
| List<TtCouponVo> couponList = pageInfo.getList(); | |||
| @@ -99,6 +99,12 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||
| return new ResultData(pageInfo); | |||
| } | |||
| @Override | |||
| public ResultData channelList(TtCouponChannelVo ttChannelVo, Integer pageNum, Integer pageSize) { | |||
| PageInfo<TtCouponChannelVo> ttCouponChannelVoPageInfo = wxCouponChannelService.ttChannelList(ttChannelVo, pageNum, pageSize); | |||
| return new ResultData(ttCouponChannelVoPageInfo); | |||
| } | |||
| @Override | |||
| @Transactional(isolation=Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | |||
| public ResultData productSave(WxCoupon coupon) throws Exception { | |||
| @@ -12,10 +12,7 @@ import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxCouponChannel; | |||
| import com.iformall.domain.po.WxMall; | |||
| import com.iformall.domain.po.msg.FmInsideProductPushMsg; | |||
| import com.iformall.domain.vo.WxCouponCVo; | |||
| import com.iformall.domain.vo.WxCouponChannelAddVo; | |||
| import com.iformall.domain.vo.WxCouponChannelVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| import com.iformall.domain.vo.*; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.*; | |||
| @@ -609,7 +606,6 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| channelId.equals(EnumCouponChannelType.COUPON_CHANNEL_ID_PRESS.getCode()) || // 砍价 | |||
| channelId.equals(EnumCouponChannelType.COUPON_CHANNEL_ID_ORDER_GROUP.getCode()) || // 拼团 | |||
| channelId.equals(EnumCouponChannelType.COUPON_CHANNEL_ID_CREDIT.getCode()) || // 积分商城 | |||
| channelId.equals(EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN_SAVE_LIST.getCode()) || | |||
| channelId.equals(EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN_LIST.getCode()) || | |||
| channelId.equals(EnumCouponChannelType.COUPON_CHANNEL_ID_WXLIVE_LIST.getCode()) //微信直播列表 | |||
| ){ | |||
| @@ -805,7 +801,26 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| return new ResultData(ErrorCode.SYS_NULLPOINTER_ERROR.getCode(),"未找到可用的数据"); | |||
| } | |||
| @Override | |||
| @Override | |||
| public PageInfo<TtCouponChannelVo> ttChannelList(TtCouponChannelVo ttChannelVo, Integer pageNum, Integer pageSize) { | |||
| handleCouponIds(ttChannelVo); | |||
| if(ttChannelVo.getId() != null && ttChannelVo.getId().equals(-999L)){ | |||
| return new PageInfo<TtCouponChannelVo>(); | |||
| } | |||
| PageInfo<TtCouponChannelVo> pageInfo = PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponChannelMapper.ttChannelList(ttChannelVo)); | |||
| List<TtCouponChannelVo> list = pageInfo.getList(); | |||
| if(list != null && !list.isEmpty()){ | |||
| List<Long> couponIds = list.stream().map(cc -> cc.getCouponId()).collect(Collectors.toList()); | |||
| Map<Long,WxCoupon> couponMap = wxCouponService.getCouponMap(couponIds,ttChannelVo); | |||
| for (TtCouponChannelVo ccv:list) { | |||
| ccv.setWxCoupon(couponMap.get(ccv.getCouponId())); | |||
| } | |||
| } | |||
| return pageInfo; | |||
| } | |||
| @Override | |||
| public WxCouponChannel getPriceAndStock(TenantEntity tenantEntity, Long couponChannelId) { | |||
| return wxCouponChannelMapper.getPriceAndStock(couponChannelId, tenantEntity.getTenantId()); | |||
| } | |||
| @@ -400,4 +400,135 @@ | |||
| </foreach> | |||
| </select> | |||
| <resultMap id="ttChannelResultMap" type="com.iformall.domain.vo.WxCouponChannelVo"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| <result column="coupon_id" jdbcType="BIGINT" property="couponId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="title" jdbcType="VARCHAR" property="title" /> | |||
| <result column="target_ad" jdbcType="INTEGER" property="targetAd" /> | |||
| <result column="business" jdbcType="INTEGER" property="business" /> | |||
| <result column="sub_business" jdbcType="INTEGER" property="subBusiness" /> | |||
| <result column="show_begin_time" jdbcType="TIMESTAMP" property="showBeginTime" /> | |||
| <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime" /> | |||
| <result column="end_time" jdbcType="TIMESTAMP" property="endTime" /> | |||
| <result column="status" jdbcType="INTEGER" property="status" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| <result column="sub_target_id" jdbcType="BIGINT" property="subTargetId" /> | |||
| <result column="qr_code" jdbcType="VARCHAR" property="qrCode"/> | |||
| <result column="tt_qr_code" jdbcType="VARCHAR" property="ttQrCode"/> | |||
| <result column="tt_spu_id" jdbcType="VARCHAR" property="ttSpuId"/> | |||
| <result column="channel_price" jdbcType="INTEGER" property="channelPrice"/> | |||
| <result column="channel_stock" jdbcType="INTEGER" property="channelStock"/> | |||
| <result column="spu_id" jdbcType="VARCHAR" property="spuId"/> | |||
| <result column="poi_status" jdbcType="INTEGER" property="poiStatus"/> | |||
| <result column="status_desc" jdbcType="VARCHAR" property="statusDesc"/> | |||
| <result column="last_status" jdbcType="INTEGER" property="lastStatus"/> | |||
| <result column="last_status_desc" jdbcType="VARCHAR" property="lastStatusDesc"/> | |||
| </resultMap> | |||
| <select id="ttChannelList" parameterType="com.iformall.domain.vo.TtCouponChannelVo" resultMap="ttChannelResultMap"> | |||
| select cc.`id`,cc.`tenant_id`,cc.`parent_tenant_id`,cc.`coupon_id`,cc.`coupon_status`,cc.`type`,cc.`title`, | |||
| cc.`target_ad`,cc.`business`,cc.`sub_business`,cc.`show_begin_time`,cc.`begin_time`,cc.`end_time`,cc.`status`, | |||
| cc.`create_date`,cc.`update_date`,cc.`sub_target_id`,cc.qr_code,cc.tt_spu_id,cc.channel_price,cc.channel_stock, | |||
| poi.coupon_channel_id,poi.spu_id,poi.status poi_status,poi.status_desc,poi.last_status,poi.last_status_desc | |||
| from wx_coupon_channel cc | |||
| left join tt_coupon_channel_poi poi on poi.coupon_channel_id = cc.id and poi.id = cc.`coupon_id` | |||
| where cc.`tenant_id` = #{tenantId} | |||
| <if test=" null != id "> | |||
| and cc.`id` = #{id} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and cc.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != couponId "> | |||
| and cc.`coupon_id` = #{couponId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and cc.`type` = #{type} | |||
| </if> | |||
| <if test=" null != title and ''!= title"> | |||
| and cc.`title` like concat('%', #{title},'%') | |||
| </if> | |||
| <if test=" null != targetAd "> | |||
| and cc.`target_ad` = #{targetAd} | |||
| </if> | |||
| <if test=" null != business "> | |||
| and cc.`business` = #{business} | |||
| </if> | |||
| <if test=" null != subBusiness "> | |||
| and cc.`sub_business` = #{subBusiness} | |||
| </if> | |||
| <if test=" null != showBeginTime "> | |||
| and cc.`show_begin_time` <= #{showBeginTime} | |||
| </if> | |||
| <if test=" null != startdate and null!=enddate"> | |||
| and cc.`create_date` between #{startdate} and #{enddate} | |||
| </if> | |||
| <if test=" null != status "> | |||
| and cc.`status` = #{status} | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and cc.`create_date` = #{createDate} | |||
| </if> | |||
| <if test=" null != updateDate "> | |||
| and cc.`update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != subTargetId "> | |||
| and cc.`sub_target_id` = #{subTargetId} | |||
| </if> | |||
| <if test=" null != spuId and '' != spuId"> | |||
| and poi.`spu_id` = #{spuId} | |||
| </if> | |||
| <if test=" null != poiStatus"> | |||
| and poi.`status` = #{poiStatus} | |||
| </if> | |||
| <if test=" null != lastStatus"> | |||
| and poi.`last_status` = #{lastStatus} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and cc.id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != couponIds "> | |||
| and cc.coupon_id in | |||
| <foreach collection="couponIds" index="index" item="couponIdsItem" open="(" separator="," close=")"> | |||
| #{couponIdsItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != targetAds "> | |||
| and cc.target_ad in | |||
| <foreach collection="targetAds" index="index" item="targetAdsItem" open="(" separator="," close=")"> | |||
| #{targetAdsItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </select> | |||
| </mapper> | |||