新增邀请用户导出功能
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
package com.xuanyin.flowteam.dto;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.converters.date.DateDateConverter;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author: liaozetao
|
||||
* @date: 2023/8/12 13:59
|
||||
* @description:
|
||||
*/
|
||||
@Data
|
||||
public class FlowTeamSettlementInfoExportDto {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ExcelProperty("ID")
|
||||
private String erBanNo;
|
||||
|
||||
/**
|
||||
* 注册时间
|
||||
*/
|
||||
@ExcelProperty(value = "注册时间", converter = DateDateConverter.class)
|
||||
private Date signUpTime;
|
||||
|
||||
/**
|
||||
* 被邀请时间
|
||||
*/
|
||||
@ExcelProperty(value = "被邀请时间", converter = DateDateConverter.class)
|
||||
private Date inviteTime;
|
||||
|
||||
/**
|
||||
* 首充时间
|
||||
*/
|
||||
@ExcelProperty(value = "首充时间", converter = DateDateConverter.class)
|
||||
private Date firstChargeTime;
|
||||
|
||||
/**
|
||||
* 从被邀请时间起算首次充值时间
|
||||
*/
|
||||
@ExcelProperty("从被邀请时间起算首次充值时间")
|
||||
private Integer diffTimeNum;
|
||||
|
||||
/**
|
||||
* 首次充值金额
|
||||
*/
|
||||
@ExcelProperty("首次充值金额")
|
||||
private BigDecimal firstChargeAmount;
|
||||
|
||||
/**
|
||||
* 首次获得转赠钻石时间
|
||||
*/
|
||||
@ExcelProperty(value = "首次获得转赠钻石时间", converter = DateDateConverter.class)
|
||||
private Date firstGiveTime;
|
||||
|
||||
/**
|
||||
* 首次获得转赠钻石金额
|
||||
*/
|
||||
@ExcelProperty("首次获得转赠钻石金额")
|
||||
private BigDecimal diamondAmount;
|
||||
|
||||
/**
|
||||
* 从被邀请起截止到目前的充值
|
||||
*/
|
||||
@ExcelProperty("从被邀请起截止到目前的充值")
|
||||
private BigDecimal totalChargeAmount;
|
||||
|
||||
/**
|
||||
* 从被邀请起截止到目前转赠的钻石流水
|
||||
*/
|
||||
@ExcelProperty("从被邀请起截止到目前转赠的钻石流水")
|
||||
private BigDecimal totalDiamondAmount;
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
package com.xuanyin.flowteam.mapper;
|
||||
|
||||
import com.xuanyin.flowteam.dto.FlowTeamSettlementInfoExportDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: liaozetao
|
||||
* @date: 2023/8/12 13:50
|
||||
* @description:
|
||||
*/
|
||||
public interface FlowTeamSettlementInfoMapperExpand {
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*
|
||||
* @param groupId
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
List<FlowTeamSettlementInfoExportDto> settlementExport(@Param("groupId") Long groupId, @Param("teamId") String teamId);
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.xuanyin.flowteam.mapper.FlowTeamSettlementInfoMapperExpand">
|
||||
<select id="settlementExport" resultType="com.xuanyin.flowteam.dto.FlowTeamSettlementInfoExportDto">
|
||||
select
|
||||
u.erban_no as erBanNo,
|
||||
a.sign_time as signUpTime,
|
||||
u.create_time as inviteTime,
|
||||
cr1.first_charge_time as firstChargeTime,
|
||||
datediff(cr1.first_charge_time, u.create_time) as diffTimeNum,
|
||||
(cr2.amount / 100) as firstChargeAmount,
|
||||
dgh1.first_give_time as firstGiveTime,
|
||||
(dgh2.diamond_num / 1000) as diamondAmount,
|
||||
((select sum(cr.amount) from charge_record as cr where cr.uid = u.uid and cr.charge_status = 2 and
|
||||
cr.create_time between u.create_time and now()) / 100) as totalChargeAmount,
|
||||
((select sum(dgh.diamond_num) from diamond_give_history as dgh where dgh.to_uid = u.uid and dgh.create_time
|
||||
between u.create_time and now()) / 1000) as totalDiamondAmount
|
||||
from users as u
|
||||
inner join account as a on a.uid = u.uid
|
||||
left join (
|
||||
select cr.uid, min(cr.create_time) as first_charge_time from charge_record as cr where cr.charge_status = 2
|
||||
group by cr.uid
|
||||
) as cr1 on cr1.uid = u.uid
|
||||
left join charge_record as cr2 on cr2.uid = cr1.uid and cr2.create_time = cr1.first_charge_time and
|
||||
cr2.charge_status = 2
|
||||
left join (
|
||||
select dgh.to_uid, min(dgh.create_time) as first_give_time from diamond_give_history as dgh group by dgh.to_uid
|
||||
) as dgh1 on dgh1.to_uid = u.uid
|
||||
left join diamond_give_history as dgh2 on dgh2.to_uid = dgh1.to_uid and dgh2.create_time = dgh1.first_give_time
|
||||
where u.invite_code is not null
|
||||
and u.invite_code in (
|
||||
select
|
||||
ftmic.invite_code
|
||||
from flow_team_info as fti
|
||||
inner join flow_team_member as ftm on ftm.team_id = fti.team_id
|
||||
inner join flow_team_member_invite_code as ftmic on ftmic.member_id = ftm.member_id
|
||||
where
|
||||
fti.`status` = 1
|
||||
and ftm.member_status = 1
|
||||
<if test="groupId != null">
|
||||
and fti.group_id = #{groupId}
|
||||
</if>
|
||||
<if test="teamId != null and teamId != ''">
|
||||
and fti.team_id = #{teamId}
|
||||
</if>
|
||||
);
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user