Commit 5b515430 authored by KeYong's avatar KeYong

更新

parent 043c39de
...@@ -390,7 +390,8 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -390,7 +390,8 @@ public class IdxBizFanHealthIndexController extends BaseController {
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8); Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8);
startTimeTop = formatter.format(startDate); startTimeTop = formatter.format(startDate);
} }
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, null); List<String> gatewayIds = this.getGatewayIds();
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, gatewayIds);
fanHealthIndexDays.forEach(item -> { fanHealthIndexDays.forEach(item -> {
double roundedNumber = Double.parseDouble(df.format(item.getHealthIndex())); double roundedNumber = Double.parseDouble(df.format(item.getHealthIndex()));
...@@ -436,7 +437,8 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -436,7 +437,8 @@ public class IdxBizFanHealthIndexController extends BaseController {
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8); Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8);
startTimeTop = formatter.format(startDate); startTimeTop = formatter.format(startDate);
} }
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, null); List<String> gatewayIds = this.getGatewayIds();
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, gatewayIds);
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("value",Double.parseDouble(df.format(Double.parseDouble(fanHealthIndexDays.get(0).getValue())))); map.put("value",Double.parseDouble(df.format(Double.parseDouble(fanHealthIndexDays.get(0).getValue()))));
...@@ -451,7 +453,8 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -451,7 +453,8 @@ public class IdxBizFanHealthIndexController extends BaseController {
@RequestParam(value = "station",required = false) String station, @RequestParam(value = "station",required = false) String station,
@RequestParam(value = "analysisObjType",required = false) String analysisObjType @RequestParam(value = "analysisObjType",required = false) String analysisObjType
) { ) {
List<Map<String, Object>> maps = fanHealthIndexDayMapper.selectEquipStatusByStation(area, analysisObjType, station); List<String> gatewayIds = this.getGatewayIds();
List<Map<String, Object>> maps = fanHealthIndexDayMapper.selectEquipStatusByStation(area, analysisObjType, station, gatewayIds);
if (maps.size() == 4){ if (maps.size() == 4){
for (Map<String, Object> map : maps) { for (Map<String, Object> map : maps) {
map.put("name",map.get("healthlevel")); map.put("name",map.get("healthlevel"));
...@@ -764,7 +767,6 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -764,7 +767,6 @@ public class IdxBizFanHealthIndexController extends BaseController {
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8); Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8);
startTimeTop = formatter.format(startDate); startTimeTop = formatter.format(startDate);
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, gatewayIds); List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, gatewayIds);
fanHealthIndexDays= fanHealthIndexDays.stream().sorted(Comparator.comparing(FanHealthIndexDay::getAnalysisTime)).collect(Collectors.toList()); fanHealthIndexDays= fanHealthIndexDays.stream().sorted(Comparator.comparing(FanHealthIndexDay::getAnalysisTime)).collect(Collectors.toList());
......
...@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord; ...@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRuleSet; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRuleSet;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRuleSet; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRuleSet;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanPointProcessVariableClassificationMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanPointProcessVariableClassificationMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.IPermissionService;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRecordServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRecordServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRuleSetServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRuleSetServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRuleSetServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRuleSetServiceImpl;
...@@ -54,6 +55,8 @@ public class IdxBizFanWarningRecordController extends BaseController { ...@@ -54,6 +55,8 @@ public class IdxBizFanWarningRecordController extends BaseController {
@Autowired @Autowired
FanWaringRecordMapper fanWaringRecordMapper; FanWaringRecordMapper fanWaringRecordMapper;
@Autowired
private IPermissionService permissionService;
@Autowired @Autowired
IdxBizFanPointProcessVariableClassificationMapper idxBizFanPointProcessVariableClassificationMapper; IdxBizFanPointProcessVariableClassificationMapper idxBizFanPointProcessVariableClassificationMapper;
...@@ -357,7 +360,8 @@ public class IdxBizFanWarningRecordController extends BaseController { ...@@ -357,7 +360,8 @@ public class IdxBizFanWarningRecordController extends BaseController {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> maps = fanWaringRecordMapper.selectFanWarningNum(station); List<String> gatewayIds = this.getGatewayIds();
List<Map<String, Object>> maps = fanWaringRecordMapper.selectFanWarningNum(station, gatewayIds);
Map<String, Map<String, Object>> equipmentNameInfoMap = maps.stream().collect(Collectors.toMap(t -> t.get("EQUIPMENT_NAME").toString(), t -> t)); Map<String, Map<String, Object>> equipmentNameInfoMap = maps.stream().collect(Collectors.toMap(t -> t.get("EQUIPMENT_NAME").toString(), t -> t));
List<Integer> wxList = new ArrayList<>(); List<Integer> wxList = new ArrayList<>();
...@@ -403,8 +407,8 @@ public class IdxBizFanWarningRecordController extends BaseController { ...@@ -403,8 +407,8 @@ public class IdxBizFanWarningRecordController extends BaseController {
@GetMapping(value = "/selectEquipWarningTotal") @GetMapping(value = "/selectEquipWarningTotal")
@ApiOperation(httpMethod = "GET", value = "预警信息统计富文本", notes = "预警信息统计富文本") @ApiOperation(httpMethod = "GET", value = "预警信息统计富文本", notes = "预警信息统计富文本")
public ResponseModel<Map<String, Object>> selectEquipWarningTotal(@RequestParam String STATION, @RequestParam String EQUIPMENTNAME) { public ResponseModel<Map<String, Object>> selectEquipWarningTotal(@RequestParam String STATION, @RequestParam String EQUIPMENTNAME) {
Map<String, Object> maps = fanWaringRecordMapper.selectEquipWarningTotal(STATION, EQUIPMENTNAME); List<String> gatewayIds = this.getGatewayIds();
Map<String, Object> maps = fanWaringRecordMapper.selectEquipWarningTotal(STATION, EQUIPMENTNAME, gatewayIds);
return ResponseHelper.buildResponse(maps); return ResponseHelper.buildResponse(maps);
} }
...@@ -415,11 +419,20 @@ public class IdxBizFanWarningRecordController extends BaseController { ...@@ -415,11 +419,20 @@ public class IdxBizFanWarningRecordController extends BaseController {
Page<FanWarningRecord> page = new Page<>(); Page<FanWarningRecord> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
List<FanWarningRecord> maps = fanWaringRecordMapper.selectWarningPoint(STATION, EQUIPMENTNAME, (current - 1) * size, size); List<String> gatewayIds = this.getGatewayIds();
List<FanWarningRecord> maps = fanWaringRecordMapper.selectWarningPoint(STATION, EQUIPMENTNAME, (current - 1) * size, size, gatewayIds);
page.setRecords(maps); page.setRecords(maps);
int total = fanWaringRecordMapper.selectWarningPointTotal(STATION, EQUIPMENTNAME); int total = fanWaringRecordMapper.selectWarningPointTotal(STATION, EQUIPMENTNAME);
page.setTotal(total); page.setTotal(total);
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
private List<String> getGatewayIds() {
List<String> permissions = permissionService.getCurrentUserPermissions();
if (Objects.isNull(permissions)) {
permissions = Collections.emptyList();
}
return permissions;
}
} }
...@@ -264,20 +264,20 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -264,20 +264,20 @@ public class IdxBizPvHealthIndexController extends BaseController {
@RequestParam(value = "subarray",required = false) String subarray){ @RequestParam(value = "subarray",required = false) String subarray){
List<String> gatewayIds = this.getGatewayIds();
if (requiredType.equals("按天")){ if (requiredType.equals("按天")){
Date startDayTime = DateUtils.getCurrentDayStartTime(new Date()); Date startDayTime = DateUtils.getCurrentDayStartTime(new Date());
Date date = DateUtils.dateAddHours(startDayTime, -8); Date date = DateUtils.dateAddHours(startDayTime, -8);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
startTimeTop = formatter.format(date); startTimeTop = formatter.format(date);
List<PvHealthIndexDay> fanHealthIndexDays = pvHealthIndexDayMapper.selectData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName,(current-1)*size,size, null); List<PvHealthIndexDay> fanHealthIndexDays = pvHealthIndexDayMapper.selectData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName,(current-1)*size,size, gatewayIds);
fanHealthIndexDays.forEach(item -> { fanHealthIndexDays.forEach(item -> {
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex()))); item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex())));
}); });
int total = pvHealthIndexDayMapper.selectDataTotal(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName); int total = pvHealthIndexDayMapper.selectDataTotal(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName, gatewayIds);
Page page = new Page<>(); Page page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
...@@ -296,11 +296,11 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -296,11 +296,11 @@ public class IdxBizPvHealthIndexController extends BaseController {
e.printStackTrace(); e.printStackTrace();
} }
List<PvHealthIndexHour> fanHealthIndexHours = pvHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, null); List<PvHealthIndexHour> fanHealthIndexHours = pvHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, gatewayIds);
fanHealthIndexHours.forEach(item -> { fanHealthIndexHours.forEach(item -> {
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex()))); item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex())));
}); });
int total = pvHealthIndexHourMapper.selectDataTotal(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop); int total = pvHealthIndexHourMapper.selectDataTotal(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, gatewayIds);
Page page = new Page<>(); Page page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
...@@ -313,7 +313,7 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -313,7 +313,7 @@ public class IdxBizPvHealthIndexController extends BaseController {
date = DateUtils.dateAddHours(date, -8); date = DateUtils.dateAddHours(date, -8);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
startTimeTop = formatter.format(date); startTimeTop = formatter.format(date);
List<PvHealthIndexMoment> fanHealthIndexMoments = pvHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, null); List<PvHealthIndexMoment> fanHealthIndexMoments = pvHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, gatewayIds);
fanHealthIndexMoments.forEach(item -> { fanHealthIndexMoments.forEach(item -> {
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex()))); item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex())));
}); });
...@@ -321,7 +321,7 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -321,7 +321,7 @@ public class IdxBizPvHealthIndexController extends BaseController {
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
page.setRecords(fanHealthIndexMoments); page.setRecords(fanHealthIndexMoments);
int total = pvHealthIndexMomentMapper.selectDataTotal(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop); int total = pvHealthIndexMomentMapper.selectDataTotal(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, gatewayIds);
page.setTotal(total); page.setTotal(total);
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
...@@ -348,14 +348,14 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -348,14 +348,14 @@ public class IdxBizPvHealthIndexController extends BaseController {
@RequestParam(value = "subarray",required = false) String subarray){ @RequestParam(value = "subarray",required = false) String subarray){
List<String> gatewayIds = this.getGatewayIds();
if (requiredType.equals("按天")){ if (requiredType.equals("按天")){
Date startDayTime = DateUtils.getCurrentDayStartTime(new Date()); Date startDayTime = DateUtils.getCurrentDayStartTime(new Date());
Date date = DateUtils.dateAddHours(startDayTime, -8); Date date = DateUtils.dateAddHours(startDayTime, -8);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
startTimeTop = formatter.format(date); startTimeTop = formatter.format(date);
List<PvHealthIndexDay> fanHealthIndexDays = pvHealthIndexDayMapper.selectData(station, requiredType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName,(current-1)*size,size, null); List<PvHealthIndexDay> fanHealthIndexDays = pvHealthIndexDayMapper.selectData(station, requiredType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName,(current-1)*size,size, gatewayIds);
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
...@@ -377,7 +377,7 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -377,7 +377,7 @@ public class IdxBizPvHealthIndexController extends BaseController {
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
} }
List<PvHealthIndexHour> fanHealthIndexHours = pvHealthIndexHourMapper.selectData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName,(current-1)*size,size, null); List<PvHealthIndexHour> fanHealthIndexHours = pvHealthIndexHourMapper.selectData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName,(current-1)*size,size, gatewayIds);
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("value", Double.parseDouble(df.format(fanHealthIndexHours.get(0).getHealthIndex()))); map.put("value", Double.parseDouble(df.format(fanHealthIndexHours.get(0).getHealthIndex())));
...@@ -388,7 +388,7 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -388,7 +388,7 @@ public class IdxBizPvHealthIndexController extends BaseController {
date = DateUtils.dateAddHours(date, -8); date = DateUtils.dateAddHours(date, -8);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
startTimeTop = formatter.format(date); startTimeTop = formatter.format(date);
List<PvHealthIndexMoment> fanHealthIndexMoments = pvHealthIndexMomentMapper.selectData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName,(current-1)*size,size, null); List<PvHealthIndexMoment> fanHealthIndexMoments = pvHealthIndexMomentMapper.selectData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName,(current-1)*size,size, gatewayIds);
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("value", Double.parseDouble(df.format(fanHealthIndexMoments.get(0).getHealthIndex()))); map.put("value", Double.parseDouble(df.format(fanHealthIndexMoments.get(0).getHealthIndex())));
...@@ -502,7 +502,8 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -502,7 +502,8 @@ public class IdxBizPvHealthIndexController extends BaseController {
@ApiOperation(httpMethod = "GET",value = "预警监测设备级统计 TD", notes = "预警监测设备级统计 TD") @ApiOperation(httpMethod = "GET",value = "预警监测设备级统计 TD", notes = "预警监测设备级统计 TD")
@GetMapping(value = "/selectPointNum") @GetMapping(value = "/selectPointNum")
public ResponseModel<List<Map<String,Object>>> selectPointNum(@RequestParam(required = false) String STATION,@RequestParam(required = false) String SUBARRAY,@RequestParam(required = false) String EQUIPMENTNAME) { public ResponseModel<List<Map<String,Object>>> selectPointNum(@RequestParam(required = false) String STATION,@RequestParam(required = false) String SUBARRAY,@RequestParam(required = false) String EQUIPMENTNAME) {
List<Map<String, Object>> maps = pvHealthIndexDayMapper.selectEquipStatusByEquipment( "测点", STATION,EQUIPMENTNAME, SUBARRAY); List<String> gatewayIds = this.getGatewayIds();
List<Map<String, Object>> maps = pvHealthIndexDayMapper.selectEquipStatusByEquipment( "测点", STATION,EQUIPMENTNAME, SUBARRAY, gatewayIds);
if (maps.size() == 4){ if (maps.size() == 4){
for (Map<String, Object> map : maps) { for (Map<String, Object> map : maps) {
map.put("name",map.get("healthlevel")); map.put("name",map.get("healthlevel"));
...@@ -542,9 +543,10 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -542,9 +543,10 @@ public class IdxBizPvHealthIndexController extends BaseController {
Page<PvWarningRecord> page = new Page<>(); Page<PvWarningRecord> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
List<PvWarningRecord> maps = pvWaringRecordMapper.selectWarningPoint(STATION,EQUIPMENTNAME,SUBARRAY,(current-1)*size,size); List<String> gatewayIds = this.getGatewayIds();
List<PvWarningRecord> maps = pvWaringRecordMapper.selectWarningPoint(STATION,EQUIPMENTNAME,SUBARRAY,(current-1)*size,size, gatewayIds);
page.setRecords(maps); page.setRecords(maps);
int total = pvWaringRecordMapper.selectWarningPointTotal(STATION, EQUIPMENTNAME,SUBARRAY); int total = pvWaringRecordMapper.selectWarningPointTotal(STATION, EQUIPMENTNAME,SUBARRAY, gatewayIds);
page.setTotal(total); page.setTotal(total);
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
...@@ -554,8 +556,8 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -554,8 +556,8 @@ public class IdxBizPvHealthIndexController extends BaseController {
@GetMapping(value = "/selectEquipWarningTotal") @GetMapping(value = "/selectEquipWarningTotal")
@ApiOperation(httpMethod = "GET", value = "预警信息统计富文本", notes = "预警信息统计富文本") @ApiOperation(httpMethod = "GET", value = "预警信息统计富文本", notes = "预警信息统计富文本")
public ResponseModel<Map<String,Object>> selectEquipWarningTotal(@RequestParam String STATION,@RequestParam String EQUIPMENTNAME,@RequestParam(required = false) String SUBARRAY) { public ResponseModel<Map<String,Object>> selectEquipWarningTotal(@RequestParam String STATION,@RequestParam String EQUIPMENTNAME,@RequestParam(required = false) String SUBARRAY) {
Map<String, Object> map = pvWaringRecordMapper.selectEquipWarningTotal(STATION,EQUIPMENTNAME,SUBARRAY); List<String> gatewayIds = this.getGatewayIds();
Map<String, Object> map = pvWaringRecordMapper.selectEquipWarningTotal(STATION,EQUIPMENTNAME,SUBARRAY, gatewayIds);
return ResponseHelper.buildResponse(map); return ResponseHelper.buildResponse(map);
} }
...@@ -566,7 +568,8 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -566,7 +568,8 @@ public class IdxBizPvHealthIndexController extends BaseController {
@RequestParam(value = "station",required = false) String station, @RequestParam(value = "station",required = false) String station,
@RequestParam(value = "analysisObjType",required = false) String analysisObjType @RequestParam(value = "analysisObjType",required = false) String analysisObjType
) { ) {
List<Map<String, Object>> maps = pvHealthIndexDayMapper.selectEquipStatusByStationPv(area, analysisObjType, station); List<String> gatewayIds = this.getGatewayIds();
List<Map<String, Object>> maps = pvHealthIndexDayMapper.selectEquipStatusByStationPv(area, analysisObjType, station, gatewayIds);
if (maps.size() == 4){ if (maps.size() == 4){
for (Map<String, Object> map : maps) { for (Map<String, Object> map : maps) {
map.put("name",map.get("healthlevel")); map.put("name",map.get("healthlevel"));
...@@ -611,10 +614,9 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -611,10 +614,9 @@ public class IdxBizPvHealthIndexController extends BaseController {
wrapper.groupBy(IdxBizPvPointProcessVariableClassification::getSubarray); wrapper.groupBy(IdxBizPvPointProcessVariableClassification::getSubarray);
wrapper.last(" ORDER BY SUBARRAY desc"); wrapper.last(" ORDER BY SUBARRAY desc");
List<IdxBizPvPointProcessVariableClassification> variableClassificationList = idxBizPvPointProcessVariableClassificationMapper.selectList(wrapper); List<IdxBizPvPointProcessVariableClassification> variableClassificationList = idxBizPvPointProcessVariableClassificationMapper.selectList(wrapper);
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> maps = pvWaringRecordMapper.selectFanWarningNum(station); List<String> gatewayIds = this.getGatewayIds();
List<Map<String, Object>> maps = pvWaringRecordMapper.selectFanWarningNum(station, gatewayIds);
Map<String, Map<String, Object>> equipmentNameInfoMap = maps.stream().collect(Collectors.toMap(t -> t.get("subarray").toString(), t -> t)); Map<String, Map<String, Object>> equipmentNameInfoMap = maps.stream().collect(Collectors.toMap(t -> t.get("subarray").toString(), t -> t));
List<Integer> wxList = new ArrayList<>(); List<Integer> wxList = new ArrayList<>();
......
...@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.kafka.FanConditionVariablesMessage ...@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.kafka.FanConditionVariablesMessage
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthLevelMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthLevelMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.IPermissionService;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -24,10 +25,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -24,10 +25,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.yeejoin.amos.boot.module.jxiop.biz.kafka.Constant.*; import static com.yeejoin.amos.boot.module.jxiop.biz.kafka.Constant.*;
...@@ -43,6 +41,8 @@ public class KafkaAnalyseController { ...@@ -43,6 +41,8 @@ public class KafkaAnalyseController {
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired
IPermissionService permissionService;
@Autowired @Autowired
IdxBizFanHealthLevelMapper idxBizFanHealthLevelMapper; IdxBizFanHealthLevelMapper idxBizFanHealthLevelMapper;
...@@ -162,23 +162,24 @@ public class KafkaAnalyseController { ...@@ -162,23 +162,24 @@ public class KafkaAnalyseController {
@ApiOperation(value = "全景诊断回溯") @ApiOperation(value = "全景诊断回溯")
@GetMapping("/getFullViewRecall") @GetMapping("/getFullViewRecall")
public ResponseModel<List<FullViewRecallInfoDTO>> getFullViewRecall(@RequestParam(required = false, value = "analysisType") String analysisType) { public ResponseModel<List<FullViewRecallInfoDTO>> getFullViewRecall(@RequestParam(required = false, value = "analysisType") String analysisType) {
List<Map<String, Object>> stationIndexInfo = idxBizFanHealthIndexMapper.getStationIndexInfoByParam(analysisType); List<String> gatewayIds = this.getGatewayIds();
List<Map<String, Object>> stationIndexInfo = idxBizFanHealthIndexMapper.getStationIndexInfoByParam(analysisType, gatewayIds);
Map<String, Double> stationHealthIndexMap = stationIndexInfo.stream().collect(Collectors.toMap(t -> t.get("station").toString(), t -> Double.parseDouble(t.get("healthIndex").toString()))); Map<String, Double> stationHealthIndexMap = stationIndexInfo.stream().collect(Collectors.toMap(t -> t.get("station").toString(), t -> Double.parseDouble(t.get("healthIndex").toString())));
List<Map<String, Object>> equipmentIndexInfo = idxBizFanHealthIndexMapper.getEquipmentIndexInfoByParam(analysisType); List<Map<String, Object>> equipmentIndexInfo = idxBizFanHealthIndexMapper.getEquipmentIndexInfoByParam(analysisType, gatewayIds);
Map<String, Double> equipmentIndexInfoMap = equipmentIndexInfo.stream().collect(Collectors.toMap(t -> t.get("equipmentName").toString(), t -> Double.parseDouble(t.get("healthIndex").toString()))); Map<String, Double> equipmentIndexInfoMap = equipmentIndexInfo.stream().collect(Collectors.toMap(t -> t.get("equipmentName").toString(), t -> Double.parseDouble(t.get("healthIndex").toString())));
List<Map<String, Object>> subSystemIndexInfo = idxBizFanHealthIndexMapper.getSubSystemIndexInfoByParam(analysisType); List<Map<String, Object>> subSystemIndexInfo = idxBizFanHealthIndexMapper.getSubSystemIndexInfoByParam(analysisType, gatewayIds);
Map<String, Double> subSystemIndexInfoMap = subSystemIndexInfo.stream().collect(Collectors.toMap(t -> t.get("subSystem").toString(), t -> Double.parseDouble(t.get("healthIndex").toString()))); Map<String, Double> subSystemIndexInfoMap = subSystemIndexInfo.stream().collect(Collectors.toMap(t -> t.get("subSystem").toString(), t -> Double.parseDouble(t.get("healthIndex").toString())));
List<Map<String, Object>> pointNameIndexInfo = idxBizFanHealthIndexMapper.getPointNameIndexInfoByParam(analysisType); List<Map<String, Object>> pointNameIndexInfo = idxBizFanHealthIndexMapper.getPointNameIndexInfoByParam(analysisType, gatewayIds);
Map<String, Double> pointNameIndexInfoMap = pointNameIndexInfo.stream().collect(Collectors.toMap(t -> t.get("gatewayIndexAddress").toString(), t -> Double.parseDouble(t.get("healthIndex").toString()))); Map<String, Double> pointNameIndexInfoMap = pointNameIndexInfo.stream().collect(Collectors.toMap(t -> t.get("gatewayIndexAddress").toString(), t -> Double.parseDouble(t.get("healthIndex").toString())));
List<IdxBizFanHealthLevel> healthLevelInfoList = idxBizFanHealthIndexMapper.getHealthLevelInfoList(); List<IdxBizFanHealthLevel> healthLevelInfoList = idxBizFanHealthIndexMapper.getHealthLevelInfoList(gatewayIds);
List<FullViewRecallDataDTO> list = idxBizFanHealthIndexMapper.getFullViewRecall(); List<FullViewRecallDataDTO> list = idxBizFanHealthIndexMapper.getFullViewRecall();
Map<String, Map<String, Map<String, Map<String, Map<String, List<FullViewRecallDataDTO>>>>>> resultMap = list.stream() Map<String, Map<String, Map<String, Map<String, Map<String, List<FullViewRecallDataDTO>>>>>> resultMap = list.stream()
...@@ -384,4 +385,12 @@ public class KafkaAnalyseController { ...@@ -384,4 +385,12 @@ public class KafkaAnalyseController {
return resultDto; return resultDto;
} }
private List<String> getGatewayIds() {
List<String> permissions = permissionService.getCurrentUserPermissions();
if (Objects.isNull(permissions)) {
permissions = Collections.emptyList();
}
return permissions;
}
} }
...@@ -110,15 +110,15 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn ...@@ -110,15 +110,15 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List<Map<String, Object>> getPointNameIndexInfo(); List<Map<String, Object>> getPointNameIndexInfo();
List<Map<String, Object>> getStationIndexInfoByParam(@Param("analysisType") String analysisType); List<Map<String, Object>> getStationIndexInfoByParam(@Param("analysisType") String analysisType, @Param("gatewayIds") List<String> gatewayIds);
List<Map<String, Object>> getEquipmentIndexInfoByParam(@Param("analysisType") String analysisType); List<Map<String, Object>> getEquipmentIndexInfoByParam(@Param("analysisType") String analysisType, @Param("gatewayIds") List<String> gatewayIds);
List<Map<String, Object>> getSubSystemIndexInfoByParam(@Param("analysisType") String analysisType); List<Map<String, Object>> getSubSystemIndexInfoByParam(@Param("analysisType") String analysisType, @Param("gatewayIds") List<String> gatewayIds);
List<Map<String, Object>> getPointNameIndexInfoByParam(@Param("analysisType") String analysisType); List<Map<String, Object>> getPointNameIndexInfoByParam(@Param("analysisType") String analysisType, @Param("gatewayIds") List<String> gatewayIds);
List<IdxBizFanHealthLevel> getHealthLevelInfoList(); List<IdxBizFanHealthLevel> getHealthLevelInfoList(@Param("gatewayIds") List<String> gatewayIds);
List<String> getAddressInfo(); List<String> getAddressInfo();
......
...@@ -50,9 +50,10 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> { ...@@ -50,9 +50,10 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
"SELECT station, health_level as healthlevel,( CASE HEALTH_LEVEL WHEN '危险' THEN 4 WHEN '警告' THEN 3 WHEN '注意' THEN 2 ELSE 1 END ) AS sort, count( 1 ) AS `value` FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} AND ts >= TODAY()-8h" + "SELECT station, health_level as healthlevel,( CASE HEALTH_LEVEL WHEN '危险' THEN 4 WHEN '警告' THEN 3 WHEN '注意' THEN 2 ELSE 1 END ) AS sort, count( 1 ) AS `value` FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} AND ts >= TODAY()-8h" +
"<if test='area!= null'> AND area = #{area} </if> " + "<if test='area!= null'> AND area = #{area} </if> " +
"<if test='station!= null'>AND station = #{station} </if>" + "<if test='station!= null'>AND station = #{station} </if>" +
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>" +
" GROUP BY station,health_level order by sort"+ " GROUP BY station,health_level order by sort"+
"</script>") "</script>")
List<Map<String,Object>> selectEquipStatusByStation(@Param("area")String area,@Param("analysisObjType")String analysisObjType,@Param("station")String station); List<Map<String,Object>> selectEquipStatusByStation(@Param("area")String area,@Param("analysisObjType")String analysisObjType,@Param("station")String station, @Param("gatewayIds") List<String> gatewayIds);
List<Map<String, Object>> getHealthInfoByArea(); List<Map<String, Object>> getHealthInfoByArea();
......
...@@ -14,15 +14,15 @@ import java.util.Map; ...@@ -14,15 +14,15 @@ import java.util.Map;
public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> { public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> {
public List<Map<String,Object>> selectFanWarningNum(String station); public List<Map<String,Object>> selectFanWarningNum(String station, @Param("gatewayIds") List<String> gatewayIds);
public List<FanWarningRecord> warningData(String STATION,String EQUIPMENTNAME,String SUBSYSTEM); public List<FanWarningRecord> warningData(String STATION,String EQUIPMENTNAME,String SUBSYSTEM);
public List<FanWarningRecord> selectWarningPoint(String STATION,String EQUIPMENTNAME,Integer current,Integer size); public List<FanWarningRecord> selectWarningPoint(String STATION,String EQUIPMENTNAME,Integer current,Integer size, @Param("gatewayIds") List<String> gatewayIds);
public int selectWarningPointTotal(String STATION,String EQUIPMENTNAME); public int selectWarningPointTotal(String STATION,String EQUIPMENTNAME);
public Map<String,Object> selectEquipWarningTotal(String STATION,String EQUIPMENTNAME); public Map<String,Object> selectEquipWarningTotal(String STATION,String EQUIPMENTNAME, @Param("gatewayIds") List<String> gatewayIds);
int saveBatchWarningRecords(@Param("list") List<FanWarningRecord> list); int saveBatchWarningRecords(@Param("list") List<FanWarningRecord> list);
......
...@@ -52,16 +52,18 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> { ...@@ -52,16 +52,18 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" + "<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" +
"<if test='subarray!= null'>AND subarray = #{subarray} </if> " + "<if test='subarray!= null'>AND subarray = #{subarray} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" + "<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>" +
"</script>") "</script>")
int selectDataTotal(@Param("station")String station,@Param("analysisType")String analysisType,@Param("indexAddress")String indexAddress,@Param("healthLevel")String healthLevel,@Param("area")String area,@Param("analysisObjType")String analysisObjType, @Param("subarray")String subarray, @Param("pointName")String pointName,@Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop, @Param("equipmentName")String equipmentName); int selectDataTotal(@Param("station")String station,@Param("analysisType")String analysisType,@Param("indexAddress")String indexAddress,@Param("healthLevel")String healthLevel,@Param("area")String area,@Param("analysisObjType")String analysisObjType, @Param("subarray")String subarray, @Param("pointName")String pointName,@Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop, @Param("equipmentName")String equipmentName, @Param("gatewayIds") List<String> gatewayIds);
@Select("<script>"+ @Select("<script>"+
"SELECT station, health_level as healthlevel,( CASE HEALTH_LEVEL WHEN '危险' THEN 4 WHEN '警告' THEN 3 WHEN '注意' THEN 2 ELSE 1 END ) AS sort, count( 1 ) AS `value` FROM analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} AND ts >= TODAY()-8h" + "SELECT station, health_level as healthlevel,( CASE HEALTH_LEVEL WHEN '危险' THEN 4 WHEN '警告' THEN 3 WHEN '注意' THEN 2 ELSE 1 END ) AS sort, count( 1 ) AS `value` FROM analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} AND ts >= TODAY()-8h" +
"<if test='area!= null'> AND area = #{area} </if> " + "<if test='area!= null'> AND area = #{area} </if> " +
"<if test='station!= null'>AND station = #{station} </if>" + "<if test='station!= null'>AND station = #{station} </if>" +
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>" +
" GROUP BY station,health_level order by sort"+ " GROUP BY station,health_level order by sort"+
"</script>") "</script>")
List<Map<String,Object>> selectEquipStatusByStationPv(@Param("area")String area, @Param("analysisObjType")String analysisObjType, @Param("station")String station); List<Map<String,Object>> selectEquipStatusByStationPv(@Param("area")String area, @Param("analysisObjType")String analysisObjType, @Param("station")String station, @Param("gatewayIds") List<String> gatewayIds);
@Select("<script>"+ @Select("<script>"+
...@@ -69,8 +71,9 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> { ...@@ -69,8 +71,9 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
"<if test='station!= null'>AND station = #{station} </if>" + "<if test='station!= null'>AND station = #{station} </if>" +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" + "<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"<if test='subarray!= null'>AND subarray = #{subarray} </if>" + "<if test='subarray!= null'>AND subarray = #{subarray} </if>" +
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>" +
" GROUP BY station,health_level,equipment_name order by sort"+ " GROUP BY station,health_level,equipment_name order by sort"+
"</script>") "</script>")
List<Map<String,Object>> selectEquipStatusByEquipment(@Param("analysisObjType")String analysisObjType,@Param("station")String station,@Param("equipmentName")String equipmentName, @Param("subarray") String subarray); List<Map<String,Object>> selectEquipStatusByEquipment(@Param("analysisObjType")String analysisObjType,@Param("station")String station,@Param("equipmentName")String equipmentName, @Param("subarray") String subarray, @Param("gatewayIds") List<String> gatewayIds);
} }
...@@ -39,7 +39,8 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> { ...@@ -39,7 +39,8 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> {
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" + "<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" +
"<if test='subarray!= null'>AND subarray = #{subarray} </if> " + "<if test='subarray!= null'>AND subarray = #{subarray} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" + "<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>" +
"</script>") "</script>")
int selectDataTotal(@Param("healthLevel")String healthLevel, @Param("area")String area, @Param("equipmentName")String equipmentName, @Param("subarray")String subarray, @Param("analysisType")String analysisType, @Param("analysisObjType")String analysisObjType, @Param("station")String station, @Param("pointName")String pointName, @Param("indexAddress")String indexAddress, @Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop); int selectDataTotal(@Param("healthLevel")String healthLevel, @Param("area")String area, @Param("equipmentName")String equipmentName, @Param("subarray")String subarray, @Param("analysisType")String analysisType, @Param("analysisObjType")String analysisObjType, @Param("station")String station, @Param("pointName")String pointName, @Param("indexAddress")String indexAddress, @Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop, @Param("gatewayIds") List<String> gatewayIds);
} }
...@@ -40,7 +40,8 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen ...@@ -40,7 +40,8 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" + "<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" +
"<if test='subarray!= null'>AND subarray = #{subarray} </if> " + "<if test='subarray!= null'>AND subarray = #{subarray} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" + "<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>" +
"</script>") "</script>")
int selectDataTotal(@Param("healthLevel")String healthLevel, @Param("area")String area, @Param("equipmentName")String equipmentName, @Param("subarray")String subarray, @Param("analysisType")String analysisType, @Param("analysisObjType")String analysisObjType, @Param("station")String station, @Param("pointName")String pointName, @Param("indexAddress")String indexAddress, @Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop); int selectDataTotal(@Param("healthLevel")String healthLevel, @Param("area")String area, @Param("equipmentName")String equipmentName, @Param("subarray")String subarray, @Param("analysisType")String analysisType, @Param("analysisObjType")String analysisObjType, @Param("station")String station, @Param("pointName")String pointName, @Param("indexAddress")String indexAddress, @Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop, @Param("gatewayIds") List<String> gatewayIds);
} }
...@@ -15,12 +15,12 @@ public interface PvWaringRecordMapper extends BaseMapper<PvWarningRecord> { ...@@ -15,12 +15,12 @@ public interface PvWaringRecordMapper extends BaseMapper<PvWarningRecord> {
public List<PvWarningRecord> warningData(String STATION,String EQUIPMENTNAME,String SUBARRAY); public List<PvWarningRecord> warningData(String STATION,String EQUIPMENTNAME,String SUBARRAY);
public List<Map<String,Object>> selectFanWarningNum(String station); public List<Map<String,Object>> selectFanWarningNum(String station, @Param("gatewayIds") List<String> gatewayIds);
List<PvWarningRecord> selectWarningPoint(String STATION, String EQUIPMENTNAME, String SUBARRAY,Integer current,Integer size); List<PvWarningRecord> selectWarningPoint(String STATION, String EQUIPMENTNAME, String SUBARRAY,Integer current,Integer size, @Param("gatewayIds") List<String> gatewayIds);
int selectWarningPointTotal(String STATION, String EQUIPMENTNAME, String SUBARRAY); int selectWarningPointTotal(String STATION, String EQUIPMENTNAME, String SUBARRAY, @Param("gatewayIds") List<String> gatewayIds);
Map<String, Object> selectEquipWarningTotal(String STATION, String EQUIPMENTNAME, String SUBARRAY); Map<String, Object> selectEquipWarningTotal(String STATION, String EQUIPMENTNAME, String SUBARRAY, @Param("gatewayIds") List<String> gatewayIds);
List<PvWarningRecord> getInfoByPage(@Param("dto") FanHealthIndexDto dto); List<PvWarningRecord> getInfoByPage(@Param("dto") FanHealthIndexDto dto);
......
...@@ -871,6 +871,11 @@ ...@@ -871,6 +871,11 @@
FROM idx_biz_fan_health_level FROM idx_biz_fan_health_level
WHERE STATUS IS NOT NULL WHERE STATUS IS NOT NULL
OR STATUS != '' OR STATUS != ''
<if test="gatewayIds != null and gatewayIds.size() > 0"> and GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
UNION ALL UNION ALL
SELECT CONCAT(`STATUS`, '_', ANALYSIS_OBJ_TYPE) AS analysisObjType, SELECT CONCAT(`STATUS`, '_', ANALYSIS_OBJ_TYPE) AS analysisObjType,
HEALTH_LEVEL AS healthLevel, HEALTH_LEVEL AS healthLevel,
...@@ -879,6 +884,11 @@ ...@@ -879,6 +884,11 @@
FROM idx_biz_pv_health_level FROM idx_biz_pv_health_level
WHERE STATUS IS NOT NULL WHERE STATUS IS NOT NULL
OR STATUS != '' OR STATUS != ''
<if test="gatewayIds != null and gatewayIds.size() > 0"> and GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select> </select>
<select id="getAddressInfo" resultType="java.lang.String"> <select id="getAddressInfo" resultType="java.lang.String">
select index_address select index_address
...@@ -1333,6 +1343,11 @@ ...@@ -1333,6 +1343,11 @@
AND ANALYSIS_TYPE = '按时刻' AND ANALYSIS_TYPE = '按时刻'
AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE )
</if> </if>
<if test="gatewayIds != null and gatewayIds.size() > 0"> and GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where> </where>
GROUP BY STATION GROUP BY STATION
UNION ALL UNION ALL
...@@ -1354,6 +1369,11 @@ ...@@ -1354,6 +1369,11 @@
AND ANALYSIS_TYPE = '按时刻' AND ANALYSIS_TYPE = '按时刻'
AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE )
</if> </if>
<if test="gatewayIds != null and gatewayIds.size() > 0"> and GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where> </where>
GROUP BY STATION GROUP BY STATION
) )
...@@ -1381,6 +1401,11 @@ ...@@ -1381,6 +1401,11 @@
AND ANALYSIS_TYPE = '按时刻' AND ANALYSIS_TYPE = '按时刻'
AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE )
</if> </if>
<if test="gatewayIds != null and gatewayIds.size() > 0"> and GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where> </where>
GROUP BY EQUIPMENT_NAME GROUP BY EQUIPMENT_NAME
UNION ALL UNION ALL
...@@ -1402,6 +1427,11 @@ ...@@ -1402,6 +1427,11 @@
AND ANALYSIS_TYPE = '按时刻' AND ANALYSIS_TYPE = '按时刻'
AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE )
</if> </if>
<if test="gatewayIds != null and gatewayIds.size() > 0"> and GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where> </where>
GROUP BY SUBARRAY GROUP BY SUBARRAY
) )
...@@ -1432,6 +1462,11 @@ ...@@ -1432,6 +1462,11 @@
AND ANALYSIS_TYPE = '按时刻' AND ANALYSIS_TYPE = '按时刻'
AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE )
</if> </if>
<if test="gatewayIds != null and gatewayIds.size() > 0"> and GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where> </where>
GROUP BY SUB_SYSTEM GROUP BY SUB_SYSTEM
UNION ALL UNION ALL
...@@ -1453,6 +1488,11 @@ ...@@ -1453,6 +1488,11 @@
AND ANALYSIS_TYPE = '按时刻' AND ANALYSIS_TYPE = '按时刻'
AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE )
</if> </if>
<if test="gatewayIds != null and gatewayIds.size() > 0"> and GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where> </where>
GROUP BY EQUIPMENT_NAME GROUP BY EQUIPMENT_NAME
) )
...@@ -1481,6 +1521,11 @@ ...@@ -1481,6 +1521,11 @@
AND ANALYSIS_TYPE = '按时刻' AND ANALYSIS_TYPE = '按时刻'
AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE )
</if> </if>
<if test="gatewayIds != null and gatewayIds.size() > 0"> and GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where> </where>
GROUP BY INDEX_ADDRESS GROUP BY INDEX_ADDRESS
UNION ALL UNION ALL
...@@ -1502,6 +1547,11 @@ ...@@ -1502,6 +1547,11 @@
AND ANALYSIS_TYPE = '按时刻' AND ANALYSIS_TYPE = '按时刻'
AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE )
</if> </if>
<if test="gatewayIds != null and gatewayIds.size() > 0"> and GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where> </where>
GROUP BY INDEX_ADDRESS GROUP BY INDEX_ADDRESS
) )
......
...@@ -81,6 +81,11 @@ ...@@ -81,6 +81,11 @@
<if test="station != null"> <if test="station != null">
and station = #{station} and station = #{station}
</if> </if>
<if test="gatewayIds != null and gatewayIds.size() > 0"> and GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
group by `station`, group by `station`,
`equipment_name`, `equipment_name`,
`warning_name`) a `warning_name`) a
...@@ -129,6 +134,11 @@ ...@@ -129,6 +134,11 @@
<if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null"> <if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null">
AND a.equipment_name = #{EQUIPMENTNAME} AND a.equipment_name = #{EQUIPMENTNAME}
</if> </if>
<if test="gatewayIds != null and gatewayIds.size() > 0"> AND GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
group by group by
station, station,
equipment_name, equipment_name,
...@@ -198,6 +208,11 @@ ...@@ -198,6 +208,11 @@
<if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null"> <if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null">
AND z.equipment_name = #{EQUIPMENTNAME} AND z.equipment_name = #{EQUIPMENTNAME}
</if> </if>
<if test="gatewayIds != null and gatewayIds.size() > 0"> and GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
group by group by
`z`.`station`, `z`.`station`,
`z`.`warning_name`, `z`.`warning_name`,
......
...@@ -105,6 +105,11 @@ ...@@ -105,6 +105,11 @@
<if test="station != null"> <if test="station != null">
and station = #{station} and station = #{station}
</if> </if>
<if test="gatewayIds != null and gatewayIds.size() > 0"> and GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
group by group by
re.station, re.station,
re.subarray, re.subarray,
...@@ -140,6 +145,11 @@ ...@@ -140,6 +145,11 @@
<if test="SUBARRAY != '' and SUBARRAY != null"> <if test="SUBARRAY != '' and SUBARRAY != null">
AND a.subarray = #{SUBARRAY} AND a.subarray = #{SUBARRAY}
</if> </if>
<if test="gatewayIds != null and gatewayIds.size() > 0"> AND GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
group by group by
station, station,
equipment_name, equipment_name,
...@@ -173,6 +183,11 @@ ...@@ -173,6 +183,11 @@
<if test="SUBARRAY != '' and SUBARRAY != null"> <if test="SUBARRAY != '' and SUBARRAY != null">
AND a.subarray = #{SUBARRAY} AND a.subarray = #{SUBARRAY}
</if> </if>
<if test="gatewayIds != null and gatewayIds.size() > 0"> AND GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
group by group by
station, station,
equipment_name, equipment_name,
...@@ -216,6 +231,11 @@ ...@@ -216,6 +231,11 @@
<if test="SUBARRAY != '' and SUBARRAY != null"> <if test="SUBARRAY != '' and SUBARRAY != null">
AND z.subarray = #{SUBARRAY} AND z.subarray = #{SUBARRAY}
</if> </if>
<if test="gatewayIds != null and gatewayIds.size() > 0"> AND GATEWAY_ID in
<foreach item="item" index="index" collection="gatewayIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
group by group by
`z`.`station`, `z`.`station`,
`z`.`warning_name`, `z`.`warning_name`,
......
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