You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
<mapper namespace="com.ccsens.game.persist.dao.GameUserJoinDao">
|
|
|
|
|
<resultMap id="resultMap_memberInfo" type="com.ccsens.game.bean.vo.ClientVo$MemberInfo">
|
|
|
|
|
<id column="uId" property="id"/>
|
|
|
|
|
<result column="uHeadImgUrl" property="headImgUrl"/>
|
|
|
|
|
<result column="uNickname" property="nickname"/>
|
|
|
|
|
<result column="uTimes" property="times"/>
|
|
|
|
|
<result column="uScore" property="score"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<select id="selectByRecordId" parameterType="java.util.Map" resultMap="resultMap_memberInfo">
|
|
|
|
|
SELECT
|
|
|
|
|
id as uId,
|
|
|
|
|
avatar_url as uHeadImgUrl,
|
|
|
|
|
nickname as uNickname,
|
|
|
|
|
times as uTimes,
|
|
|
|
|
score as uScore
|
|
|
|
|
FROM
|
|
|
|
|
t_game_user_join
|
|
|
|
|
WHERE
|
|
|
|
|
record_id = #{recordId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getRanking" resultType="int">
|
|
|
|
|
SELECT rowNo FROM
|
|
|
|
|
(
|
|
|
|
|
SELECT user_id,(@rowNum:=@rowNum+1) AS rowNo
|
|
|
|
|
FROM
|
|
|
|
|
(select user_id,score from t_game_user_join where rec_status = 0 and record_id = #{recordId,jdbcType=BIGINT}) a,
|
|
|
|
|
(SELECT(@rowNum:=0)) b
|
|
|
|
|
ORDER BY a.score DESC
|
|
|
|
|
) c
|
|
|
|
|
WHERE c.user_id= #{userId,jdbcType=BIGINT} limit 1
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|