<?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.ssj.service.mapper.GameMapper">
    <select id="findPage" resultType="com.ssj.service.conch.game.dto.RanklistDto">
        select name, photo, sex, score
        from tb_game_ranklist
        where tb_game_ranklist.level > 0
          and #{maxCreateTime} >= tb_game_ranklist.create_time
        order by tb_game_ranklist.score desc
    </select>

    <select id="findHistory" resultType="com.ssj.service.conch.game.dto.HistoryDto">
        select id gameRecordId, score, create_time
        from tb_game_record
        where user_id = #{userId}
          and #{req.maxCreateTime} > create_time
        order by create_time desc
    </select>
</mapper>