Skip to content

Commit

Permalink
feat: 전화번호 검색 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
k000927 committed Aug 15, 2024
1 parent d22b924 commit d73da6a
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 @@ -15,10 +15,10 @@
public interface LotteryParticipantsRepository extends JpaRepository<LotteryParticipants, Long> {
Optional<LotteryParticipants> findByBaseUser(BaseUser baseUser);

@Query("SELECT p FROM LotteryParticipants p WHERE p.baseUser.id LIKE %:id%")
@Query("SELECT p FROM LotteryParticipants p WHERE p.baseUser.id LIKE :id%")
Page<LotteryParticipants> findByBaseUser_Id(@Param("id") String id, Pageable pageable);

@Query("SELECT COUNT(p) FROM LotteryParticipants p WHERE p.baseUser.id LIKE %:id%")
@Query("SELECT COUNT(p) FROM LotteryParticipants p WHERE p.baseUser.id LIKE :id%")
long countByBaseUser_Id(@Param("id") String id);
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

@Repository
public interface LotteryWinnerRepository extends JpaRepository<LotteryWinners, Long> {
@Query("SELECT w FROM LotteryWinners w WHERE w.phoneNumber LIKE %:phoneNumber%")
@Query("SELECT w FROM LotteryWinners w WHERE w.phoneNumber LIKE :phoneNumber%")
Page<LotteryWinners> findByPhoneNumber(@Param("phoneNumber") String phoneNumber, Pageable pageable);

@Query("SELECT COUNT(w) FROM LotteryWinners w WHERE w.phoneNumber LIKE %:phoneNumber%")
@Query("SELECT COUNT(w) FROM LotteryWinners w WHERE w.phoneNumber LIKE :phoneNumber%")
long countByPhoneNumber(@Param("phoneNumber") String phoneNumber);}

0 comments on commit d73da6a

Please sign in to comment.