From 0c2c17966effa933c8b1126370ab8122fcd5e129 Mon Sep 17 00:00:00 2001 From: mmihye Date: Tue, 10 Sep 2024 22:22:09 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20review=20query=EB=AC=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/place/repository/PlaceReviewRepository.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/Journey/Together/domain/place/repository/PlaceReviewRepository.java b/src/main/java/Journey/Together/domain/place/repository/PlaceReviewRepository.java index e12d84d..3cfb623 100644 --- a/src/main/java/Journey/Together/domain/place/repository/PlaceReviewRepository.java +++ b/src/main/java/Journey/Together/domain/place/repository/PlaceReviewRepository.java @@ -22,7 +22,10 @@ public interface PlaceReviewRepository extends JpaRepository { @Query("SELECT COUNT(pr) FROM PlaceReview pr WHERE pr.member = :member") Long countPlaceReviewByMember(@Param("member") Member member); - Long countPlaceReviewByPlaceAndReportIsNullOrReportFalseOrderByCreatedAtDesc(Place place); + @Query("SELECT COUNT(pr) FROM PlaceReview pr WHERE pr.place = :place AND (pr.report IS NULL OR pr.report = false) ORDER BY pr.createdAt DESC") + Long countPlaceReviewByPlaceAndReportIsNullOrReportFalseOrderByCreatedAtDesc(@Param("place") Place place); + + @Query("SELECT pr FROM PlaceReview pr WHERE pr.place = :place AND (pr.report IS NULL OR pr.report = false) ORDER BY pr.createdAt DESC") Page findAllByPlaceAndReportIsNullOrReportFalseOrderByCreatedAtDesc(Place place, Pageable pageable); Page findAllByMemberOrderByCreatedAtDesc(Member member, Pageable pageable);