#修改统计历史状态的接口
This commit is contained in:
@@ -419,7 +419,22 @@ public class DeviceServiceImpl implements IDeviceService {
|
||||
queryWrapper.ge(DeviceRunningStatusHistory::getCreateTime, dto.getStartTime());
|
||||
queryWrapper.le(DeviceRunningStatusHistory::getCreateTime, dto.getEndTime());
|
||||
}
|
||||
return deviceStatusHistoryMapper.selectList(queryWrapper);
|
||||
List<DeviceRunningStatusHistory> list = deviceStatusHistoryMapper.selectList(queryWrapper);
|
||||
|
||||
String key = "running_status:" + dto.getDeviceId();
|
||||
DeviceStatusRecordDTO recordDTO = redisCache.getCacheObject(key);
|
||||
List<DeviceRunningStatusHistory> cacheList;
|
||||
if (recordDTO != null) {
|
||||
cacheList = recordDTO.getHistories();
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
if (!CollectionUtils.isEmpty(cacheList)) {
|
||||
list.addAll(cacheList);
|
||||
}
|
||||
} else {
|
||||
return cacheList;
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user