Skip to content

Commit

Permalink
feat : 특정 달에 따른 정책 리스트 조회 API Query 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
LHS-11 committed Jan 7, 2024
1 parent 6d632ee commit 5afda06
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ public interface PolicyRepository extends JpaRepository<Policy, Long> {
@Query("SELECT P FROM Policy P LEFT JOIN P.userPolicies UP " +
"WHERE UP.interestFlag = TRUE " +
"AND UP.user.userId = :userId " +
"AND (:searchSttDate BETWEEN P.applySttDate AND P.applyEndDate " +
"OR :searchEndDate BETWEEN P.applySttDate AND P.applyEndDate " +
"OR (:searchSttDate <= P.applySttDate AND :searchEndDate >= P.applyEndDate))")
"AND ((P.applySttDate BETWEEN (:searchSttDate) AND (:searchEndDate)) " +
"OR (P.applyEndDate BETWEEN (:searchSttDate) AND (:searchEndDate))) ")
List<Policy> findAllBySearchMonth(@Param("userId") Long userId, @Param("searchSttDate") LocalDate searchSttDate, @Param("searchEndDate") LocalDate searchEndDate);

@Query("SELECT P FROM Policy P LEFT JOIN P.userPolicies UP " +
Expand Down

0 comments on commit 5afda06

Please sign in to comment.