diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index b684b964c..0d56a2d0f 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 @@ -204,6 +204,7 @@ + where 1 = 1 and `id` = #{id} @@ -214,7 +215,7 @@ - and `type` < 7 + and `type` < 7 @@ -402,31 +403,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}