test #332
| @@ -387,6 +387,15 @@ class LiveRoomQueryRepositoryImpl( | ||||
|         val liveRoom = liveRoom | ||||
|         val subLiveRoom = QLiveRoom.liveRoom | ||||
|  | ||||
|         val subQuery = JPAExpressions | ||||
|             .select(subLiveRoom.member.id, subLiveRoom.updatedAt.max()) | ||||
|             .from(subLiveRoom) | ||||
|             .where( | ||||
|                 subLiveRoom.isActive.isFalse | ||||
|                     .and(subLiveRoom.channelName.isNotNull) | ||||
|             ) | ||||
|             .groupBy(subLiveRoom.member.id) | ||||
|  | ||||
|         return queryFactory | ||||
|             .select( | ||||
|                 QGetLatestFinishedLiveQueryResponse( | ||||
| @@ -400,16 +409,8 @@ class LiveRoomQueryRepositoryImpl( | ||||
|             .from(liveRoom) | ||||
|             .innerJoin(liveRoom.member, member) | ||||
|             .where( | ||||
|                 liveRoom.updatedAt | ||||
|                     .eq( | ||||
|                         JPAExpressions.select(subLiveRoom.updatedAt.max()) | ||||
|                             .from(subLiveRoom) | ||||
|                             .where( | ||||
|                                 subLiveRoom.member.eq(liveRoom.member) | ||||
|                                     .and(subLiveRoom.isActive.isFalse) | ||||
|                                     .and(subLiveRoom.channelName.isNotNull) | ||||
|                             ) | ||||
|                     ) | ||||
|                 Expressions.list(liveRoom.member.id, liveRoom.updatedAt) | ||||
|                     .`in`(subQuery) | ||||
|             ) | ||||
|             .orderBy(liveRoom.updatedAt.desc()) | ||||
|             .offset(offset) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user