|
|
@@ -22,8 +22,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
END) as totalParticipants,
|
|
|
(SELECT COUNT(DISTINCT (CASE WHEN p.classification = '0' THEN s.athlete_id ELSE s.team_id END))
|
|
|
FROM game_score s
|
|
|
- WHERE s.event_id = #{eventId} AND s.project_id = p.project_id AND s.del_flag = '0'
|
|
|
+ INNER JOIN game_athlete a ON (s.athlete_id = a.athlete_id OR s.team_id = a.team_id)
|
|
|
+ WHERE s.event_id = #{eventId} AND s.project_id = p.project_id AND s.del_flag = '0' AND a.del_flag = '0'
|
|
|
AND ((s.individual_performance > 0) OR (s.team_performance > 0))
|
|
|
+ AND (
|
|
|
+ (p.classification = '0' AND s.athlete_id = a.athlete_id)
|
|
|
+ OR (p.classification = '1' AND s.team_id = a.team_id)
|
|
|
+ )
|
|
|
) as completedParticipants
|
|
|
FROM game_event_project p
|
|
|
WHERE p.event_id = #{eventId} and p.del_flag = '0'
|