|
|
@@ -682,6 +682,189 @@
|
|
|
IFNULL(live_time,999) ,
|
|
|
id desc
|
|
|
</select>
|
|
|
+ <select id="queryPlayerInfoSeasonRankPageByPage" parameterType="java.util.Map"
|
|
|
+ resultMap="PagePlayerInfoResult">
|
|
|
+
|
|
|
+ SELECT
|
|
|
+ game_id,
|
|
|
+ user_id,
|
|
|
+ season_id,
|
|
|
+ bonus,
|
|
|
+ @curRank :=
|
|
|
+ IF (
|
|
|
+ @prevRank = bonus,
|
|
|
+ @curRank,
|
|
|
+ @incRank
|
|
|
+ ) AS rank,
|
|
|
+ @incRank := @incRank + 1,
|
|
|
+ @prevRank := bonus
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ game_id,
|
|
|
+ user_id,
|
|
|
+ season_id,
|
|
|
+ SUM(IFNULL(bonus, 0)) AS bonus
|
|
|
+ FROM
|
|
|
+ player_info
|
|
|
+ <where>
|
|
|
+ and del_flag = 'N'
|
|
|
+ <if test="record.idStr != null and !"".equals(record.idStr)">
|
|
|
+ and id in (${record.idStr})
|
|
|
+ </if>
|
|
|
+ <if test="record.id != null and !"".equals(record.id)">
|
|
|
+ and id = #{record.id}
|
|
|
+ </if>
|
|
|
+ <if test="record.delFlag != null and !"".equals(record.delFlag)">
|
|
|
+ and del_flag = #{record.delFlag}
|
|
|
+ </if>
|
|
|
+ <if test="record.updateTime != null and !"".equals(record.updateTime)">
|
|
|
+ and update_time = #{record.updateTime}
|
|
|
+ </if>
|
|
|
+ <if test="record.updateUser != null and !"".equals(record.updateUser)">
|
|
|
+ and update_user = #{record.updateUser}
|
|
|
+ </if>
|
|
|
+ <if test="record.createTime != null and !"".equals(record.createTime)">
|
|
|
+ and create_time = #{record.createTime}
|
|
|
+ </if>
|
|
|
+ <if test="record.createUser != null and !"".equals(record.createUser)">
|
|
|
+ and create_user = #{record.createUser}
|
|
|
+ </if>
|
|
|
+ <if test="record.gameId != null and !"".equals(record.gameId)">
|
|
|
+ and game_id = #{record.gameId}
|
|
|
+ </if>
|
|
|
+ <if test="record.houseId != null and !"".equals(record.houseId)">
|
|
|
+ and house_id = #{record.houseId}
|
|
|
+ </if>
|
|
|
+ <if test="record.joinTime != null and !"".equals(record.joinTime)">
|
|
|
+ and join_time = #{record.joinTime}
|
|
|
+ </if>
|
|
|
+ <if test="record.principal != null and !"".equals(record.principal)">
|
|
|
+ and principal = #{record.principal}
|
|
|
+ </if>
|
|
|
+ <if test="record.bonus != null and !"".equals(record.bonus)">
|
|
|
+ and bonus = #{record.bonus}
|
|
|
+ </if>
|
|
|
+ <if test="record.userId != null and !"".equals(record.userId)">
|
|
|
+ and user_id = #{record.userId}
|
|
|
+ </if>
|
|
|
+ <if test="record.remark != null and !"".equals(record.remark)">
|
|
|
+ and remark = #{record.remark}
|
|
|
+ </if>
|
|
|
+ <if test="record.image != null and !"".equals(record.image)">
|
|
|
+ and image = #{record.image}
|
|
|
+ </if>
|
|
|
+ <if test="record.killNumber != null and !"".equals(record.killNumber)">
|
|
|
+ and kill_number = #{record.killNumber}
|
|
|
+ </if>
|
|
|
+ <if test="record.ranking != null and !"".equals(record.ranking)">
|
|
|
+ and ranking = #{record.ranking}
|
|
|
+ </if>
|
|
|
+ <if test="record.beginTime != null and !"".equals(record.beginTime)">
|
|
|
+ and begin_time = #{record.beginTime}
|
|
|
+ </if>
|
|
|
+ <if test="record.endTime != null and !"".equals(record.endTime)">
|
|
|
+ and end_time = #{record.endTime}
|
|
|
+ </if>
|
|
|
+ <if test="record.statusFlag != null and !"".equals(record.statusFlag)">
|
|
|
+ and status_flag = #{record.statusFlag}
|
|
|
+ </if>
|
|
|
+ <if test="record.examineUser != null and !"".equals(record.examineUser)">
|
|
|
+ and examine_user = #{record.examineUser}
|
|
|
+ </if>
|
|
|
+ <if test="record.examineTime != null and !"".equals(record.examineTime)">
|
|
|
+ and examine_time = #{record.examineTime}
|
|
|
+ </if>
|
|
|
+ <if test="record.examineType != null and !"".equals(record.examineType)">
|
|
|
+ and examine_type = #{record.examineType}
|
|
|
+ </if>
|
|
|
+ <if test="record.video != null and !"".equals(record.video)">
|
|
|
+ and video = #{record.video}
|
|
|
+ </if>
|
|
|
+ <if test="record.liveTime != null and !"".equals(record.liveTime)">
|
|
|
+ and live_time = #{record.liveTime}
|
|
|
+ </if>
|
|
|
+ <if test="record.gameType != null and !"".equals(record.gameType)">
|
|
|
+ and game_type = #{record.gameType}
|
|
|
+ </if>
|
|
|
+ <if test="record.seasonId != null and !"".equals(record.seasonId)">
|
|
|
+ and season_id = #{record.seasonId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </where>
|
|
|
+ GROUP BY
|
|
|
+ game_id,
|
|
|
+ user_id,
|
|
|
+ season_id
|
|
|
+ ) AS p,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ @curRank := 0,
|
|
|
+ @prevRank := NULL,
|
|
|
+ @incRank := 1
|
|
|
+ ) r
|
|
|
+ ORDER BY
|
|
|
+ bonus DESC
|
|
|
+
|
|
|
+ </select>
|
|
|
+ <select id="seasonUserRank" parameterType="java.util.Map"
|
|
|
+ resultMap="PagePlayerInfoResult">
|
|
|
+
|
|
|
+ select * from (
|
|
|
+ SELECT
|
|
|
+ game_id,
|
|
|
+ user_id,
|
|
|
+ season_id,
|
|
|
+ bonus,
|
|
|
+ @curRank :=
|
|
|
+ IF (
|
|
|
+ @prevRank = bonus,
|
|
|
+ @curRank,
|
|
|
+ @incRank
|
|
|
+ ) AS rank,
|
|
|
+ @incRank := @incRank + 1,
|
|
|
+ @prevRank := bonus
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ game_id,
|
|
|
+ user_id,
|
|
|
+ season_id,
|
|
|
+ SUM(IFNULL(bonus, 0)) AS bonus
|
|
|
+ FROM
|
|
|
+ player_info
|
|
|
+ <where>
|
|
|
+ and del_flag = 'N'
|
|
|
+ <if test="gameId != null and !"".equals(gameId)">
|
|
|
+ and game_id = #{gameId}
|
|
|
+ </if>
|
|
|
+ <if test="seasonId != null and !"".equals(seasonId)">
|
|
|
+ and season_id = #{seasonId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </where>
|
|
|
+ GROUP BY
|
|
|
+ game_id,
|
|
|
+ user_id,
|
|
|
+ season_id
|
|
|
+ ) AS p,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ @curRank := 0,
|
|
|
+ @prevRank := NULL,
|
|
|
+ @incRank := 1
|
|
|
+ ) r
|
|
|
+ ORDER BY
|
|
|
+ bonus DESC
|
|
|
+ ) u
|
|
|
+
|
|
|
+ where
|
|
|
+ <if test="userId != null and !"".equals(userId)">
|
|
|
+ u.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ LIMIT 1
|
|
|
+ </select>
|
|
|
<select id="queryAllPlayerInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.PlayerInfo">
|
|
|
select
|
|
|
<include refid="Base_Column_List"/>
|