Skip to content

Commit

Permalink
[Feat] Group findAllYearsDesc 정렬 조건 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
NARUBROWN committed Feb 26, 2024
1 parent 96ccef3 commit bfeef41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public interface GroupRepository extends JpaRepository<Group, Long> {

List<Group> findAllByMember_Name(String name);

@Query("SELECT DISTINCT e.year FROM Group e ORDER BY e.year")
List<Double> findAllYears();
@Query("SELECT DISTINCT e.year FROM Group e ORDER BY e.year DESC")
List<Double> 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<Group> findAllByYearAndPartOrderByYear(Double year, String part);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public List<GroupResponseDto> searchByMemberName(String name) {

@Transactional(readOnly = true)
public GroupYearListResponseDto findAllYears() {
List<Double> foundYears = groupRepository.findAllYears();
List<Double> foundYears = groupRepository.findAllYearsDesc();
return new GroupYearListResponseDto(foundYears);
}

Expand Down

0 comments on commit bfeef41

Please sign in to comment.