diff --git a/src/main/java/server/inuappcenter/kr/data/repository/GroupRepository.java b/src/main/java/server/inuappcenter/kr/data/repository/GroupRepository.java index 58bcf93..9e87655 100644 --- a/src/main/java/server/inuappcenter/kr/data/repository/GroupRepository.java +++ b/src/main/java/server/inuappcenter/kr/data/repository/GroupRepository.java @@ -23,9 +23,10 @@ public interface GroupRepository extends JpaRepository { @Query("SELECT e FROM Group e WHERE e.year = :year AND e.part = :part ORDER BY CASE WHEN e.role.roleName = '파트장' THEN 0 ELSE 1 END, e.member.name") List findAllByYearAndPartOrderByYear(Double year, String part); - @Query("SELECT e FROM Group e WHERE e.year = :year ORDER BY CASE WHEN e.role.roleName = '파트장'THEN 0 ELSE 1 END, e.part") + @Query("SELECT e FROM Group e WHERE e.year = :year ORDER BY CASE WHEN e.role.roleName = '파트장' THEN 0 ELSE 1 END, e.part") List findAllByYearOrderByPart(Double year); + @Query("SELECT e FROM Group e WHERE e.part = :part ORDER BY CASE WHEN e.role.roleName = '파트장' THEN 0 ELSE 1 END, e.year DESC") List findAllByPartOrderByYearDesc(String part); @Query("SELECT DISTINCT e.part FROM Group e")