|
|
@@ -78,18 +78,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectTournamentBlindStructuresList" resultType="org.dromara.business.domain.vo.TournamentBlindStructuresListVo">
|
|
|
SELECT
|
|
|
- a.id AS blindStructuresId,
|
|
|
- a.NAME AS blindStructuresName,
|
|
|
- a.description AS blindDescription,
|
|
|
- c.NAME AS tournamentsName,
|
|
|
- ( CASE b.tournament_id WHEN b.tournament_id IS NOT NULL THEN 1 ELSE 0 END ) AS allocationStatus
|
|
|
+ a.id AS blindStructuresId,
|
|
|
+ a.name AS blindStructuresName,
|
|
|
+ a.description AS blindDescription,
|
|
|
+ c.name AS tournamentsName,
|
|
|
+ CASE
|
|
|
+ WHEN b.tournament_id IS NOT NULL OR b.tournament_id > 0 THEN 1
|
|
|
+ ELSE 0
|
|
|
+ END AS allocationStatus
|
|
|
FROM
|
|
|
- blind_structures a
|
|
|
- LEFT JOIN tournament_blind_structures b ON a.id = b.blind_structure_id
|
|
|
- <if test="query.tournamentId != null and query.tournamentId != 0">
|
|
|
- AND b.tournament_id = #{query.tournamentId}
|
|
|
- </if>
|
|
|
- LEFT JOIN tournaments c ON b.tournament_id = c.id
|
|
|
+ blind_structures a
|
|
|
+ LEFT JOIN tournament_blind_structures b ON a.id = b.blind_structure_id
|
|
|
+ <if test="query.tournamentId != null and query.tournamentId != 0">
|
|
|
+ AND b.tournament_id = #{query.tournamentId}
|
|
|
+ </if>
|
|
|
+ LEFT JOIN tournaments c ON b.tournament_id = c.id
|
|
|
</select>
|
|
|
|
|
|
|