查询火点放开时间限制

This commit is contained in:
liuchengqian 2022-08-31 10:54:22 +08:00
parent e77f417cab
commit e3bb203a5a
2 changed files with 18 additions and 16 deletions

View File

@ -474,7 +474,7 @@ public class FirePointServiceImpl implements FirePointService {
/** /**
* 查询今天的火点信息 * 查询今天的火点信息
*/ */
@Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") // @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null")
@Override @Override
public List<FirePointEntity> selectTodayFirePoint(String countyCode) { public List<FirePointEntity> selectTodayFirePoint(String countyCode) {
@ -492,7 +492,7 @@ public class FirePointServiceImpl implements FirePointService {
/** /**
* 查询近一周的火点信息 * 查询近一周的火点信息
*/ */
@Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") // @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null")
@Override @Override
public List<FirePointEntity> selectFirePointBetweenSeven() { public List<FirePointEntity> selectFirePointBetweenSeven() {
@ -510,19 +510,21 @@ public class FirePointServiceImpl implements FirePointService {
/** /**
* 查询近一个月的火点信息 * 查询近一个月的火点信息
*/ */
@Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") // @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null")
@Override @Override
public List<FirePointEntity> selectFirePointByMonth(String countyCode) { public List<FirePointEntity> selectFirePointByMonth(String countyCode) {
LocalDateTime startTime1 = LocalDateTime.now().minusMonths(1); // LocalDateTime startTime1 = LocalDateTime.now().minusMonths(1);
LocalDateTime startTime2 = LocalDateTime.of(startTime1.getYear(), startTime1.getMonth(), startTime1.getDayOfMonth(), 0, 0, 0, 0); // LocalDateTime startTime2 = LocalDateTime.of(startTime1.getYear(), startTime1.getMonth(), startTime1.getDayOfMonth(), 0, 0, 0, 0);
String startTimeString = DateTimeUtils.localDateTimeToString(startTime2); // String startTimeString = DateTimeUtils.localDateTimeToString(startTime2);
//
LocalDateTime endTime1 = LocalDateTime.now().plusDays(1); // LocalDateTime endTime1 = LocalDateTime.now().plusDays(1);
LocalDateTime endTime2 = LocalDateTime.of(endTime1.getYear(), endTime1.getMonth(), endTime1.getDayOfMonth(), 0, 0, 0, 0); // LocalDateTime endTime2 = LocalDateTime.of(endTime1.getYear(), endTime1.getMonth(), endTime1.getDayOfMonth(), 0, 0, 0, 0);
String endTimeString = DateTimeUtils.localDateTimeToString(endTime2); // String endTimeString = DateTimeUtils.localDateTimeToString(endTime2);
//
return firePointQueryHelper.queryFirePoint(countyCode, startTimeString, endTimeString, null, null); // return firePointQueryHelper.queryFirePoint(countyCode, startTimeString, endTimeString, null, null);
List<FirePointEntity> firePointEntities = firePointQueryHelper.queryFirePoint(countyCode, null, null, null, null);
return firePointEntities;
} }
/** /**
@ -643,7 +645,7 @@ public class FirePointServiceImpl implements FirePointService {
* *
* @return * @return
*/ */
@Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") // @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null")
@Override @Override
public String selectFirePointNumMonth() { public String selectFirePointNumMonth() {
Map map = new HashMap(3); Map map = new HashMap(3);
@ -668,7 +670,7 @@ public class FirePointServiceImpl implements FirePointService {
* *
* @return * @return
*/ */
@Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") // @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null")
@Override @Override
public String selectFirePointNumDay() { public String selectFirePointNumDay() {
Map map = new HashMap(3); Map map = new HashMap(3);
@ -693,7 +695,7 @@ public class FirePointServiceImpl implements FirePointService {
* *
* @return * @return
*/ */
@Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") // @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null")
@Override @Override
public String selectFirePointNumWeek() { public String selectFirePointNumWeek() {
Map map = new HashMap(3); Map map = new HashMap(3);

View File

@ -41,7 +41,7 @@ public class FirePointQueryHelper {
LocalDateTime lastMonth1 = LocalDateTime.now().minusDays(30); LocalDateTime lastMonth1 = LocalDateTime.now().minusDays(30);
LocalDateTime lastMonth2 = LocalDateTime.of(lastMonth1.getYear(), lastMonth1.getMonth(), lastMonth1.getDayOfMonth(), 0, 0, 0, 0); LocalDateTime lastMonth2 = LocalDateTime.of(lastMonth1.getYear(), lastMonth1.getMonth(), lastMonth1.getDayOfMonth(), 0, 0, 0, 0);
String lastMonthString = DateTimeUtils.localDateTimeToString(lastMonth2); String lastMonthString = DateTimeUtils.localDateTimeToString(lastMonth2);
predicateList.add(criteriaBuilder.greaterThanOrEqualTo(root.get("satelliteTime").as(String.class), lastMonthString)); // predicateList.add(criteriaBuilder.greaterThanOrEqualTo(root.get("satelliteTime").as(String.class), lastMonthString));
//开始时间查询条件 //开始时间查询条件
if (!TextUtils.isEmpty(startTime)) { if (!TextUtils.isEmpty(startTime)) {
LocalDateTime startTime1 = DateTimeUtils.stringToLocalDateTime(startTime); LocalDateTime startTime1 = DateTimeUtils.stringToLocalDateTime(startTime);