Skip to content

Commit

Permalink
refactor: query 조회문 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiwon-cho committed Mar 1, 2024
1 parent f2ea2b8 commit bbed8ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/mara/server/domain/share/ShareRepository.kt
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ class CustomShareRepositoryImpl(
.fetch()

val query = queryFactory.selectFrom(share)
.where(share.id.`in`(appliedShareIdList).and(share.user.eq(user).and(share.status.eq(status))))
.where((share.id.`in`(appliedShareIdList).or(share.user.eq(user)).and(share.status.eq(status))))
.offset(pageable.offset)
.limit(pageable.pageSize.toLong())
.orderBy(share.createdAt.desc()).fetch()

val count = queryFactory.select(share.count()).from(share)
.where(share.id.`in`(appliedShareIdList).and(share.user.eq(user).and(share.status.eq(status)))).fetchOne()
.where((share.id.`in`(appliedShareIdList).or(share.user.eq(user)).and(share.status.eq(status)))).fetchOne()

return PageableExecutionUtils.getPage(query, pageable) { count!! }
}
Expand Down

0 comments on commit bbed8ad

Please sign in to comment.