From 6d80d900fab1f694d72080f7142fce4bcd936d89 Mon Sep 17 00:00:00 2001 From: hupeng Date: Sat, 23 Mar 2019 11:50:47 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8D=A1=E5=88=B8][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E6=8A=95=E6=94=BE=E6=B8=A0=E9=81=93=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E6=8A=95=E6=94=BE=E7=9A=84=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/domain/po/WxCoupon.java | 12 ++++ .../service/impl/WxCouponServiceImpl.java | 2 +- .../main/resources/mapper/WxCouponMapper.xml | 72 ++++++++++--------- 3 files changed, 52 insertions(+), 34 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java index 058b930d0..cf4bb9204 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java @@ -163,6 +163,10 @@ public class WxCoupon implements Serializable { @Transient private String merchantParams; + /**投放频道参数,用来过滤**/ + @Transient + private Integer targetAd; + //营销分析 private WxCouponStatisVo wxCouponStatisVo; @@ -442,6 +446,14 @@ public class WxCoupon implements Serializable { this.autoRefund = autoRefund; } + public Integer getTargetAd() { + return targetAd; + } + + public void setTargetAd(Integer targetAd) { + this.targetAd = targetAd; + } + public static enum Field { Id_ASC("`id` ASC"),Id_DESC("`id` DESC") diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index f39bd184f..483d3cebb 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -74,7 +74,7 @@ public class WxCouponServiceImpl implements WxCouponService { List wxCouponList = page.getList(); - if (wxCouponList.isEmpty()) { + if (wxCouponList.isEmpty() || wxCoupon.getTargetAd() != null) { return new ResultData(page); } diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index bad20c76f..32ed345c6 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -235,134 +235,140 @@ where 1 = 1 + + and 0 = (select count(*) from wx_coupon_channel cc + where c.`id` = cc.coupon_id + and cc.status = 0 + and cc.target_ad = #{targetAd}) + - and `id` = #{id} + and c.`id` = #{id} - and `tenant_id` = #{tenantId} + and c.`tenant_id` = #{tenantId} - and `type` < 7 + and c.`type` < 7 - and `type` = #{type} + and c.`type` = #{type} - and `cover_img` like concat('%', #{coverImg},'%') + and c.`cover_img` like concat('%', #{coverImg},'%') - and `title` like concat('%', #{title},'%') + and c.`title` like concat('%', #{title},'%') - and `sub_title` like concat('%', #{subTitle},'%') + and c.`sub_title` like concat('%', #{subTitle},'%') - and `sale_price` = #{salePrice} + and c.`sale_price` = #{salePrice} - and `use_price` = #{usePrice} + and c.`use_price` = #{usePrice} - and `use_limit_quantity` = #{useLimitQuantity} + and c.`use_limit_quantity` = #{useLimitQuantity} - and `send_type` = #{sendType} + and c.`send_type` = #{sendType} - and `valid_type` = #{validType} + and c.`valid_type` = #{validType} - and `valid_start_date` = #{validStartDate} + and c.`valid_start_date` = #{validStartDate} - and `valid_end_date` = #{validEndDate} + and c.`valid_end_date` = #{validEndDate} - and `valid_days` = #{validDays} + and c.`valid_days` = #{validDays} - and `detail` like concat('%', #{detail},'%') + and c.`detail` like concat('%', #{detail},'%') - and `price` = #{price} + and c.`price` = #{price} - and `unit` = #{unit} + and c.`unit` = #{unit} - and `remain_inventory` = #{remainInventory} + and c.`remain_inventory` = #{remainInventory} - and `inventory` = #{inventory} + and c.`inventory` = #{inventory} - and `remark` like concat('%', #{remark},'%') + and c.`remark` like concat('%', #{remark},'%') - and `status` = #{status} + and c.`status` = #{status} - and `create_date` between #{startdate} and #{enddate} + and c.`create_date` between #{startdate} and #{enddate} - and `update_date` = #{updateDate} + and c.`update_date` = #{updateDate} - and `business` = #{business} + and c.`business` = #{business} - and `support_transfer` = #{supportTransfer} + and c.`support_transfer` = #{supportTransfer} - and `subsidy_type` = #{subsidyType} + and c.`subsidy_type` = #{subsidyType} - and `subsidy_num` = #{subsidyNum} + and c.`subsidy_num` = #{subsidyNum} - and `press_limit_num` = #{pressLimitNum} + and c.`press_limit_num` = #{pressLimitNum} - and `press_limit_hours` = #{pressLimitHours} + and c.`press_limit_hours` = #{pressLimitHours} - and `auto_refund` = #{autoRefund} + and c.`auto_refund` = #{autoRefund} - and id in + and c.id in #{idItem} @@ -373,7 +379,7 @@