幸运24-后台-个人-用户充值等级-查询

This commit is contained in:
khalil
2025-07-04 18:37:52 +08:00
parent 8d06823be0
commit ecba61bb1e
6 changed files with 30 additions and 22 deletions

View File

@@ -20,12 +20,12 @@ public interface Lucky24RecordMapper extends BaseMapper<Lucky24Record> {
List<Lucky24PersonalStat> listPersonal(@Param("partitionId") Integer partitionId,
@Param("uid") Long uid,
@Param("startTime") Date startTime, @Param("endTime") Date endTime,
@Param("userRechargeLevel") String userRechargeLevel, @Param("startTime") Date startTime, @Param("endTime") Date endTime,
@Param("zoneIdHour") long zoneIdHour);
List<Lucky24PersonalStat> listPersonalByPoolType(@Param("partitionId") Integer partitionId,
@Param("uid") Long uid, @Param("poolType") Integer poolType,
@Param("startTime") Date startTime, @Param("endTime") Date endTime,
@Param("zoneIdHour") long zoneIdHour);
@Param("uid") Long uid, @Param("userRechargeLevel") String userRechargeLevel, @Param("poolType") Integer poolType,
@Param("startTime") Date startTime, @Param("endTime") Date endTime,
@Param("zoneIdHour") long zoneIdHour);
}

View File

@@ -49,7 +49,7 @@
</select>
<select id="listPersonal" resultType="com.accompany.sharding.vo.Lucky24PersonalStat">
select date(date_add(r.create_time, INTERVAL #{zoneIdHour} HOUR)) `date`, partition_id,
select date(date_add(r.create_time, INTERVAL #{zoneIdHour} HOUR)) `date`, r.partition_id,
r.uid, 0 as pool_type,
sum(gift_num * gift_gold_price) `totalInput`,
sum(win_gold_num) `totalOutput`,
@@ -60,6 +60,10 @@
count((case when win_gold_num > 0 then r.uid else null end)) `winNum`,
ifnull(count((case when win_gold_num > 0 then r.uid else null end)) / count(*),0) `winRate`
from lucky_24_record r
<if test="null != userRechargeLevel and '' != userRechargeLevel">
inner join users u on r.uid = u.uid
inner join user_recharge_level url on u.uid = url.uid and url.level = #{userRechargeLevel}
</if>
where r.create_time >= #{startTime} and r.create_time &lt;= #{endTime}
<if test="null != uid">
and r.uid = #{uid}
@@ -69,7 +73,7 @@
</select>
<select id="listPersonalByPoolType" resultType="com.accompany.sharding.vo.Lucky24PersonalStat">
select date(date_add(r.create_time, INTERVAL #{zoneIdHour} HOUR)) `date`, partition_id,
select date(date_add(r.create_time, INTERVAL #{zoneIdHour} HOUR)) `date`, r.partition_id,
r.uid, r.pool_type,
sum(gift_num * gift_gold_price) `totalInput`,
sum(win_gold_num) `totalOutput`,
@@ -80,6 +84,10 @@
count((case when win_gold_num > 0 then r.uid else null end)) `winNum`,
ifnull(count((case when win_gold_num > 0 then r.uid else null end)) / count(*),0) `winRate`
from lucky_24_record r
<if test="null != userRechargeLevel and '' != userRechargeLevel">
inner join users u on r.uid = u.uid
inner join user_recharge_level url on u.uid = url.uid and url.level = #{userRechargeLevel}
</if>
where r.create_time >= #{startTime} and r.create_time &lt;= #{endTime}
<if test="null != uid">
and r.uid = #{uid}