优化
This commit is contained in:
parent
d1c4101aaa
commit
722300950d
@ -141,7 +141,10 @@ public class FirePointQueryManager {
|
||||
Specification<FirePointOrdinaryEntity> specificationOrdinary = (root, criteriaQuery, criteriaBuilder) -> {
|
||||
List<Predicate> predicateList = new ArrayList<>();
|
||||
//添加区划编码的过滤
|
||||
if (!TextUtils.isEmpty(noRedundantUserCode)) {
|
||||
predicateList.add(criteriaBuilder.like(root.get("townCode").as(String.class), noRedundantUserCode + "%"));
|
||||
}
|
||||
//添加子区域区划编码的过滤(比如查询火点的系统用户所属的区划是山东省,但是该用户目前只想查询青岛市的火点,那么noRedundantUserCode=山东省区划,userSubAreaCutCountyCode=青岛市区划)
|
||||
if (!TextUtils.isEmpty(userSubAreaCutCountyCode)) {
|
||||
predicateList.add(criteriaBuilder.like(root.get("townCode").as(String.class), userSubAreaCutCountyCode + "%"));
|
||||
}
|
||||
@ -186,7 +189,13 @@ public class FirePointQueryManager {
|
||||
Specification<FirePointPreciseEntity> specificationPrecise = (root, criteriaQuery, criteriaBuilder) -> {
|
||||
List<Predicate> predicateList = new ArrayList<>();
|
||||
//添加区划编码的过滤
|
||||
if (!TextUtils.isEmpty(noRedundantUserCode)) {
|
||||
predicateList.add(criteriaBuilder.like(root.get("townCode").as(String.class), noRedundantUserCode + "%"));
|
||||
}
|
||||
//添加子区域区划编码的过滤(比如查询火点的系统用户所属的区划是山东省,但是该用户目前只想查询青岛市的火点,那么noRedundantUserCode=山东省区划,userSubAreaCutCountyCode=青岛市区划)
|
||||
if (!TextUtils.isEmpty(userSubAreaCutCountyCode)) {
|
||||
predicateList.add(criteriaBuilder.like(root.get("townCode").as(String.class), userSubAreaCutCountyCode + "%"));
|
||||
}
|
||||
//开始时间查询条件
|
||||
if (!TextUtils.isEmpty(startTime)) {
|
||||
LocalDateTime startTime1 = DateTimeUtils.stringToLocalDateTime(startTime);
|
||||
|
Loading…
Reference in New Issue
Block a user