This commit is contained in:
liuchengqian 2023-03-07 09:20:28 +08:00
parent d1c4101aaa
commit 722300950d

View File

@ -141,7 +141,10 @@ public class FirePointQueryManager {
Specification<FirePointOrdinaryEntity> specificationOrdinary = (root, criteriaQuery, criteriaBuilder) -> { Specification<FirePointOrdinaryEntity> specificationOrdinary = (root, criteriaQuery, criteriaBuilder) -> {
List<Predicate> predicateList = new ArrayList<>(); List<Predicate> predicateList = new ArrayList<>();
//添加区划编码的过滤 //添加区划编码的过滤
if (!TextUtils.isEmpty(noRedundantUserCode)) {
predicateList.add(criteriaBuilder.like(root.get("townCode").as(String.class), noRedundantUserCode + "%")); predicateList.add(criteriaBuilder.like(root.get("townCode").as(String.class), noRedundantUserCode + "%"));
}
//添加子区域区划编码的过滤比如查询火点的系统用户所属的区划是山东省但是该用户目前只想查询青岛市的火点那么noRedundantUserCode=山东省区划userSubAreaCutCountyCode=青岛市区划
if (!TextUtils.isEmpty(userSubAreaCutCountyCode)) { if (!TextUtils.isEmpty(userSubAreaCutCountyCode)) {
predicateList.add(criteriaBuilder.like(root.get("townCode").as(String.class), 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) -> { Specification<FirePointPreciseEntity> specificationPrecise = (root, criteriaQuery, criteriaBuilder) -> {
List<Predicate> predicateList = new ArrayList<>(); List<Predicate> predicateList = new ArrayList<>();
//添加区划编码的过滤 //添加区划编码的过滤
if (!TextUtils.isEmpty(noRedundantUserCode)) {
predicateList.add(criteriaBuilder.like(root.get("townCode").as(String.class), 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)) { if (!TextUtils.isEmpty(startTime)) {
LocalDateTime startTime1 = DateTimeUtils.stringToLocalDateTime(startTime); LocalDateTime startTime1 = DateTimeUtils.stringToLocalDateTime(startTime);