Skip to content

Commit

Permalink
feat #53: isCompleted 필드를 가져오도록 쿼리 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
GiHoo committed May 2, 2024
1 parent ff6aa1a commit eeaf4d7
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ public interface SolveHistoryRepository extends JpaRepository<SolveHistory, Long
@Query("SELECT sh FROM SolveHistory sh WHERE sh.member.id = :memberId")
List<SolveHistory> findByMemberId(Long memberId);

@Query("SELECT sh FROM SolveHistory sh WHERE sh.member.id = :memberId AND sh.isCompleted = true")
List<SolveHistory> findByMemberIdAndIsCompletedIsTrue(Long memberId);

@Query("SELECT sh FROM SolveHistory sh WHERE sh.member.id = :memberId AND sh.solveCount = :solveCount")
Optional<SolveHistory> findByMemberIdAndSolveHistoryId(Long memberId, Long solveCount);

@Query("SELECT sh FROM SolveHistory sh WHERE sh.member.id = :memberId AND sh.solveCount = :solveCount AND sh.isCompleted = true")
Optional<SolveHistory> findByMemberIdAndSolveHistoryIdAndIsCompletedIsTrue(Long memberId, Long solveCount);
}

0 comments on commit eeaf4d7

Please sign in to comment.