Skip to content

Commit

Permalink
fix : review query문 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
mmihye committed Sep 10, 2024
1 parent 3b406e9 commit 0c2c179
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ public interface PlaceReviewRepository extends JpaRepository<PlaceReview,Long> {
@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<PlaceReview> findAllByPlaceAndReportIsNullOrReportFalseOrderByCreatedAtDesc(Place place, Pageable pageable);

Page<PlaceReview> findAllByMemberOrderByCreatedAtDesc(Member member, Pageable pageable);
Expand Down

0 comments on commit 0c2c179

Please sign in to comment.