| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?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="org.dromara.business.mapper.HandHistoryMapper">
- <select id="selectAllHandHistory" resultType="org.dromara.business.domain.vo.HandHistoryVo">
- SELECT
- id,
- hand_id,
- tournament_id,
- involved_players,
- hand_number,
- board_cards,
- total_pot,
- hand_start_time,
- hand_end_time,
- hand_details,
- created_at,
- blind_level,
- table_id,
- blind_structure_id
- FROM hand_history
- WHERE 1=1
- <if test="tournamentId != null and tournamentId != ''">
- AND tournament_id = #{tournamentId}
- </if>
- <if test="historyId != null and historyId != ''">
- AND id = #{historyId}
- </if>
- <if test="handId != null and handId != ''">
- AND hand_id = #{handId}
- </if>
- <if test="blindStructureId != null and blindStructureId != ''">
- AND blind_structure_id = #{blindStructureId}
- </if>
- <!-- 可选:如果只想查某个等级以上或以下 -->
- <if test="startLateRegistrationLevel != null">
- AND blind_level >= #{startLateRegistrationLevel}
- </if>
- <if test="endLateRegistrationLevel != null">
- AND blind_level <= #{endLateRegistrationLevel}
- </if>
- </select>
- <select id="selectAllHandZhuoCi" resultType="org.dromara.business.domain.vo.HandHistoryVo">
- SELECT hh.table_id
- FROM hand_history hh
- INNER JOIN player_hand_history phh ON hh.id = phh.hand_history_id
- WHERE 1=1
- <if test="playerId != null and playerId != ''">
- AND phh.player_id =#{playerId}
- </if>
- AND hh.tournament_id = #{tournamentId} AND hh.table_id!=0
- GROUP BY hh.table_id
- ORDER BY hh.table_id ASC
- </select>
- <select id="selectAllHandNumber" resultType="org.dromara.business.domain.vo.HandHistoryVo">
- SELECT
- hh.*
- FROM
- hand_history hh
- INNER JOIN player_hand_history phh ON hh.id = phh.hand_history_id
- WHERE 1=1
- <if test="playerId != null and playerId != ''">
- AND phh.player_id =#{playerId}
- </if>
- AND hh.tournament_id = #{tournamentId}
- AND hh.table_id != 0
- AND hh.table_id = #{tableId}
- ORDER BY
- hh.hand_number ASC
- </select>
- <select id="selectAllHandPublicNumber" resultType="org.dromara.business.domain.vo.HandHistoryVo">
- SELECT
- DISTINCT hh.hand_number
- FROM
- hand_history hh
- INNER JOIN player_hand_history phh ON hh.id = phh.hand_history_id
- WHERE 1=1
- AND hh.tournament_id = #{tournamentId}
- AND hh.table_id != 0
- AND hh.table_id = #{tableId}
- ORDER BY
- hh.hand_number ASC
- </select>
- </mapper>
|