Skip to content

Commit

Permalink
[Feat] Group findAllByPartOrderByYearDesc 정렬 조건 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
NARUBROWN committed Feb 15, 2024
1 parent ee1d49d commit 96ccef3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ public interface GroupRepository extends JpaRepository<Group, Long> {
@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);

@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<Group> 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<Group> findAllByPartOrderByYearDesc(String part);

@Query("SELECT DISTINCT e.part FROM Group e")
Expand Down

0 comments on commit 96ccef3

Please sign in to comment.