test #294

Merged
klaus merged 10 commits from test into main 2025-03-24 09:09:17 +00:00
1 changed files with 12 additions and 6 deletions
Showing only changes of commit 3595c02e74 - Show all commits

View File

@ -176,18 +176,24 @@ class LiveRoomQueryRepositoryImpl(
) )
} }
return queryFactory val orderBy = if (memberId != null) {
.selectFrom(liveRoom) listOf(
.innerJoin(liveRoom.member, member)
.limit(10)
.where(where)
.orderBy(
CaseBuilder() CaseBuilder()
.`when`(member.id.eq(memberId)).then(1) .`when`(member.id.eq(memberId)).then(1)
.otherwise(2) .otherwise(2)
.asc(), .asc(),
liveRoom.beginDateTime.asc() liveRoom.beginDateTime.asc()
) )
} else {
listOf(liveRoom.beginDateTime.asc())
}
return queryFactory
.selectFrom(liveRoom)
.innerJoin(liveRoom.member, member)
.limit(10)
.where(where)
.orderBy(*orderBy.toTypedArray())
.fetch() .fetch()
} }