Commit f6370295 authored by 技术部-任文超's avatar 技术部-任文超

jpa语法更正

parent d9fdf789
......@@ -60,9 +60,9 @@ public interface IUserDetailRepository extends JpaRepository<UserDetail, Long>,
@Query(value = "select * from user_detail where phone_no like ?1 and id_no like ?2", nativeQuery = true)
List<UserDetail> fuzzyQueryByPhoneNoAndIdNo(String phoneNo, String idNo);
List<UserDetail> findByIdNoStartingWithLimit20(String idNo);
List<UserDetail> findTop20ByIdNoStartingWith(String idNo);
List<UserDetail> findByPhoneNoStartingWithLimit20(String phoneNo);
List<UserDetail> findTop20ByPhoneNoStartingWith(String phoneNo);
List<UserDetail> findByIdBetween(Long id, Long endId);
......
......@@ -122,12 +122,12 @@ public class UserDetailServiceImpl implements IUserDetailService {
@Override
public List<UserDetail> findByIdNoStartingWith(String idNo) {
return userDetailRepository.findByIdNoStartingWithLimit20(idNo);
return userDetailRepository.findTop20ByIdNoStartingWith(idNo);
}
@Override
public List<UserDetail> findByPhoneNoStartingWith(String phoneNo) {
return userDetailRepository.findByPhoneNoStartingWithLimit20(phoneNo);
return userDetailRepository.findTop20ByPhoneNoStartingWith(phoneNo);
}
private Specification<UserDetail> getSpecification(String name, String phoneNo, String idNo) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment