后台-推广后台-包含补填邀请码的用户
This commit is contained in:
@@ -12,7 +12,6 @@ package com.xuanyin.flowteam.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xuanyin.flowteam.constant.FlowTeamConstant;
|
||||
import com.xuanyin.flowteam.mapper.FlowTeamInfoMapper;
|
||||
import com.xuanyin.flowteam.model.FlowTeamInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -31,15 +30,13 @@ public class FlowTeamInfoService extends ServiceImpl<FlowTeamInfoMapper, FlowTea
|
||||
|
||||
public FlowTeamInfo getByTeamId(String teamId) {
|
||||
QueryWrapper<FlowTeamInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(FlowTeamInfo::getTeamId, teamId)
|
||||
.eq(FlowTeamInfo::getStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_VALID);
|
||||
queryWrapper.lambda().eq(FlowTeamInfo::getTeamId, teamId);
|
||||
return getOne(queryWrapper);
|
||||
}
|
||||
|
||||
public List<FlowTeamInfo> listByGroupId(Long groupId) {
|
||||
QueryWrapper<FlowTeamInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(FlowTeamInfo::getGroupId, groupId)
|
||||
.eq(FlowTeamInfo::getStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_VALID);
|
||||
queryWrapper.lambda().eq(FlowTeamInfo::getGroupId, groupId);
|
||||
return list(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
@@ -11,14 +11,12 @@
|
||||
from
|
||||
(select fm.create_time , team_id, fi.invite_code
|
||||
from flow_team_member fm, flow_team_member_invite_code fi
|
||||
where member_status != -1
|
||||
and fm.member_id = fi.member_id
|
||||
where fm.member_id = fi.member_id
|
||||
<if test="teamId != null and teamId != ''">
|
||||
and team_id = #{teamId}
|
||||
</if>
|
||||
group by fm.create_time, team_id, fi.invite_code) a, users u
|
||||
where a.invite_code = u.invite_code
|
||||
and u.create_time >= a.create_time
|
||||
<if test="onlyQueryOld != null and onlyQueryOld">
|
||||
and date_format(u.create_time, '%Y-%m') < date_format(current_timestamp, '%Y-%m')
|
||||
</if>
|
||||
@@ -30,17 +28,14 @@
|
||||
from
|
||||
(select fm.create_time , team_id, fi.invite_code
|
||||
from flow_team_member fm, flow_team_member_invite_code fi
|
||||
where member_status != -1
|
||||
and fm.member_id = fi.member_id
|
||||
where fm.member_id = fi.member_id
|
||||
<if test="teamId != null and teamId != ''">
|
||||
and team_id = #{teamId}
|
||||
</if>
|
||||
group by fm.create_time, team_id, fi.invite_code) a, users u, charge_record r
|
||||
where u.create_time >= a.create_time
|
||||
and a.invite_code = u.invite_code
|
||||
where a.invite_code = u.invite_code
|
||||
and u.uid = r.uid and r.charge_status = 2
|
||||
and r.charge_prod_id != 'exchange'
|
||||
and date_format(r.create_time, '%Y-%m') = date_format(u.create_time, '%Y-%m')
|
||||
<if test="onlyQueryOld != null and onlyQueryOld">
|
||||
and date_format(r.create_time, '%Y-%m') < date_format(current_timestamp, '%Y-%m')
|
||||
</if>
|
||||
@@ -53,15 +48,13 @@
|
||||
from
|
||||
(select fm.create_time , team_id, fi.invite_code
|
||||
from flow_team_member fm, flow_team_member_invite_code fi
|
||||
where member_status != -1
|
||||
and fm.member_id = fi.member_id
|
||||
where fm.member_id = fi.member_id
|
||||
<if test="teamId != null and teamId != ''">
|
||||
and team_id = #{teamId}
|
||||
</if>
|
||||
group by fm.create_time, team_id, fi.invite_code) a, users u , charge_record r
|
||||
where a.invite_code = u.invite_code
|
||||
and u.uid = r.uid and r.charge_status = 2 and r.charge_prod_id != 'exchange'
|
||||
and u.create_time >= a.create_time
|
||||
<if test="onlyQueryOld != null and onlyQueryOld">
|
||||
and date_format(r.create_time, '%Y-%m') < date_format(current_timestamp, '%Y-%m')
|
||||
</if>
|
||||
@@ -82,13 +75,11 @@
|
||||
from
|
||||
(select fm.create_time , team_id, fi.invite_code
|
||||
from flow_team_member fm, flow_team_member_invite_code fi
|
||||
where member_status != -1
|
||||
and fm.member_id = fi.member_id
|
||||
where fm.member_id = fi.member_id
|
||||
and team_id = #{teamId}
|
||||
group by fm.create_time, team_id, fi.invite_code) a, users u , charge_record r, users u2
|
||||
where a.invite_code = u.invite_code
|
||||
and u.uid = r.uid and r.charge_status = 2 and r.charge_prod_id != 'exchange'
|
||||
and u.create_time >= a.create_time
|
||||
and u2.uid = u.invite_uid
|
||||
and date_format(r.create_time, '%Y-%m') = #{month}
|
||||
<if test="erbanNo != null and erbanNo != ''">
|
||||
@@ -123,8 +114,7 @@
|
||||
, ifnull(sum(r.amount / 100), 0) newUserChargeAmount , 0 totalChargeAmount, 0 totalChargeUserNum, 0 totalChargeNum
|
||||
from
|
||||
flow_team_member_invite_user fi, charge_record r
|
||||
where r.create_time >= fi.create_time
|
||||
and fi.uid = r.uid and r.charge_status = 2
|
||||
where fi.uid = r.uid and r.charge_status = 2
|
||||
and r.charge_prod_id != 'exchange'
|
||||
and r.buss_type in (0,4)
|
||||
<if test="teamIds != null and teamIds.size > 0">
|
||||
@@ -133,7 +123,6 @@
|
||||
#{teamId}
|
||||
</foreach>
|
||||
</if>
|
||||
and date_format(r.create_time, '%Y-%m') = date_format(fi.create_time, '%Y-%m')
|
||||
group by month
|
||||
union
|
||||
-- 小组过去1年邀请的用户在N月的充值概况
|
||||
@@ -144,9 +133,8 @@
|
||||
flow_team_member_invite_user fi , charge_record r
|
||||
where fi.uid = r.uid and r.charge_status = 2 and r.charge_prod_id != 'exchange'
|
||||
and r.buss_type in (0,4)
|
||||
and r.create_time >= fi.create_time
|
||||
<if test="queryLimitTime != null">
|
||||
and fi.create_time >= #{queryLimitTime}
|
||||
and r.create_time >= #{queryLimitTime}
|
||||
</if>
|
||||
<if test="teamIds != null and teamIds.size > 0">
|
||||
and fi.team_id in
|
||||
@@ -172,7 +160,6 @@
|
||||
charge_record r, flow_team_member fm, flow_team_member_invite_user fu
|
||||
left join users u on fu.uid = u.uid
|
||||
where fu.uid = r.uid and r.charge_status = 2 and r.charge_prod_id != 'exchange'
|
||||
and r.create_time >= fu.create_time
|
||||
and fm.member_id = fu.member_id
|
||||
<if test="teamIds != null and teamIds.size > 0">
|
||||
and fu.team_id in
|
||||
@@ -189,14 +176,13 @@
|
||||
|
||||
<select id="listFlowTeamSettleDetailV3" resultType="com.xuanyin.flowteam.dto.FlowTeamSettlementDetail">
|
||||
select u.erban_no erbanNo, u.nick nick,
|
||||
fu.create_time createTime, u.invite_code inviteCode,
|
||||
u.create_time createTime, u.invite_code inviteCode,
|
||||
fm.member_name inviteUserNick,
|
||||
sum(r.amount /100) amount
|
||||
from
|
||||
charge_record r, flow_team_member fm, flow_team_member_invite_user fu
|
||||
left join users u on fu.uid = u.uid
|
||||
where fu.uid = r.uid and r.charge_status = 2 and r.charge_prod_id != 'exchange'
|
||||
and r.create_time >= fu.create_time
|
||||
and fm.member_id = fu.member_id
|
||||
<if test="teamIds != null and teamIds.size > 0">
|
||||
and fu.team_id in
|
||||
@@ -207,7 +193,7 @@
|
||||
and r.buss_type in (0,4)
|
||||
and date_format(r.create_time, '%Y-%m') = #{month}
|
||||
<if test="queryLimitTime != null and queryLimitTime != ''">
|
||||
and fu.create_time >= #{queryLimitTime}
|
||||
and u.create_time >= #{queryLimitTime}
|
||||
</if>
|
||||
<if test="erbanNo != null and erbanNo != ''">
|
||||
and u.erban_no = #{erbanNo}
|
||||
|
Reference in New Issue
Block a user