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