You've already forked mine_clearance
20 lines
759 B
XML
20 lines
759 B
XML
<?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.lightyears.basics.mapper.ClearanceLogMapper">
|
|
<select id="getPlayerClearanceLogs" resultType="com.lightyears.common.domain.dto.ClearanceRankDto">
|
|
SELECT
|
|
p.user_id as playerId,
|
|
ifnull( max( l.layers_num ), 0 ) AS layersNum
|
|
FROM
|
|
sl_player p
|
|
left join sl_clearance_log l on l.player_id = p.user_id
|
|
<where>
|
|
<if test="userId != null and userId > 0">
|
|
and p.user_id = ${userId}
|
|
</if>
|
|
</where>
|
|
group by p.user_id
|
|
ORDER BY layersNum desc
|
|
</select>
|
|
</mapper>
|