diff --git a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml
index d5a77dca8..945ee2207 100644
--- a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml
@@ -27,71 +27,61 @@
and `id` = #{id}
-
and `tenant_id` like concat('%', #{tenantId},'%')
-
and `merchant_id` = #{merchantId}
-
and `coupon_id` = #{couponId}
-
and `type` = #{type}
-
and `title` like concat('%', #{title},'%')
-
and `target_ad` = #{targetAd}
-
-
- and `business` like concat('%', #{business},'%')
+
+ and JSON_CONTAINS(`business`->'$',JSON_ARRAY('0'))
+
+
+ and (JSON_CONTAINS(`business`->'$',JSON_ARRAY('0')) or (JSON_CONTAINS(`business`->'$',JSON_ARRAY(#{business}))))
and `begin_time` = #{beginTime}
-
and `end_time` = #{endTime}
-
and `status` = #{status}
-
and `create_date` = #{createDate}
-
and `update_date` = #{updateDate}
-
and `sub_target_id` = #{subTargetId}
-
and id in
diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml
index 6e8b40a1b..58e3336e5 100644
--- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml
@@ -1,238 +1,214 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
`id`,`tenant_id`,`merchant_id`,`type`,`cover_img`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`target_ad`,`send_type`,`valid_type`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`price`,`unit`,`remain_inventory`,`inventory`,`remark`,`status`,`create_date`,`update_date`,`business`
-
- where 1 = 1
-
-
- and `id` = #{id}
-
-
-
-
- and `tenant_id` like concat('%', #{tenantId},'%')
-
-
-
-
- and `merchant_id` = #{merchantId}
-
-
-
-
- and `type` = #{type}
-
-
-
-
- and `cover_img` like concat('%', #{coverImg},'%')
-
-
-
-
- and `title` like concat('%', #{title},'%')
-
-
-
-
- and `sub_title` like concat('%', #{subTitle},'%')
-
-
-
-
- and `sale_price` = #{salePrice}
-
-
-
-
- and `use_price` = #{usePrice}
-
-
-
-
- and `use_limit_quantity` = #{useLimitQuantity}
-
-
-
-
- and `target_ad` = #{targetAd}
-
-
-
-
- and `send_type` = #{sendType}
-
-
-
-
-
-
- and `valid_type` = #{validType}
-
-
-
-
- and `valid_start_date` = #{validStartDate}
-
-
-
-
- and `valid_end_date` = #{validEndDate}
-
-
-
-
- and `valid_days` = #{validDays}
-
-
-
-
- and `detail` like concat('%', #{detail},'%')
-
-
-
-
- and `price` = #{price}
-
-
-
-
- and `unit` = #{unit}
-
-
-
-
- and `remain_inventory` = #{remainInventory}
-
-
-
-
- and `inventory` = #{inventory}
-
-
-
-
- and `remark` like concat('%', #{remark},'%')
-
-
-
-
- and `status` = #{status}
-
-
-
-
- and `create_date` = #{createDate}
-
-
-
-
- and `update_date` = #{updateDate}
-
-
-
-
- and `business` like concat('%', #{business},'%')
-
-
-
- and id in
-
- #{idItem}
-
-
- order by ${sortColumns}
-
+
+ where 1 = 1
+
+
+ and `id` = #{id}
+
+
+
+ and `tenant_id` like concat('%', #{tenantId},'%')
+
+
+
+ and `merchant_id` = #{merchantId}
+
+
+
+ and `type` = #{type}
+
+
+
+ and `cover_img` like concat('%', #{coverImg},'%')
+
+
+
+ and `title` like concat('%', #{title},'%')
+
+
+
+ and `sub_title` like concat('%', #{subTitle},'%')
+
+
+
+ and `sale_price` = #{salePrice}
+
+
+
+ and `use_price` = #{usePrice}
+
+
+
+ and `use_limit_quantity` = #{useLimitQuantity}
+
+
+
+ and `target_ad` = #{targetAd}
+
+
+
+ and `send_type` = #{sendType}
+
+
+
+
+ and `valid_type` = #{validType}
+
+
+
+ and `valid_start_date` = #{validStartDate}
+
+
+
+ and `valid_end_date` = #{validEndDate}
+
+
+
+ and `valid_days` = #{validDays}
+
+
+
+ and `detail` like concat('%', #{detail},'%')
+
+
+ and `price` = #{price}
+
+
+ and `unit` = #{unit}
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ and `remain_inventory` = #{remainInventory}
+
+
+
+ and `inventory` = #{inventory}
+
+
+
+ and `remark` like concat('%', #{remark},'%')
+
+
+
+ and `status` = #{status}
+
+
+
+ and `create_date` = #{createDate}
+
+
+
+ and `update_date` = #{updateDate}
+
+
+
+ and JSON_CONTAINS(`business`->'$',JSON_ARRAY('0'))
+
+
+ and (JSON_CONTAINS(`business`->'$',JSON_ARRAY('0')) or (JSON_CONTAINS(`business`->'$',JSON_ARRAY(#{business}))))
+
+
+ and id in
+
+ #{idItem}
+
+
+ order by ${sortColumns}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
c.tenant_id,c.merchant_id,c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.use_limit_quantity,c.target_ad,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.detail,c.price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,c.create_date,c.update_date,c.business,
m.img_url,m.name,m.link_phone,m.status,
s.addr,s.shop_number,s.baidu_poi,
@@ -241,57 +217,58 @@
-
-
-
-
-
+
+
+
+
c.tenant_id,c.merchant_id,c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.use_limit_quantity,c.target_ad,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.detail,c.price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,c.create_date,c.update_date,c.business,
m.img_url,m.name,m.link_phone,m.status,
s.addr,s.shop_number,s.baidu_poi,
mb.building_name,mf.floor_name
-
-
-
+
+
+
update wx_coupon SET remain_inventory = remain_inventory - #{number} where id = #{id} and remain_inventory>= #{number}