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

This commit is contained in:
2025-08-04 11:12:54 +08:00
parent ab8759e913
commit 7fab2a7f0a
5 changed files with 11 additions and 3 deletions

View File

@@ -234,6 +234,9 @@ public class Lucky24RecordAdminService {
Map<String, Lucky24PersonalStat> statMap = new HashMap<>(dateStrList.size()); Map<String, Lucky24PersonalStat> statMap = new HashMap<>(dateStrList.size());
String uRechargeLevel = userRechargeLevelService.getLevelByUid(uid); String uRechargeLevel = userRechargeLevelService.getLevelByUid(uid);
if (StringUtils.hasText(userRechargeLevel) && !userRechargeLevel.equalsIgnoreCase(uRechargeLevel)){
return new Lucky24PersonalStatVo(new PageResult<>(page));
}
CountDownLatch cdl = new CountDownLatch(2); CountDownLatch cdl = new CountDownLatch(2);

View File

@@ -56,6 +56,7 @@ public class Lucky24RecordAdminController extends BaseController {
@ApiImplicitParam(value = "partitionId", name = "分区ID", required = true), @ApiImplicitParam(value = "partitionId", name = "分区ID", required = true),
@ApiImplicitParam(value = "erbanNo", name = "用户ID"), @ApiImplicitParam(value = "erbanNo", name = "用户ID"),
@ApiImplicitParam(value = "date", name = "开始日期", required = true), @ApiImplicitParam(value = "date", name = "开始日期", required = true),
@ApiImplicitParam(value = "userRechargeLevel", name = "用户充值等级", required = false),
@ApiImplicitParam(value = "poolType", name = "数组类型", required = true), @ApiImplicitParam(value = "poolType", name = "数组类型", required = true),
@ApiImplicitParam(value = "sortCol", name = "排序列", required = true), @ApiImplicitParam(value = "sortCol", name = "排序列", required = true),
@ApiImplicitParam(value = "sortOrder", name = "排序方式", required = true), @ApiImplicitParam(value = "sortOrder", name = "排序方式", required = true),

View File

@@ -73,7 +73,7 @@
from lucky_24_record r force index (lucky_24_record_partition_id_pool_type_create_time_uid_index) from lucky_24_record r force index (lucky_24_record_partition_id_pool_type_create_time_uid_index)
<if test="null != userRechargeLevel and '' != userRechargeLevel"> <if test="null != userRechargeLevel and '' != userRechargeLevel">
inner join users u on r.uid = u.uid inner join users u on r.uid = u.uid
inner join user_recharge_level url on u.uid = url.uid and url.level = #{userRechargeLevel} inner join user_recharge_level url on r.uid = url.uid and url.`level` = #{userRechargeLevel}
</if> </if>
where r.partition_id = #{partitionId} where r.partition_id = #{partitionId}
and r.pool_type in <foreach collection="poolTypeList" item="poolType" separator="," open="(" close=")">#{poolType}</foreach> and r.pool_type in <foreach collection="poolTypeList" item="poolType" separator="," open="(" close=")">#{poolType}</foreach>
@@ -100,7 +100,7 @@
from lucky_24_record r force index (lucky_24_record_partition_id_pool_type_create_time_uid_index) from lucky_24_record r force index (lucky_24_record_partition_id_pool_type_create_time_uid_index)
<if test="null != userRechargeLevel and '' != userRechargeLevel"> <if test="null != userRechargeLevel and '' != userRechargeLevel">
inner join users u on r.uid = u.uid inner join users u on r.uid = u.uid
inner join user_recharge_level url on u.uid = url.uid and url.level = #{userRechargeLevel} inner join user_recharge_level url on r.uid = url.uid and url.`level` = #{userRechargeLevel}
</if> </if>
where r.partition_id = #{partitionId} where r.partition_id = #{partitionId}
and r.pool_type in <foreach collection="poolTypeList" item="poolType" separator="," open="(" close=")">#{poolType}</foreach> and r.pool_type in <foreach collection="poolTypeList" item="poolType" separator="," open="(" close=")">#{poolType}</foreach>

View File

@@ -16,7 +16,7 @@ public interface Lucky24StatMapper {
@Param("startDate") String startDate, @Param("endDate") String endDate); @Param("startDate") String startDate, @Param("endDate") String endDate);
List<Lucky24PersonalStat> listPersonalStat(@Param("partitionId") Integer partitionId, List<Lucky24PersonalStat> listPersonalStat(@Param("partitionId") Integer partitionId,
@Param("uid") Long uid, String userRechargeLevel, @Param("poolType") Integer poolType, @Param("uid") Long uid, @Param("userRechargeLevel") String userRechargeLevel, @Param("poolType") Integer poolType,
@Param("startDate") String startDate, @Param("endDate") String endDate); @Param("startDate") String startDate, @Param("endDate") String endDate);
} }

View File

@@ -33,6 +33,7 @@
<select id="listPersonalStat" resultType="com.accompany.sharding.vo.Lucky24PersonalStat"> <select id="listPersonalStat" resultType="com.accompany.sharding.vo.Lucky24PersonalStat">
select * from lucky_24_record_personal_stat s select * from lucky_24_record_personal_stat s
inner join user_recharge_level url on s.uid = url.uid
where s.date between #{startDate} and #{endDate} where s.date between #{startDate} and #{endDate}
and s.partition_id = #{partitionId} and s.partition_id = #{partitionId}
<if test="null != uid"> <if test="null != uid">
@@ -44,6 +45,9 @@
<if test="null == poolType"> <if test="null == poolType">
and s.pool_type = 0 and s.pool_type = 0
</if> </if>
<if test="null != userRechargeLevel and '' != userRechargeLevel">
and url.`level` = #{userRechargeLevel}
</if>
</select> </select>
</mapper> </mapper>