From 10767c2e3c1d58671bbc337901f92408898d45f0 Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 22 Mar 2019 17:06:12 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[=E8=90=A5=E9=94=80=E5=88=86=E6=9E=90][?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0][=E5=8D=A1=E8=90=A5=E9=94=80=E5=88=97?= =?UTF-8?q?=E8=A1=A8]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/WxCouponMapper.xml | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index b684b964c..362b8e4fb 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -48,11 +48,11 @@ - `id`,`tenant_id`,`type`,`cover_img`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`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`,`support_transfer`,`subsidy_num`,`subsidy_type`, - `press_limit_num`, `press_limit_hours`, `auto_refund` - + `id`,`tenant_id`,`type`,`cover_img`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`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`,`support_transfer`,`subsidy_num`,`subsidy_type`, + `press_limit_num`, `press_limit_hours`, `auto_refund` + where 1 = 1 @@ -402,31 +402,31 @@ - update wx_coupon SET remain_inventory = remain_inventory - #{number} where id = #{id} and remain_inventory>= #{number} - + update wx_coupon SET remain_inventory = remain_inventory - #{number} where id = #{id} and remain_inventory>= #{number} + - update wx_coupon SET status = 1, update_date = now() - where status = 0 and valid_type = 1 and valid_end_date < now() - + update wx_coupon SET status = 1, update_date = now() + where status = 0 and valid_type = 1 and valid_end_date < now() + - update wx_coupon c - SET c.status = 1, c.update_date = now() - where c.status = 0 and - (select count(*) from wx_coupon_merchant cm, wx_merchant m - where m.id = cm.merchant_id - and c.id = cm.product_id - and cm.status = 0 - and m.status = 1) = 0 - + update wx_coupon c + SET c.status = 1, c.update_date = now() + where c.status = 0 and + (select count(*) from wx_coupon_merchant cm, wx_merchant m + where m.id = cm.merchant_id + and c.id = cm.product_id + and cm.status = 0 + and m.status = 1) = 0 + select count(co.id) - from wx_card_info ci - left join wx_coupon c on c.id = ci.coupon_id - left join wx_coupon_order co on co.id = ci.id - where c.type = 100 - and c.create_date between #{startdate} and #{enddate} + from wx_card_info ci + left join wx_coupon c on c.id = ci.coupon_id + left join wx_coupon_order co on co.id = ci.id + where c.type = 100 + and c.create_date between #{startdate} and #{enddate}