From 27602cbef83aaea4587f74c4e80ead36b74cc0ef Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 22 Mar 2019 16:51:50 +0800 Subject: [PATCH] =?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 --- .../src/main/resources/mapper/WxCouponMapper.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 95cebe1be..6f95e6549 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -104,7 +104,7 @@ and `valid_start_date` = #{validStartDate} - + and `valid_end_date` = #{validEndDate} @@ -731,16 +731,16 @@ left join wx_card_transfer_info wcs on wcs.coupon_order_id = ci.id where wc.id = c.id) as transfer_count, - (select sum(round(ci.sale_amount/100,2)) from wx_card_info ci + (select sum(ci.sale_amount) from wx_card_info ci left join wx_coupon wc on wc.id = ci.coupon_id where wc.id = c.id) as sale_amount, - (select sum(round(wcs.real_payment/100,2)) from wx_card_info ci + (select sum(wcs.real_payment) from wx_card_info ci left join wx_coupon wc on wc.id = ci.coupon_id left join wx_card_spend wcs on wcs.card_id = ci.id where wc.id = c.id) as sum_payment, - (select sum(round(sc.subsidy/100,2)) from wx_card_info ci + (select sum(sc.subsidy) from wx_card_info ci left join wx_coupon wc on wc.id = ci.coupon_id left join wx_merchant_subsidy sc on sc.coupon_order_id = ci.id where wc.id = c.id) as sum_subsidy @@ -760,7 +760,7 @@ (select count(wco.id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count, (select count(wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 1 and wc.id = c.id) as sum_payment, (select count(wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 3 and wc.id = c.id) as backpay_count, - (select sum(round(sc.subsidy/100,2)) from wx_coupon wc + (select sum(sc.subsidy) from wx_coupon wc left join wx_coupon_order wo on wo.coupon_id = wc.id left join wx_merchant_subsidy sc on sc.coupon_order_id = wo.id where wc.id = c.id) as sum_subsidy @@ -790,7 +790,7 @@ (select count(wo.id) from wx_coupon wc left join wx_order wo on wo.product_id = wc.id - where wo.order_status = 7 and wc.id = c.id) as press_succ_count, + where wo.order_status = 1 and wc.id = c.id) as press_succ_count, (select count(wop.id) from wx_coupon wc left join wx_order wo on wo.product_id = wc.id @@ -902,7 +902,7 @@ @@ -918,7 +918,7 @@ round( (select count(wo.id) from wx_coupon wc left join wx_order wo on wo.product_id = wc.id - where wo.order_status = 7 and wc.type = 8 + where wo.order_status = 1 and wc.type = 8 and wo.create_date between #{startdate} and #{enddate}) / (select count(wop.id) from wx_coupon wc