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 9e87655..6979555 100644 --- a/src/main/java/server/inuappcenter/kr/data/repository/GroupRepository.java +++ b/src/main/java/server/inuappcenter/kr/data/repository/GroupRepository.java @@ -17,8 +17,8 @@ public interface GroupRepository extends JpaRepository { List findAllByMember_Name(String name); - @Query("SELECT DISTINCT e.year FROM Group e ORDER BY e.year") - List findAllYears(); + @Query("SELECT DISTINCT e.year FROM Group e ORDER BY e.year DESC") + List findAllYearsDesc(); @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); diff --git a/src/main/java/server/inuappcenter/kr/service/GroupService.java b/src/main/java/server/inuappcenter/kr/service/GroupService.java index fd3436d..6462db0 100644 --- a/src/main/java/server/inuappcenter/kr/service/GroupService.java +++ b/src/main/java/server/inuappcenter/kr/service/GroupService.java @@ -102,7 +102,7 @@ public List searchByMemberName(String name) { @Transactional(readOnly = true) public GroupYearListResponseDto findAllYears() { - List foundYears = groupRepository.findAllYears(); + List foundYears = groupRepository.findAllYearsDesc(); return new GroupYearListResponseDto(foundYears); }