From 93eb6b470773bc49ea6e1a9d4cbd914eb95d525b Mon Sep 17 00:00:00 2001 From: lrj <owen.stl@gmail.com> Date: 星期二, 30 九月 2025 17:38:04 +0800 Subject: [PATCH] feat: 完善比赛晋级功能并清理测试文件 --- backend/src/main/java/com/rongyichuang/player/repository/ActivityPlayerRepository.java | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/backend/src/main/java/com/rongyichuang/player/repository/ActivityPlayerRepository.java b/backend/src/main/java/com/rongyichuang/player/repository/ActivityPlayerRepository.java index ed28626..cd84782 100644 --- a/backend/src/main/java/com/rongyichuang/player/repository/ActivityPlayerRepository.java +++ b/backend/src/main/java/com/rongyichuang/player/repository/ActivityPlayerRepository.java @@ -88,4 +88,28 @@ "WHERE ap.activityId = :activityId AND ap.state = 1 AND ap.rank IS NOT NULL " + "ORDER BY ap.rank ASC") List<ActivityPlayer> findTopRankedPlayers(@Param("activityId") Long activityId); + + /** + * 缁熻鎸囧畾鐘舵�佺殑鍙傝禌閫夋墜鏁伴噺 + */ + long countByState(Integer state); + + /** + * 鏍规嵁闃舵ID鍜岀姸鎬佺粺璁″弬璧涢�夋墜鏁伴噺 + */ + Long countByStageIdAndState(Long stageId, Integer state); + + /** + * 鏍规嵁闃舵ID鍜岀姸鎬佹煡鎵惧弬璧涢�夋墜锛堝寘鍚�夋墜淇℃伅锛� + */ + @Query("SELECT ap FROM ActivityPlayer ap " + + "LEFT JOIN FETCH ap.player p " + + "WHERE ap.stageId = :stageId AND ap.state = :state " + + "ORDER BY ap.createTime DESC") + List<ActivityPlayer> findByStageIdAndStateWithPlayerOrderByCreateTimeDesc(@Param("stageId") Long stageId, @Param("state") Integer state); + + /** + * 妫�鏌ラ�夋墜鏄惁宸插湪鎸囧畾闃舵鎶ュ悕 + */ + boolean existsByStageIdAndPlayerId(Long stageId, Long playerId); } \ No newline at end of file -- Gitblit v1.8.0