Skip to content

Commit

Permalink
Merge pull request #32 from DDD-Community/feature/POLABO-108
Browse files Browse the repository at this point in the history
fix(POLABO-128): 내 보드 목록 조회 필터 조건 수정
  • Loading branch information
dldmsql authored Sep 2, 2024
2 parents 1456df1 + 5c96214 commit 4160a99
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ class BoardJooqRepositoryImpl(
): List<MyBoardDto.Companion.PageListRes> {
val jBoard = Board.BOARD
val jPolaroid = Polaroid.POLAROID
val boardSubQuery =
this.dslContext.select(jBoard.ID.`as`("id"))
.from(jBoard)
.where(jBoard.USER_ID.eq(userId).and(jPolaroid.YN.eq(1)).and(jPolaroid.ACTIVEYN.eq(1)))
.asTable()

val data = this.dslContext.select(
jBoard.ID,
jBoard.TITLE,
Expand All @@ -169,6 +175,10 @@ class BoardJooqRepositoryImpl(
jBoard.ID.eq(jPolaroid.BOARD_ID).and(jPolaroid.USER_ID.eq(userId))
.and(jPolaroid.YN.eq(1)).and(jPolaroid.ACTIVEYN.eq(1))
)
.where(jBoard.ID.notIn(
this.dslContext.select(boardSubQuery.field("id", ByteArray::class.java))
.from(boardSubQuery)
))

return data.map {
MyBoardDto.Companion.PageListRes(
Expand Down

0 comments on commit 4160a99

Please sign in to comment.