fix(athlete): filter out team records from athlete list

- Exclude records where idCard is empty AND playerName equals teamName
- These are team project registration records, not actual athletes
- Fixes issue where team names appear in common-info athlete list

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
2026-01-23 14:35:38 +08:00
co-authored by factory-droid[bot]
parent c9e1f069a7
commit 1c31ea5bd0
@@ -12,6 +12,13 @@
LEFT JOIN martial_competition c ON a.competition_id = c.id AND c.is_deleted = 0 LEFT JOIN martial_competition c ON a.competition_id = c.id AND c.is_deleted = 0
LEFT JOIN martial_project p ON a.project_id = p.id AND p.is_deleted = 0 LEFT JOIN martial_project p ON a.project_id = p.id AND p.is_deleted = 0
WHERE a.is_deleted = 0 WHERE a.is_deleted = 0
<!-- 过滤集体项目记录:排除 idCard 为空且 playerName 等于 teamName 的记录 -->
AND NOT (
(a.id_card IS NULL OR a.id_card = '')
AND a.player_name = a.team_name
AND a.team_name IS NOT NULL
AND a.team_name != ''
)
<if test="athlete.competitionId != null"> <if test="athlete.competitionId != null">
AND a.competition_id = #{athlete.competitionId} AND a.competition_id = #{athlete.competitionId}
</if> </if>