From 6b5f08a6395edb2393f37c71efb395d160e9b113 Mon Sep 17 00:00:00 2001 From: liaozetao <1107136310@qq.com> Date: Wed, 1 Nov 2023 13:01:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E8=AE=B0=E5=BD=95=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=B4=AF=E8=AE=A1=E8=BD=AC=E8=B5=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mappers/FlowTeamSettlementInfoMapper.xml | 47 +++++++++++++++++-- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/xuanyin-flow-team/xuanyin-flow-team-service/src/main/resources/xuanyin/mappers/FlowTeamSettlementInfoMapper.xml b/xuanyin-flow-team/xuanyin-flow-team-service/src/main/resources/xuanyin/mappers/FlowTeamSettlementInfoMapper.xml index c77c17a4a..1a5c9efa4 100644 --- a/xuanyin-flow-team/xuanyin-flow-team-service/src/main/resources/xuanyin/mappers/FlowTeamSettlementInfoMapper.xml +++ b/xuanyin-flow-team/xuanyin-flow-team-service/src/main/resources/xuanyin/mappers/FlowTeamSettlementInfoMapper.xml @@ -101,7 +101,9 @@ sum(a.totalChargeUserNum) as totalChargeUserNum, sum(a.totalChargeNum) as totalChargeNum, sum(a.totalGiveNum) as totalGiveNum, - sum(a.totalGiveAmount) as totalGiveAmount + sum(a.totalGiveAmount) as totalGiveAmount, + sum(a.totalGiveUserNum) as totalGiveUserNum, + sum(a.newUserGiveAmount) as newUserGiveAmount from ( select date_format(u.create_time, '%Y-%m') as `month`, @@ -111,7 +113,9 @@ 0 as totalChargeUserNum, 0 as totalChargeNum, 0 as totalGiveNum, - 0 as totalGiveAmount + 0 as totalGiveAmount, + 0 as totalGiveUserNum, + 0 as newUserGiveAmount from flow_team_member_invite_user as fm, users as u where fm.uid = u.uid @@ -130,7 +134,9 @@ 0 as totalChargeUserNum, 0 as totalChargeNum, 0 as totalGiveNum, - 0 as totalGiveAmount + 0 as totalGiveAmount, + 0 as totalGiveUserNum, + 0 as newUserGiveAmount from flow_team_member_invite_user as fi, users as u, charge_record as r where fi.uid = r.uid @@ -155,7 +161,9 @@ count(distinct r.uid) as totalChargeUserNum, count(r.charge_record_id) as totalChargeNum, 0 as totalGiveNum, - 0 as totalGiveAmount + 0 as totalGiveAmount, + 0 as totalGiveUserNum, + 0 as newUserGiveAmount from flow_team_member_invite_user as fi, charge_record as r where fi.uid = r.uid and r.charge_status in (2,6) @@ -180,7 +188,9 @@ 0 as totalChargeUserNum, 0 as totalChargeNum, count(1) as totalGiveNum, - ifnull(sum(dgh.diamond_num / 1000), 0) as totalGiveAmount + ifnull(sum(dgh.diamond_num / 1000), 0) as totalGiveAmount, + count(distinct dgh.to_uid) as totalGiveUserNum, + 0 as newUserGiveAmount from flow_team_member_invite_user as fi inner join diamond_give_history as dgh on dgh.to_uid = fi.uid where dgh.diamond_num > 0 @@ -194,6 +204,33 @@ group by `month`, fi.team_id + union + select + date_format(dgh.create_time, '%Y-%m') as `month`, + 0 as newUserNum, + 0 as newUserChargeAmount, + 0 as totalChargeAmount, + 0 as totalChargeUserNum, + 0 as totalChargeNum, + 0 as totalGiveNum, + 0 as totalGiveAmount, + 0 as totalGiveUserNum, + ifnull(sum(dgh.diamond_num / 1000), 0) as newUserGiveAmount + from flow_team_member_invite_user as fi + inner join users as u on u.uid = fi.uid + inner join diamond_give_history as dgh on dgh.to_uid = fi.uid + where dgh.diamond_num > 0 + and date_format(dgh.create_time, '%Y-%m') = date_format(u.create_time, '%Y-%m') + + and dgh.create_time >= #{queryLimitTime} + + + and fi.team_id in + + #{teamId} + + + group by `month`, fi.team_id ) as a group by a.`month`