Skip to content

Commit

Permalink
Merge pull request #219 from softeerbootcamp4th/feature/#203-rush-eve…
Browse files Browse the repository at this point in the history
…nt-apply-stress-test

fix: JPQL 메서드 baseUser.id -> baseUser.phoneNumber 로 변경
  • Loading branch information
wjddn2165 authored Aug 22, 2024
2 parents 883932a + 932f5bf commit 3fcb7ee
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface RushParticipantsRepository extends JpaRepository<RushParticipan
"AND rp.optionId = :optionId " +
"AND rp.id < (SELECT rp2.id FROM RushParticipants rp2 " +
"WHERE rp2.rushEvent.rushEventId = :eventId " +
"AND rp2.baseUser.id = :userId)")
"AND rp2.baseUser.phoneNumber = :userId)")
long findUserRankByEventIdAndUserIdAndOptionId(@Param("eventId") Long eventId,
@Param("userId") String userId,
@Param("optionId") int optionId);
Expand All @@ -30,13 +30,13 @@ long findUserRankByEventIdAndUserIdAndOptionId(@Param("eventId") Long eventId,
"WHERE rp.rushEvent.rushEventId = :eventId " +
"AND rp.id < (SELECT rp2.id FROM RushParticipants rp2 " +
"WHERE rp2.rushEvent.rushEventId = :eventId " +
"AND rp2.baseUser.id = :userId)")
"AND rp2.baseUser.phoneNumber = :userId)")
long findUserRankByEventIdAndUserId(@Param("eventId") Long eventId,
@Param("userId") String userId);

long countAllByOptionId(int optionId);

@Query("SELECT rp.optionId FROM RushParticipants rp WHERE rp.baseUser.id = :userId")
@Query("SELECT rp.optionId FROM RushParticipants rp WHERE rp.baseUser.phoneNumber = :userId")
Optional<Integer> getOptionIdByUserId(@Param("userId") String userId);

Page<RushParticipants> findByRushEvent_RushEventId(Long rushEventId, Pageable pageable);
Expand Down

0 comments on commit 3fcb7ee

Please sign in to comment.