From d5b815af43371c41eb78c7d246be60ce393775ab Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 15 Mar 2019 19:34:31 +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, 2 insertions(+), 14 deletions(-) diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 7f1ab02e3..c52f84e07 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -669,9 +669,6 @@ select DATE_FORMAT(ci.create_date,'%Y-%m-%d') xtime,sum(ci.sale_amount) xcount from wx_card_info ci left join wx_coupon c on c.id = ci.coupon_id where ci.create_date between #{startdate} and #{enddate} - - and c.id = #{id} - group by xtime @@ -680,21 +677,15 @@ left join wx_coupon c on c.id = ci.coupon_id left join wx_card_spend wcs on wcs.card_id = ci.id where ci.create_date between #{startdate} and #{enddate} - - and c.id = #{id} - group by xtime select c.*, - (select count(distinct wco.owner_id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count, + (select count(distinct wco.id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count, (select count(distinct 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 payment_count, (select count(distinct 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 from wx_coupon c where 1=1