重写用户获取火点数据的接口

This commit is contained in:
liuchengqian 2023-03-01 17:03:32 +08:00
parent 6abeff1494
commit 9849e22e8a

View File

@ -171,6 +171,28 @@ public class FirePointQueryManager {
List<Predicate> predicateList = new ArrayList<>();
//添加区划编码的过滤
predicateList.add(criteriaBuilder.like(root.get("townCode").as(String.class), finalMNoRedundantUserCode + "%"));
//开始时间查询条件
if (!TextUtils.isEmpty(startTime)) {
LocalDateTime startTime1 = DateTimeUtils.stringToLocalDateTime(startTime);
LocalDateTime startTime2 = LocalDateTime.of(startTime1.getYear(), startTime1.getMonth(), startTime1.getDayOfMonth(), 0, 0, 0, 0);
String startTimeString = DateTimeUtils.localDateTimeToString(startTime2);
predicateList.add(criteriaBuilder.greaterThanOrEqualTo(root.get("satelliteTime").as(String.class), startTimeString));
}
//结束时间查询条件
if (!TextUtils.isEmpty(endTime)) {
LocalDateTime endTime1 = DateTimeUtils.stringToLocalDateTime(endTime).plusDays(1);
LocalDateTime endTime2 = LocalDateTime.of(endTime1.getYear(), endTime1.getMonth(), endTime1.getDayOfMonth(), 0, 0, 0, 0);
String endTimeString = DateTimeUtils.localDateTimeToString(endTime2);
predicateList.add(criteriaBuilder.lessThanOrEqualTo(root.get("satelliteTime").as(String.class), endTimeString));
}
//卫星类型查询条件
if (!TextUtils.isEmpty(satelliteType)) {
predicateList.add(criteriaBuilder.equal(root.get("satelliteType").as(String.class), satelliteType));
}
//地物类型查询条件
if (!TextUtils.isEmpty(landType)) {
predicateList.add(criteriaBuilder.equal(root.get("landType").as(String.class), landType));
}
for (VipTimeRangeBean.VipTimeRangeItemBean vipTimeRangeItem : mVipTimeRangeItemList) {
String userStartTime = vipTimeRangeItem.getStartTime();
String userEndTime = vipTimeRangeItem.getEndTime();
@ -191,7 +213,28 @@ public class FirePointQueryManager {
List<Predicate> predicateList = new ArrayList<>();
//添加区划编码的过滤
predicateList.add(criteriaBuilder.like(root.get("townCode").as(String.class), finalMNoRedundantUserCode + "%"));
//开始时间查询条件
if (!TextUtils.isEmpty(startTime)) {
LocalDateTime startTime1 = DateTimeUtils.stringToLocalDateTime(startTime);
LocalDateTime startTime2 = LocalDateTime.of(startTime1.getYear(), startTime1.getMonth(), startTime1.getDayOfMonth(), 0, 0, 0, 0);
String startTimeString = DateTimeUtils.localDateTimeToString(startTime2);
predicateList.add(criteriaBuilder.greaterThanOrEqualTo(root.get("satelliteTime").as(String.class), startTimeString));
}
//结束时间查询条件
if (!TextUtils.isEmpty(endTime)) {
LocalDateTime endTime1 = DateTimeUtils.stringToLocalDateTime(endTime).plusDays(1);
LocalDateTime endTime2 = LocalDateTime.of(endTime1.getYear(), endTime1.getMonth(), endTime1.getDayOfMonth(), 0, 0, 0, 0);
String endTimeString = DateTimeUtils.localDateTimeToString(endTime2);
predicateList.add(criteriaBuilder.lessThanOrEqualTo(root.get("satelliteTime").as(String.class), endTimeString));
}
//卫星类型查询条件
if (!TextUtils.isEmpty(satelliteType)) {
predicateList.add(criteriaBuilder.equal(root.get("satelliteType").as(String.class), satelliteType));
}
//地物类型查询条件
if (!TextUtils.isEmpty(landType)) {
predicateList.add(criteriaBuilder.equal(root.get("landType").as(String.class), landType));
}
List<Predicate> subPredicateList = new ArrayList<>();
for (VipTimeRangeBean.VipTimeRangeItemBean vipTimeRangeItem : mVipTimeRangeItemList) {
String userStartTime = vipTimeRangeItem.getStartTime();