HandHistoryMapper.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="org.dromara.business.mapper.HandHistoryMapper">
  6. <select id="selectAllHandHistory" resultType="org.dromara.business.domain.vo.HandHistoryVo">
  7. SELECT
  8. id,
  9. hand_id,
  10. tournament_id,
  11. involved_players,
  12. hand_number,
  13. board_cards,
  14. total_pot,
  15. hand_start_time,
  16. hand_end_time,
  17. hand_details,
  18. created_at,
  19. blind_level,
  20. table_id,
  21. blind_structure_id
  22. FROM hand_history
  23. WHERE 1=1
  24. <if test="tournamentId != null and tournamentId != ''">
  25. AND tournament_id = #{tournamentId}
  26. </if>
  27. <if test="historyId != null and historyId != ''">
  28. AND id = #{historyId}
  29. </if>
  30. <if test="handId != null and handId != ''">
  31. AND hand_id = #{handId}
  32. </if>
  33. <if test="blindStructureId != null and blindStructureId != ''">
  34. AND blind_structure_id = #{blindStructureId}
  35. </if>
  36. <!-- 可选:如果只想查某个等级以上或以下 -->
  37. <if test="startLateRegistrationLevel != null">
  38. AND blind_level &gt;= #{startLateRegistrationLevel}
  39. </if>
  40. <if test="endLateRegistrationLevel != null">
  41. AND blind_level &lt;= #{endLateRegistrationLevel}
  42. </if>
  43. </select>
  44. <select id="selectAllHandZhuoCi" resultType="org.dromara.business.domain.vo.HandHistoryVo">
  45. SELECT hh.table_id
  46. FROM hand_history hh
  47. INNER JOIN player_hand_history phh ON hh.id = phh.hand_history_id
  48. WHERE 1=1
  49. <if test="playerId != null and playerId != ''">
  50. AND phh.player_id =#{playerId}
  51. </if>
  52. AND hh.tournament_id = #{tournamentId} AND hh.table_id!=0
  53. GROUP BY hh.table_id
  54. ORDER BY hh.table_id ASC
  55. </select>
  56. <select id="selectAllHandNumber" resultType="org.dromara.business.domain.vo.HandHistoryVo">
  57. SELECT
  58. hh.*
  59. FROM
  60. hand_history hh
  61. INNER JOIN player_hand_history phh ON hh.id = phh.hand_history_id
  62. WHERE 1=1
  63. <if test="playerId != null and playerId != ''">
  64. AND phh.player_id =#{playerId}
  65. </if>
  66. AND hh.tournament_id = #{tournamentId}
  67. AND hh.table_id != 0
  68. AND hh.table_id = #{tableId}
  69. ORDER BY
  70. hh.hand_number ASC
  71. </select>
  72. <select id="selectAllHandPublicNumber" resultType="org.dromara.business.domain.vo.HandHistoryVo">
  73. SELECT
  74. DISTINCT hh.hand_number
  75. FROM
  76. hand_history hh
  77. INNER JOIN player_hand_history phh ON hh.id = phh.hand_history_id
  78. WHERE 1=1
  79. AND hh.tournament_id = #{tournamentId}
  80. AND hh.table_id != 0
  81. AND hh.table_id = #{tableId}
  82. ORDER BY
  83. hh.hand_number ASC
  84. </select>
  85. </mapper>