From 23b8153243f7a69acdda723792b5e56c03b38cb3 Mon Sep 17 00:00:00 2001 From: sangelxiu1 <15781802@163.com> Date: Wed, 24 Sep 2025 15:03:58 +0800 Subject: [PATCH] =?UTF-8?q?##=20Feat=20-=20Top=2030=20(=E7=9B=B4=E6=8E=A8?= =?UTF-8?q?=E4=BA=BA=E6=95=B0/=E7=9B=B4=E6=8E=A8=E9=87=91=E9=A2=9D)=20-=20?= =?UTF-8?q?=E6=8E=92=E9=99=A4=E6=AD=BB=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member/statis/MemberStatisticsMapper.xml | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/bd-business/bd-business-member/src/main/resources/mapper/member/statis/MemberStatisticsMapper.xml b/bd-business/bd-business-member/src/main/resources/mapper/member/statis/MemberStatisticsMapper.xml index e854266c..a33e7d3d 100644 --- a/bd-business/bd-business-member/src/main/resources/mapper/member/statis/MemberStatisticsMapper.xml +++ b/bd-business/bd-business-member/src/main/resources/mapper/member/statis/MemberStatisticsMapper.xml @@ -12,15 +12,16 @@ numberOfAmount from ( select - PK_REFERENCE, - count(PK_REFERENCE) numberOfPeople, + o.PK_REFERENCE, + count(DISTINCT o.PK_MEMBER) numberOfPeople, sum(order_amount) numberOfAmount - from sa_order + from sa_order o + right join cu_member m on m.PK_ID = o.pk_member and m.DEL_FLAG = 0 and m.CATEGORY = 0 where - del_flag = 0 + o.del_flag = 0 and order_status = 1 AND (order_type in (1,2) or (order_Type = 3 and ORDER_TYPE_EXTEND = 1)) - and pay_time between #{param.startDate} and #{param.endDate} + and o.pay_time between #{param.startDate} and #{param.endDate} group by PK_REFERENCE ) r left join cu_member cm on r.PK_REFERENCE = cm.pk_id @@ -37,16 +38,16 @@ numberOfAmount from ( select - PK_REFERENCE, - count(PK_REFERENCE) numberOfPeople, + o.PK_REFERENCE, + count(DISTINCT o.PK_MEMBER) numberOfPeople, sum(order_amount) numberOfAmount - from sa_order + from sa_order o + right join cu_member m on m.PK_ID = o.pk_member and m.DEL_FLAG = 0 and m.CATEGORY = 0 where - del_flag = 0 + o.del_flag = 0 and order_status = 1 AND (order_type in (1,2) or (order_Type = 3 and ORDER_TYPE_EXTEND = 1)) - and pay_time between #{param.startDate} and #{param.endDate} - group by PK_REFERENCE + and o.pay_time between #{param.startDate} and #{param.endDate} ) r left join cu_member cm on r.PK_REFERENCE = cm.pk_id WHERE ROWNUM 30