Skip to content

Commit

Permalink
fix: JPQL 메서드 baseUser.id -> baseUser.phoneNumber 로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
wjddn2165 committed Aug 22, 2024
1 parent c1d2eda commit 932f5bf
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 932f5bf

Please sign in to comment.