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);