Skip to content

Commit 4160a99

Browse files
authored
Merge pull request #32 from DDD-Community/feature/POLABO-108
fix(POLABO-128): 내 보드 목록 조회 필터 조건 수정
2 parents 1456df1 + 5c96214 commit 4160a99

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/kotlin/com/ddd/sonnypolabobe/domain/board/repository/BoardJooqRepositoryImpl.kt

+10
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ class BoardJooqRepositoryImpl(
159159
): List<MyBoardDto.Companion.PageListRes> {
160160
val jBoard = Board.BOARD
161161
val jPolaroid = Polaroid.POLAROID
162+
val boardSubQuery =
163+
this.dslContext.select(jBoard.ID.`as`("id"))
164+
.from(jBoard)
165+
.where(jBoard.USER_ID.eq(userId).and(jPolaroid.YN.eq(1)).and(jPolaroid.ACTIVEYN.eq(1)))
166+
.asTable()
167+
162168
val data = this.dslContext.select(
163169
jBoard.ID,
164170
jBoard.TITLE,
@@ -169,6 +175,10 @@ class BoardJooqRepositoryImpl(
169175
jBoard.ID.eq(jPolaroid.BOARD_ID).and(jPolaroid.USER_ID.eq(userId))
170176
.and(jPolaroid.YN.eq(1)).and(jPolaroid.ACTIVEYN.eq(1))
171177
)
178+
.where(jBoard.ID.notIn(
179+
this.dslContext.select(boardSubQuery.field("id", ByteArray::class.java))
180+
.from(boardSubQuery)
181+
))
172182

173183
return data.map {
174184
MyBoardDto.Companion.PageListRes(

0 commit comments

Comments
 (0)