Commit 8dbc7363 authored by zhangsen's avatar zhangsen

夏造运行列表优化

parent 0077db66
......@@ -832,18 +832,26 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public ResultsData runningPageByStationId(int current, int size, String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String baseSql = "SELECT equipmentNumber, value FROM \"indicators_%s\" where equipmentIndexName = '%s'";
String windSql = String.format(baseSql, stationBasic.getFanGatewayId(), "风向角");
List<IndicatorsDto> windSqlList = influxDButils.getListDataAll(windSql,IndicatorsDto.class);
String powerSql = String.format(baseSql, stationBasic.getFanGatewayId(), "有功功率");
List<IndicatorsDto> powerSqlList = influxDButils.getListDataAll(powerSql,IndicatorsDto.class);
String baseSql = "SELECT equipmentNumber, value, equipmentIndexName FROM \"indicators_%s\" where equipmentIndexName = '%s' or equipmentIndexName = '%s' or equipmentIndexName = '%s' or equipmentIndexName = '%s'";
String windSql = String.format(baseSql, stationBasic.getFanGatewayId(), "风向角", "有功功率", "瞬时风速", "日发电量");
List<IndicatorsDto> allList = influxDButils.getListDataAll(windSql,IndicatorsDto.class);
List<IndicatorsDto> windSqlList = new ArrayList<>();
List<IndicatorsDto> powerSqlList = new ArrayList<>();
List<IndicatorsDto> windSpeedSqlList = new ArrayList<>();
List<IndicatorsDto> electricitySqlList = new ArrayList<>();
allList.forEach(item -> {
if ("风向角".equals(item.getEquipmentIndexName())) {
windSqlList.add(item);
} if ("有功功率".equals(item.getEquipmentIndexName())) {
powerSqlList.add(item);
} if ("瞬时风速".equals(item.getEquipmentIndexName())) {
windSpeedSqlList.add(item);
} if ("日发电量".equals(item.getEquipmentIndexName())) {
electricitySqlList.add(item);
}
});
Map<String, String> powerSqlMap = powerSqlList.stream().collect(Collectors.toMap(IndicatorsDto::getEquipmentNumber, IndicatorsDto::getValue));
String windSpeedSql = String.format(baseSql, stationBasic.getFanGatewayId(), "瞬时风速");
List<IndicatorsDto> windSpeedSqlList = influxDButils.getListDataAll(windSpeedSql,IndicatorsDto.class);
Map<String, String> windSpeedSqlMap = windSpeedSqlList.stream().collect(Collectors.toMap(IndicatorsDto::getEquipmentNumber, IndicatorsDto::getValue));
String electricitySql = String.format(baseSql, stationBasic.getFanGatewayId(), "日发电量");
List<IndicatorsDto> electricitySqlList = influxDButils.getListDataAll(electricitySql,IndicatorsDto.class);
Map<String, String> electricitySqlMap = electricitySqlList.stream().collect(Collectors.toMap(IndicatorsDto::getEquipmentNumber, IndicatorsDto::getValue));
ArrayList<Map<String, String>> resultList = new ArrayList<>();
windSqlList.forEach(item -> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment