Skip to content

Commit

Permalink
Merge pull request #101 from Central-MakeUs/21-마이페이지-기능을-추가한다
Browse files Browse the repository at this point in the history
Fix(#21): 내찜목록 조회 쿼리 수정
  • Loading branch information
tmddus2 committed Aug 27, 2024
2 parents ff38ddb + f957408 commit 858434e
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

@Repository
public interface FilterRepository extends JpaRepository<Filter, Long>, CustomFilterRepository {
@Query("SELECT f.id AS filterId, f.name AS filterName, f.membership AS membership, f.photographer.username AS photographer, f.thumbnail AS thumbnail, COUNT(fl.id) AS count, f.os AS os "
+ "FROM FilterLike fl "
+ "LEFT JOIN Filter f ON fl.filter.id=f.id "
+ "WHERE fl.user.id=:userId "
+ "GROUP BY fl.filter.id")
@Query("SELECT f.id AS filterId, f.name AS filterName, f.membership AS membership, f.photographer.username AS photographer, f.thumbnail AS thumbnail, COUNT(fl.filter.id) AS count, f.os AS os "+
"FROM FilterLike fl " +
"LEFT JOIN fl.filter f ON fl.filter.id=f.id " +
"WHERE f.id IN (SELECT fl.filter.id FROM FilterLike fl WHERE fl.user.id = :userId) " +
"GROUP BY fl.filter.id")
List<FilterLikeProjection> getLikedFilter(Long userId);
}

0 comments on commit 858434e

Please sign in to comment.