Skip to content

Commit 41300d2

Browse files
committed
fix: groupBy 적용
1 parent 5bfd186 commit 41300d2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/opendata/domain/tourspot/repository/custom/total/CustomTourSpotCombineRepositoryImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ public List<TourSpotMetaResponse> findMetaByRank() {
2828
.select(Projections.constructor(TourSpotMetaResponse.class,
2929
s.tourspotId,
3030
s.tourspotNm,
31-
img.tourspotImgUrl,
32-
cc.congestionLvl
31+
img.tourspotImgUrl.min(),
32+
cc.congestionLvl.max()
3333
))
3434
.from(s)
3535
.leftJoin(img).on(img.tourspot.eq(s))
3636
.leftJoin(cc).on(cc.tourspot.eq(s)
3737
.and(cc.fcstTime.eq(DateUtil.getCurrentRoundedFormattedDateTime())))
38+
.groupBy(s.tourspotId, s.tourspotNm, s.viewCount)
3839
.orderBy(s.viewCount.desc())
3940
.offset(0)
4041
.limit(10)

0 commit comments

Comments
 (0)