Skip to content

Commit 7d3ce17

Browse files
committed
feat : 이름순 정렬 쿼리 추가
1 parent e2f6e05 commit 7d3ce17

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

adapters/out-persistence/src/main/kotlin/com/pokit/out/persistence/category/persist/CategoryRepository.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,20 @@ interface CategoryRepository : JpaRepository<CategoryEntity, Long> {
2424
order by coalesce(max(co.createdAt), ca.createdAt) desc
2525
"""
2626
)
27-
fun findAllByIdInAndDeleted(
27+
fun findAllByIdInAndCreatedAtSort(
28+
@Param("categoryIds") categoryIds: List<Long>,
29+
pageable: Pageable,
30+
@Param("isDeleted") isDeleted: Boolean
31+
): Slice<CategoryEntity>
32+
33+
@Query(
34+
"""
35+
select ca from CategoryEntity ca
36+
where ca.id in :categoryIds and ca.deleted = :isDeleted
37+
order by ca.name asc
38+
"""
39+
)
40+
fun findAllByIdInAndNameSort(
2841
@Param("categoryIds") categoryIds: List<Long>,
2942
pageable: Pageable,
3043
@Param("isDeleted") isDeleted: Boolean

0 commit comments

Comments
 (0)