Commit 5d17a296 authored by lee_mingzhu's avatar lee_mingzhu

revert

parent 2338a506
......@@ -49,20 +49,18 @@ public class UserDetailServiceImpl implements IUserDetailService {
Specification<UserDetail> specification = new Specification<UserDetail>() {
@Override
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");
criteriaQuery.where(criteriaBuilder.equal(namePath, name));
//}
//if (!StringUtils.isEmpty(phoneNo)) {
}
if (!StringUtils.isEmpty(phoneNo)) {
Path<String> phonePath = root.get("phoneNo");
criteriaQuery.where(criteriaBuilder.equal(phonePath, phoneNo));
//}
//if (!StringUtils.isEmpty(idNo)) {
}
if (!StringUtils.isEmpty(idNo)) {
Path<String> idNoPath = root.get("idNo");
criteriaQuery.where(criteriaBuilder.equal(idNoPath, idNo));
//}
}
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