|
|
@ -102,7 +102,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public IPage<HistoryAbnormalAlarmVo> getAlarmTime(Query query, HistoryAbnormalAlarmEntity entity) { |
|
|
|
public IPage<HistoryAbnormalAlarmVo> getAlarmTime(Query query, HistoryAlarmVo entity) { |
|
|
|
QueryWrapper<HistoryAbnormalAlarmEntity> alarmEntityQueryWrapper = getAlarmEntityQueryWrapper(entity); |
|
|
|
QueryWrapper<HistoryAbnormalAlarmEntity> alarmEntityQueryWrapper = getAlarmEntityQueryWrapper(entity); |
|
|
|
List<HistoryAbnormalAlarmEntity> historyAbnormalAlarmEntity = this.baseMapper.selectList(alarmEntityQueryWrapper); |
|
|
|
List<HistoryAbnormalAlarmEntity> historyAbnormalAlarmEntity = this.baseMapper.selectList(alarmEntityQueryWrapper); |
|
|
|
if (historyAbnormalAlarmEntity == null) { |
|
|
|
if (historyAbnormalAlarmEntity == null) { |
|
|
@ -131,8 +131,11 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno |
|
|
|
String key = entry.getKey(); |
|
|
|
String key = entry.getKey(); |
|
|
|
historyAbnormalAlarmVo.setStationName(key); |
|
|
|
historyAbnormalAlarmVo.setStationName(key); |
|
|
|
historyAbnormalAlarmVo.setTimes(timesList.get(key)); |
|
|
|
historyAbnormalAlarmVo.setTimes(timesList.get(key)); |
|
|
|
if (StringUtils.isNotEmpty(entity.getType())) { |
|
|
|
if (CollectionUtil.isNotEmpty(entity.getType())) { |
|
|
|
historyAbnormalAlarmVo.setType(entity.getType()); |
|
|
|
//只有告警类型唯一,前端才根据这个字段进行渲染
|
|
|
|
|
|
|
|
if (entity.getType().size()==1) { |
|
|
|
|
|
|
|
historyAbnormalAlarmVo.setType(entity.getType().get(0)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
res.add(historyAbnormalAlarmVo); |
|
|
|
res.add(historyAbnormalAlarmVo); |
|
|
|
} |
|
|
|
} |
|
|
@ -155,14 +158,14 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private QueryWrapper<HistoryAbnormalAlarmEntity> getAlarmEntityQueryWrapper(HistoryAbnormalAlarmEntity entity) { |
|
|
|
private QueryWrapper<HistoryAbnormalAlarmEntity> getAlarmEntityQueryWrapper(HistoryAlarmVo entity) { |
|
|
|
QueryWrapper<HistoryAbnormalAlarmEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<HistoryAbnormalAlarmEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
if (entity.getStationName() != null) { |
|
|
|
if (entity.getStationName() != null) { |
|
|
|
String[] list = entity.getStationName().split(","); |
|
|
|
String[] list = entity.getStationName().split(","); |
|
|
|
queryWrapper.lambda().in(HistoryAbnormalAlarmEntity::getStationName, Arrays.stream(list).collect(Collectors.toList())); |
|
|
|
queryWrapper.lambda().in(HistoryAbnormalAlarmEntity::getStationName, Arrays.stream(list).collect(Collectors.toList())); |
|
|
|
} |
|
|
|
} |
|
|
|
if (entity.getType() != null) { |
|
|
|
if (entity.getType() != null) { |
|
|
|
queryWrapper.lambda().eq(HistoryAbnormalAlarmEntity::getType, entity.getType()); |
|
|
|
queryWrapper.lambda().in(HistoryAbnormalAlarmEntity::getType, entity.getType()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (entity.getStartTime() != null) { |
|
|
|
if (entity.getStartTime() != null) { |
|
|
|
queryWrapper.lambda().ge(HistoryAbnormalAlarmEntity::getStartTime, entity.getStartTime()); |
|
|
|
queryWrapper.lambda().ge(HistoryAbnormalAlarmEntity::getStartTime, entity.getStartTime()); |
|
|
@ -174,7 +177,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public IPage<HistoryAbnormalAlarmVo> queryByEntity(HistoryAbnormalAlarmEntity entity, Query query) { |
|
|
|
public IPage<HistoryAbnormalAlarmVo> queryByEntity(HistoryAlarmVo entity, Query query) { |
|
|
|
QueryWrapper<HistoryAbnormalAlarmEntity> alarmEntityQueryWrapper = getAlarmEntityQueryWrapper(entity); |
|
|
|
QueryWrapper<HistoryAbnormalAlarmEntity> alarmEntityQueryWrapper = getAlarmEntityQueryWrapper(entity); |
|
|
|
IPage<HistoryAbnormalAlarmEntity> historyAbnormalAlarmEntityIPage = this.baseMapper.selectPage(Condition.getPage(query), alarmEntityQueryWrapper); |
|
|
|
IPage<HistoryAbnormalAlarmEntity> historyAbnormalAlarmEntityIPage = this.baseMapper.selectPage(Condition.getPage(query), alarmEntityQueryWrapper); |
|
|
|
List<HistoryAbnormalAlarmEntity> records = historyAbnormalAlarmEntityIPage.getRecords(); |
|
|
|
List<HistoryAbnormalAlarmEntity> records = historyAbnormalAlarmEntityIPage.getRecords(); |
|
|
|