1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| public Page<PopupQueryDto> findPopups(PageRequest pageRequest, PopupFindRequest request, String regionCd) {
...
List<PopupQueryDto> results = groupBy(popup.id).list( new QPopupQueryDto( popup.seqCd, popup.popupCd, popup.popupNm, popup.memberType, GroupBy.set(popupPackage), popup.startDt, popup.endDt, GroupBy.set(popupPoc), popup.insId, popup.insDt, popup.updId, popup.updDt, popup.isView )) .transform( this.queryFactory .from(popup) .leftJoin(popupPoc).on(popupPoc.popup.id.eq(popup.id)) .leftJoin(popupPackage).on(popupPackage.popup.id.eq(popup.id)) .where( popup.isDel.eq(false), eqRegionCd(regionCd), ...
results = filterPopupsWithPoc(request, results); long totalCount = results.size();
int start = (int) pageRequest.getOffset(); int end = (start + pageRequest.getPageSize()) > results.size() ? results.size() : (start + pageRequest.getPageSize());
return start < totalCount ? new PageImpl<>(results.subList(start, end), pageRequest, totalCount) : new PageImpl<>(List.of(), pageRequest, totalCount); }
|