|
@ -25,6 +25,8 @@ |
|
|
<!-- 查询客户下周/月度用户积分排行榜 传参:客户Id | 维度 | 维度值 --> |
|
|
<!-- 查询客户下周/月度用户积分排行榜 传参:客户Id | 维度 | 维度值 --> |
|
|
<!-- user_point_statistical_daily中的action_flag有三种key值,plus(获取),exchange(积分兑换),minus(调整、惩罚),当action_flag为minus时,point_change为负值,其余均为正数 --> |
|
|
<!-- user_point_statistical_daily中的action_flag有三种key值,plus(获取),exchange(积分兑换),minus(调整、惩罚),当action_flag为minus时,point_change为负值,其余均为正数 --> |
|
|
<select id="selectPointRankWithinTimeZone" resultType="com.epmet.dto.result.ResiPointRankResultDTO"> |
|
|
<select id="selectPointRankWithinTimeZone" resultType="com.epmet.dto.result.ResiPointRankResultDTO"> |
|
|
|
|
|
select * from ( |
|
|
|
|
|
|
|
|
SELECT IF ( @point > point.TOTAL_POINT, |
|
|
SELECT IF ( @point > point.TOTAL_POINT, |
|
|
@rank := @rank + 1, |
|
|
@rank := @rank + 1, |
|
|
@rank := @rank + 0 |
|
|
@rank := @rank + 0 |
|
@ -38,7 +40,8 @@ |
|
|
total.USER_ID, |
|
|
total.USER_ID, |
|
|
|
|
|
|
|
|
IF |
|
|
IF |
|
|
( IFNULL( SUM( daily.POINT_CHANGE ), 0 ) <![CDATA[ < ]]> 0, 0, IFNULL( SUM( daily.POINT_CHANGE ), 0 ) ) AS TOTAL_POINT |
|
|
( IFNULL( SUM( daily.POINT_CHANGE ), 0 ) <![CDATA[ < ]]> 0, 0, IFNULL( SUM( daily.POINT_CHANGE ), 0 ) ) AS |
|
|
|
|
|
TOTAL_POINT |
|
|
FROM |
|
|
FROM |
|
|
user_point_total total |
|
|
user_point_total total |
|
|
LEFT JOIN user_point_statistical_daily daily ON daily.USER_ID = total.USER_ID |
|
|
LEFT JOIN user_point_statistical_daily daily ON daily.USER_ID = total.USER_ID |
|
@ -61,6 +64,8 @@ |
|
|
TOTAL_POINT DESC |
|
|
TOTAL_POINT DESC |
|
|
) point, |
|
|
) point, |
|
|
( SELECT @point := NULL, @rank := 1 ) a |
|
|
( SELECT @point := NULL, @rank := 1 ) a |
|
|
|
|
|
|
|
|
|
|
|
) temp |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 查询有无指定日期的积分日统计 userId dateId actionFlag--> |
|
|
<!-- 查询有无指定日期的积分日统计 userId dateId actionFlag--> |
|
|