后台-sud小游戏时长统计-sql
This commit is contained in:
@@ -5,22 +5,22 @@
|
||||
<select id="statGameDurationByMonth"
|
||||
resultType="com.accompany.admin.vo.miniGame.MiniGameForSudAdminStatsVo">
|
||||
SELECT
|
||||
mg_id as gameId,
|
||||
mgr.mg_id as gameId,
|
||||
SUM(battle_duration) as totalDuration,
|
||||
SUM(CASE WHEN u.partition_id = 1 THEN battle_duration ELSE 0 END) AS enDuration,
|
||||
SUM(CASE WHEN u.partition_id = 2 THEN battle_duration ELSE 0 END) AS arDuration,
|
||||
SUM(CASE WHEN u.partition_id = 4 THEN battle_duration ELSE 0 END) AS zhDuration,
|
||||
SUM(CASE WHEN u.partition_id = 8 THEN battle_duration ELSE 0 END) AS trDuration,
|
||||
SUM(CASE WHEN u.partition_id = 16 THEN battle_duration ELSE 0 END) AS en2Duration
|
||||
FROM mini_game_round
|
||||
JOIN users u ON room_uid = u.uid
|
||||
FROM mini_game_round mgr
|
||||
JOIN users u ON mgr.room_uid = u.uid
|
||||
WHERE
|
||||
battle_start_at between #{startTime} and #{endTime}
|
||||
<if test="gameId != null">
|
||||
AND mg_id = #{gameId}
|
||||
AND mgr.mg_id = #{gameId}
|
||||
</if>
|
||||
and state = 2
|
||||
GROUP BY mg_id
|
||||
and mgr.state = 2
|
||||
GROUP BY mgr.mg_id
|
||||
</select>
|
||||
|
||||
<select id="pageGameRoundDetail" resultType="com.accompany.admin.vo.miniGame.MiniGameForSudAdminDetailVo">
|
||||
@@ -32,9 +32,9 @@
|
||||
where
|
||||
battle_start_at between #{startTime} and #{endTime}
|
||||
<if test="gameId != null">
|
||||
and mg_id = #{gameId}
|
||||
and mgr.mg_id = #{gameId}
|
||||
</if>
|
||||
and state = 2
|
||||
and mgr.state = 2
|
||||
order by mgr.update_time desc
|
||||
</select>
|
||||
|
||||
|
Reference in New Issue
Block a user