Skip to content

Commit

Permalink
Merge pull request #357 from SWM-NM/feat/#356
Browse files Browse the repository at this point in the history
⚡ [IMPROVE] 레이팅, 잔디 SQL 쿼리 수정 #356
  • Loading branch information
miiiinju1 authored Sep 24, 2023
2 parents 8379a40 + 3c0b292 commit d4e6f37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public interface TestRepository extends JpaRepository<Tests, Long> {
//1년동안의 테스트 기록을 가져온다.
//이 때 테스트 날짜와 테스트 점수만 최근 날짜부터 가져온다.
@Query("SELECT t.testDate, t.testRating, t.testTypename " +
"FROM Tests t LEFT JOIN t.member m " +
"WHERE m.memberId = :memberId " +
"FROM Tests t " +
"WHERE t.member.memberId = :memberId " +
"AND (t.testDate BETWEEN :oneYearAgo AND CURRENT_TIMESTAMP )" +
"AND t.testStatus = 'COMPLETED' " +
"ORDER BY t.testDate DESC")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public interface AttemptProblemRepository extends JpaRepository<AttemptProblem,
"LEFT JOIN a.test t " +
"WHERE t.testId IN " +
"(SELECT DISTINCT t.testId " +
"FROM Tests t LEFT JOIN t.member m " +
"WHERE m.memberId = :memberId " +
"FROM Tests t " +
"WHERE t.member.memberId = :memberId " +
"AND (t.testDate BETWEEN :oneYearAgo AND CURRENT_TIMESTAMP) " +
"AND t.testStatus = 'COMPLETED') " +
"AND a.isSolved = true " +
Expand Down

0 comments on commit d4e6f37

Please sign in to comment.