From bfeef411d9a3865e1cd593197d14ddb7cf61ae7d Mon Sep 17 00:00:00 2001 From: Wonjeong Kim Date: Mon, 26 Feb 2024 14:56:26 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]=20Group=20findAllYearsDesc=20=EC=A0=95?= =?UTF-8?q?=EB=A0=AC=20=EC=A1=B0=EA=B1=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inuappcenter/kr/data/repository/GroupRepository.java | 4 ++-- .../java/server/inuappcenter/kr/service/GroupService.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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); }