Commit 5d17a296 authored by lee_mingzhu's avatar lee_mingzhu

revert

parent 2338a506
...@@ -49,20 +49,18 @@ public class UserDetailServiceImpl implements IUserDetailService { ...@@ -49,20 +49,18 @@ public class UserDetailServiceImpl implements IUserDetailService {
Specification<UserDetail> specification = new Specification<UserDetail>() { Specification<UserDetail> specification = new Specification<UserDetail>() {
@Override @Override
public Predicate toPredicate(Root<UserDetail> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder criteriaBuilder) { public Predicate toPredicate(Root<UserDetail> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder criteriaBuilder) {
//以下条件不做非空判断,如果判断非空当不填任何条件查询时,会将user_detail表的所有数据都查询出来 if (!StringUtils.isEmpty(name)) {
//不做非空判断,当不填任何条件查询时将返回空列表[]
//if (!StringUtils.isEmpty(name)) {
Path<String> namePath = root.get("name"); Path<String> namePath = root.get("name");
criteriaQuery.where(criteriaBuilder.equal(namePath, name)); criteriaQuery.where(criteriaBuilder.equal(namePath, name));
//} }
//if (!StringUtils.isEmpty(phoneNo)) { if (!StringUtils.isEmpty(phoneNo)) {
Path<String> phonePath = root.get("phoneNo"); Path<String> phonePath = root.get("phoneNo");
criteriaQuery.where(criteriaBuilder.equal(phonePath, phoneNo)); criteriaQuery.where(criteriaBuilder.equal(phonePath, phoneNo));
//} }
//if (!StringUtils.isEmpty(idNo)) { if (!StringUtils.isEmpty(idNo)) {
Path<String> idNoPath = root.get("idNo"); Path<String> idNoPath = root.get("idNo");
criteriaQuery.where(criteriaBuilder.equal(idNoPath, idNo)); criteriaQuery.where(criteriaBuilder.equal(idNoPath, idNo));
//} }
return null; return null;
} }
}; };
......
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