Commit 349f7f50 authored by wujiang's avatar wujiang

Merge branch 'developer' of http://36.40.66.175:5000/moa/jxdj_zx/amos-boot-zx-biz into developer

parents ff4f9183 46b39d15
...@@ -436,9 +436,9 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -436,9 +436,9 @@ public class BigScreenAnalyseController extends BaseController {
@GetMapping("/getFanInfoByPage") @GetMapping("/getFanInfoByPage")
public ResponseModel<Page<Map<String, Object>>> getFanInfoByPage(@RequestParam(value = "stationId", required = false) String stationId) { public ResponseModel<Page<Map<String, Object>>> getFanInfoByPage(@RequestParam(value = "stationId", required = false) String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper.getFanInfoByPage(stationBasic.getFanGatewayId()); List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper.getFanInfoByPage(stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
List<Map<String, Object>> healthInfoList = idxBizFanHealthIndexMapper.getFanHealthInfoList(stationBasic.getFanGatewayId()); List<Map<String, Object>> healthInfoList = idxBizFanHealthIndexMapper.getFanHealthInfoList(stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
Map<Object, Double> equipmentHealthIndexMap = healthInfoList.stream().collect(Collectors.toMap(t -> t.get("equipmentName"), t -> Double.parseDouble(t.get("avgHealthIndex").toString()))); Map<Object, Double> equipmentHealthIndexMap = healthInfoList.stream().collect(Collectors.toMap(t -> t.get("equipmentName"), t -> Double.parseDouble(t.get("avgHealthIndex").toString())));
equipmentList.forEach(item -> { equipmentList.forEach(item -> {
...@@ -488,13 +488,13 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -488,13 +488,13 @@ public class BigScreenAnalyseController extends BaseController {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getSubSystemInfo(equipmentName, stationBasic.getFanGatewayId()); List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getSubSystemInfo(equipmentName, stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
Map<Object, Integer> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("subSystem"), t -> Integer.valueOf(t.get("healthIndex").toString().replace(".0", "")))); Map<Object, Integer> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("subSystem"), t -> Integer.valueOf(t.get("healthIndex").toString().replace(".0", ""))));
List<Object> seriesData = new ArrayList<>(); List<Object> seriesData = new ArrayList<>();
List<Object> axisData = new ArrayList<>(); List<Object> axisData = new ArrayList<>();
List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper.getSumSystemListByEquipment(stationBasic.getFanGatewayId(), equipmentName); List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper.getSumSystemListByEquipment(stationBasic.getFanGatewayId(), equipmentName,stationBasic.getBoosterGatewayId());
equipmentList.forEach(item -> { equipmentList.forEach(item -> {
Integer equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("subSystem"), 100); Integer equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("subSystem"), 100);
seriesData.add(equipmentHealthScore); seriesData.add(equipmentHealthScore);
...@@ -524,7 +524,7 @@ private FanHealthIndexMapper fanHealthIndexMapper; ...@@ -524,7 +524,7 @@ private FanHealthIndexMapper fanHealthIndexMapper;
Map<Object, String> equipmentHealthIndexMap = healthListInfo.stream() Map<Object, String> equipmentHealthIndexMap = healthListInfo.stream()
.collect(Collectors.toMap(t -> t.get("pointname"), t -> t.get("warningname").toString())); .collect(Collectors.toMap(t -> t.get("pointname"), t -> t.get("warningname").toString()));
List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper
.getPointNameListBySumSystem(stationBasic.getFanGatewayId(), subSystem, equipmentName); .getPointNameListBySumSystem(stationBasic.getFanGatewayId(), subSystem, equipmentName,stationBasic.getBoosterGatewayId());
pointNameList.forEach(item -> { pointNameList.forEach(item -> {
String warningName = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), "安全"); String warningName = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), "安全");
int sort = 4; int sort = 4;
...@@ -557,9 +557,9 @@ private FanHealthIndexMapper fanHealthIndexMapper; ...@@ -557,9 +557,9 @@ private FanHealthIndexMapper fanHealthIndexMapper;
@GetMapping("/getPvInfoByPage") @GetMapping("/getPvInfoByPage")
public ResponseModel<Page<Map<String, Object>>> getPvInfoByPage(@RequestParam(value = "stationId", required = false) String stationId) { public ResponseModel<Page<Map<String, Object>>> getPvInfoByPage(@RequestParam(value = "stationId", required = false) String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper.getPvInfoByPage(stationBasic.getFanGatewayId()); List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper.getPvInfoByPage(stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
List<Map<String, Object>> healthInfoList = idxBizFanHealthIndexMapper.getPvHealthInfoList(stationBasic.getFanGatewayId()); List<Map<String, Object>> healthInfoList = idxBizFanHealthIndexMapper.getPvHealthInfoList(stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
Map<Object, Double> equipmentHealthIndexMap = healthInfoList.stream().collect(Collectors.toMap(t -> t.get("subarray"), t -> Double.parseDouble(t.get("avgHealthIndex").toString()))); Map<Object, Double> equipmentHealthIndexMap = healthInfoList.stream().collect(Collectors.toMap(t -> t.get("subarray"), t -> Double.parseDouble(t.get("avgHealthIndex").toString())));
equipmentList.forEach(item -> { equipmentList.forEach(item -> {
...@@ -599,13 +599,13 @@ private FanHealthIndexMapper fanHealthIndexMapper; ...@@ -599,13 +599,13 @@ private FanHealthIndexMapper fanHealthIndexMapper;
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvSubSystemInfo(subarray, stationBasic.getFanGatewayId()); List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvSubSystemInfo(subarray, stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
Map<Object, Object> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("equipmentName"), t -> t.get("avgHealthIndex").toString().replace(".0", ""))); Map<Object, Object> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("equipmentName"), t -> t.get("avgHealthIndex").toString().replace(".0", "")));
List<Object> seriesData = new ArrayList<>(); List<Object> seriesData = new ArrayList<>();
List<Object> axisData = new ArrayList<>(); List<Object> axisData = new ArrayList<>();
List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper.getPvSumSystemListByEquipment(stationBasic.getFanGatewayId(), subarray); List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper.getPvSumSystemListByEquipment(stationBasic.getFanGatewayId(), subarray,stationBasic.getBoosterGatewayId());
equipmentList.forEach(item -> { equipmentList.forEach(item -> {
Object equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("equipmentName"), 100); Object equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("equipmentName"), 100);
seriesData.add(equipmentHealthScore); seriesData.add(equipmentHealthScore);
...@@ -623,11 +623,11 @@ private FanHealthIndexMapper fanHealthIndexMapper; ...@@ -623,11 +623,11 @@ private FanHealthIndexMapper fanHealthIndexMapper;
@RequestParam(value = "stationId", required = false) String stationId) { @RequestParam(value = "stationId", required = false) String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvHealthInfoBySubSystem(equipmentName, stationBasic.getFanGatewayId()); List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvHealthInfoBySubSystem(equipmentName, stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
Map<Object, Double> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("pointName"), t -> Double.parseDouble(t.get("healthIndex").toString()))); Map<Object, Double> equipmentHealthIndexMap = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("pointName"), t -> Double.parseDouble(t.get("healthIndex").toString())));
List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper.getPvPointNameListBySumSystem(stationBasic.getFanGatewayId(), equipmentName); List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper.getPvPointNameListBySumSystem(stationBasic.getFanGatewayId(), equipmentName,stationBasic.getBoosterGatewayId());
pointNameList.forEach(item -> { pointNameList.forEach(item -> {
Double equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), 100.0); Double equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), 100.0);
...@@ -724,9 +724,9 @@ private FanHealthIndexDayMapper fanHealthIndexDayMapper; ...@@ -724,9 +724,9 @@ private FanHealthIndexDayMapper fanHealthIndexDayMapper;
@RequestParam(value = "stationId", required = true) String stationId, @RequestParam(value = "stationId", required = true) String stationId,
@RequestParam(value = "tableName2", required = false) String tableName2) { @RequestParam(value = "tableName2", required = false) String tableName2) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String nameByIndexAddress = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(indexAddress, tableName, stationBasic.getFanGatewayId()); String nameByIndexAddress = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(indexAddress, tableName, stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
int num = idxBizFanHealthIndexMapper.getIsWarningByPointId(indexAddress, stationBasic.getFanGatewayId(), tableName2); int num = idxBizFanHealthIndexMapper.getIsWarningByPointId(indexAddress, stationBasic.getFanGatewayId(), tableName2,stationBasic.getBoosterGatewayId());
HashMap<String, Object> resultMap = new HashMap<>(); HashMap<String, Object> resultMap = new HashMap<>();
resultMap.put("text", nameByIndexAddress); resultMap.put("text", nameByIndexAddress);
...@@ -742,7 +742,7 @@ private FanHealthIndexDayMapper fanHealthIndexDayMapper; ...@@ -742,7 +742,7 @@ private FanHealthIndexDayMapper fanHealthIndexDayMapper;
@RequestParam(value = "stationId") String stationId) { @RequestParam(value = "stationId") String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
varDesc = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(varDesc, tableName, stationBasic.getFanGatewayId()); varDesc = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(varDesc, tableName, stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
FeignClientResult<List<String>> sevenEntityMcb = null; FeignClientResult<List<String>> sevenEntityMcb = null;
try { try {
sevenEntityMcb = riskWarningFeign.getRiskHandleByVarDesc(varDesc); sevenEntityMcb = riskWarningFeign.getRiskHandleByVarDesc(varDesc);
......
package com.yeejoin.amos.boot.module.jxiop.biz.controller; package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jxiop.biz.Enum.HealthLevelSortEnum; import com.yeejoin.amos.boot.module.jxiop.biz.Enum.HealthLevelSortEnum;
import com.yeejoin.amos.boot.module.jxiop.biz.Enum.WarningPeriodEnum; import com.yeejoin.amos.boot.module.jxiop.biz.Enum.WarningPeriodEnum;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanHealthIndexDto; import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanHealthIndexDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanPointTag;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvPointTag;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanPointTagMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanPointTagMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvPointTagMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvPointTagMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.IPermissionService; import com.yeejoin.amos.boot.module.jxiop.biz.service.IPermissionService;
...@@ -24,14 +19,10 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexDayMapper; ...@@ -24,14 +19,10 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexDayMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexHourMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexHourMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexMomentMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexMomentMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndexDay; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.*;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndexHour;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndexMoment;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -43,11 +34,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -43,11 +34,8 @@ 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 javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.POST;
import java.sql.Timestamp;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
...@@ -55,8 +43,6 @@ import java.util.*; ...@@ -55,8 +43,6 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
*
*
* @author system_generator * @author system_generator
* @date 2023-08-15 * @date 2023-08-15
*/ */
...@@ -65,9 +51,9 @@ import java.util.stream.Collectors; ...@@ -65,9 +51,9 @@ import java.util.stream.Collectors;
@RequestMapping(value = "/idx-biz-fan-health-index") @RequestMapping(value = "/idx-biz-fan-health-index")
public class IdxBizFanHealthIndexController extends BaseController { public class IdxBizFanHealthIndexController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(IdxBizFanHealthIndexController.class); private static final Logger logger = LoggerFactory.getLogger(IdxBizFanHealthIndexController.class);
@Autowired @Autowired
IdxBizFanHealthIndexServiceImpl idxBizFanHealthIndexServiceImpl; IdxBizFanHealthIndexServiceImpl idxBizFanHealthIndexServiceImpl;
@Autowired @Autowired
...@@ -75,46 +61,47 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -75,46 +61,47 @@ public class IdxBizFanHealthIndexController extends BaseController {
@Autowired @Autowired
IdxBizPvPointTagMapper idxBizPvPointTagMapper; IdxBizPvPointTagMapper idxBizPvPointTagMapper;
@Autowired @Autowired
FanHealthIndexDayMapper fanHealthIndexDayMapper; FanHealthIndexDayMapper fanHealthIndexDayMapper;
@Autowired
FanHealthIndexHourMapper fanHealthIndexHourMapper;
@Autowired @Autowired
FanHealthIndexHourMapper fanHealthIndexHourMapper; FanHealthIndexMomentMapper fanHealthIndexMomentMapper;
@Autowired @Autowired
FanHealthIndexMomentMapper fanHealthIndexMomentMapper; FanWaringRecordMapper fanWarningRecord;
@Autowired @Autowired
FanWaringRecordMapper fanWarningRecord; IPermissionService permissionService;
@Autowired
IPermissionService permissionService;
public final DecimalFormat df = new DecimalFormat("#.0"); public final DecimalFormat df = new DecimalFormat("#.0");
public final DecimalFormat dfSS = new DecimalFormat("#.00"); public final DecimalFormat dfSS = new DecimalFormat("#.00");
/** /**
* 新增 * 新增
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增") @ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<IdxBizFanHealthIndexDto> save(@RequestBody IdxBizFanHealthIndexDto model) { public ResponseModel<IdxBizFanHealthIndexDto> save(@RequestBody IdxBizFanHealthIndexDto model) {
model = idxBizFanHealthIndexServiceImpl.createWithModel(model); model = idxBizFanHealthIndexServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
} }
/** /**
* 根据sequenceNbr更新 * 根据sequenceNbr更新
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}") @PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<IdxBizFanHealthIndexDto> updateBySequenceNbrIdxBizFanHealthIndex(@RequestBody IdxBizFanHealthIndexDto model,@PathVariable(value = "sequenceNbr") String sequenceNbr) { public ResponseModel<IdxBizFanHealthIndexDto> updateBySequenceNbrIdxBizFanHealthIndex(@RequestBody IdxBizFanHealthIndexDto model, @PathVariable(value = "sequenceNbr") String sequenceNbr) {
model.setSequenceNbr(sequenceNbr); model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.updateWithModel(model)); return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.updateWithModel(model));
} }
/** /**
* 根据sequenceNbr删除 * 根据sequenceNbr删除
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
...@@ -123,494 +110,527 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -123,494 +110,527 @@ public class IdxBizFanHealthIndexController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}") @DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除", notes = "根据sequenceNbr删除") @ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除", notes = "根据sequenceNbr删除")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){ public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.removeById(sequenceNbr)); return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.removeById(sequenceNbr));
} }
/** /**
* 根据sequenceNbr查询 * 根据sequenceNbr查询
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个") @ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<IdxBizFanHealthIndexDto> selectOne(@PathVariable Long sequenceNbr) { public ResponseModel<IdxBizFanHealthIndexDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.queryBySeq(sequenceNbr)); return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.queryBySeq(sequenceNbr));
} }
/** /**
* 列表分页查询 * 列表分页查询
* *
* @param current 当前页 * @param current 当前页
* @param current 每页大小 * @param current 每页大小
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询") @ApiOperation(httpMethod = "GET", value = "分页查询", notes = "分页查询")
public ResponseModel<Page<IdxBizFanHealthIndexDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam public ResponseModel<Page<IdxBizFanHealthIndexDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) { (value = "size") int size) {
Page<IdxBizFanHealthIndexDto> page = new Page<IdxBizFanHealthIndexDto>(); Page<IdxBizFanHealthIndexDto> page = new Page<IdxBizFanHealthIndexDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.queryForIdxBizFanHealthIndexPage(page)); return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.queryForIdxBizFanHealthIndexPage(page));
} }
/** /**
* 列表全部数据查询 * 列表全部数据查询
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "列表全部数据查询", notes = "列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public ResponseModel<List<IdxBizFanHealthIndexDto>> selectForList() { public ResponseModel<List<IdxBizFanHealthIndexDto>> selectForList() {
return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.queryForIdxBizFanHealthIndexList()); return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.queryForIdxBizFanHealthIndexList());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测风机层左侧列表", notes = "预警监测风机层左侧列表") @ApiOperation(httpMethod = "GET", value = "预警监测风机层左侧列表", notes = "预警监测风机层左侧列表")
@GetMapping(value = "/tableLeftList") @GetMapping(value = "/tableLeftList")
public ResponseModel<Page<Map<String,Object>>> queryForLeftTableList(@RequestParam(required = false) String STATION, @RequestParam(required = false)String HEALTHLEVEL,@RequestParam(required = false) String EQUIPMENTNAME,Integer current,Integer size) { public ResponseModel<Page<Map<String, Object>>> queryForLeftTableList(@RequestParam(required = false) String STATION, @RequestParam(required = false) String HEALTHLEVEL, @RequestParam(required = false) String EQUIPMENTNAME, Integer current, Integer size) {
Page<Map<String,Object>> page = new Page<Map<String,Object>>(); Page<Map<String, Object>> page = new Page<Map<String, Object>>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
int total = idxBizFanHealthIndexServiceImpl.queryForLeftTableListCount(STATION, HEALTHLEVEL, EQUIPMENTNAME); int total = idxBizFanHealthIndexServiceImpl.queryForLeftTableListCount(STATION, HEALTHLEVEL, EQUIPMENTNAME);
page.setTotal(Long.valueOf(total)); page.setTotal(Long.valueOf(total));
page.setRecords(idxBizFanHealthIndexServiceImpl.queryForLeftTableList(STATION,HEALTHLEVEL,EQUIPMENTNAME,(current-1)*size,size)); page.setRecords(idxBizFanHealthIndexServiceImpl.queryForLeftTableList(STATION, HEALTHLEVEL, EQUIPMENTNAME, (current - 1) * size, size));
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测风机层仪表盘", notes = "预警监测风机层仪表盘") @ApiOperation(httpMethod = "GET", value = "预警监测风机层仪表盘", notes = "预警监测风机层仪表盘")
@GetMapping(value = "/queryForLeftTableListNum") @GetMapping(value = "/queryForLeftTableListNum")
public ResponseModel<Map<String,Object>> queryForLeftTableListNum(@RequestParam(required = false)String STATION, @RequestParam(required = false)String HEALTHLEVEL,@RequestParam(required = false)String EQUIPMENTNAME) { public ResponseModel<Map<String, Object>> queryForLeftTableListNum(@RequestParam(required = false) String STATION, @RequestParam(required = false) String HEALTHLEVEL, @RequestParam(required = false) String EQUIPMENTNAME) {
return ResponseHelper.buildResponse( idxBizFanHealthIndexServiceImpl.queryForLeftTableListNum(STATION, HEALTHLEVEL, EQUIPMENTNAME)); return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.queryForLeftTableListNum(STATION, HEALTHLEVEL, EQUIPMENTNAME));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测测点层左侧列表", notes = "预警监测风机层左侧列表") @ApiOperation(httpMethod = "GET", value = "预警监测测点层左侧列表", notes = "预警监测风机层左侧列表")
@GetMapping(value = "/tableLeftByPointList") @GetMapping(value = "/tableLeftByPointList")
public ResponseModel<Page<Map<String,Object>>> queryForLeftTableByPointList(@RequestParam(required = false) String STATION, @RequestParam(required = false)String HEALTHLEVEL,@RequestParam(required = false) String EQUIPMENTNAME,@RequestParam(required = false)String POINTNAME,Integer current,Integer size) { public ResponseModel<Page<Map<String, Object>>> queryForLeftTableByPointList(@RequestParam(required = false) String STATION, @RequestParam(required = false) String HEALTHLEVEL, @RequestParam(required = false) String EQUIPMENTNAME, @RequestParam(required = false) String POINTNAME, Integer current, Integer size) {
Page<Map<String,Object>> page = new Page<Map<String,Object>>(); Page<Map<String, Object>> page = new Page<Map<String, Object>>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
int total = idxBizFanHealthIndexServiceImpl.queryForLeftTableListByPointCount(STATION, HEALTHLEVEL, EQUIPMENTNAME,POINTNAME); int total = idxBizFanHealthIndexServiceImpl.queryForLeftTableListByPointCount(STATION, HEALTHLEVEL, EQUIPMENTNAME, POINTNAME);
page.setTotal(Long.valueOf(total)); page.setTotal(Long.valueOf(total));
page.setRecords(idxBizFanHealthIndexServiceImpl.queryForLeftTableListByPoint(STATION,HEALTHLEVEL,EQUIPMENTNAME,POINTNAME,(current-1)*size,size)); page.setRecords(idxBizFanHealthIndexServiceImpl.queryForLeftTableListByPoint(STATION, HEALTHLEVEL, EQUIPMENTNAME, POINTNAME, (current - 1) * size, size));
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测测点层仪表盘", notes = "预警监测风机层仪表盘") @ApiOperation(httpMethod = "GET", value = "预警监测测点层仪表盘", notes = "预警监测风机层仪表盘")
@GetMapping(value = "/queryForLeftTableListByPointNum") @GetMapping(value = "/queryForLeftTableListByPointNum")
public ResponseModel<Map<String,Object>> queryForLeftTableListByPointNum(@RequestParam(required = false)String STATION, @RequestParam(required = false)String HEALTHLEVEL,@RequestParam(required = false)String EQUIPMENTNAME,@RequestParam(required = false)String POINTNAME) { public ResponseModel<Map<String, Object>> queryForLeftTableListByPointNum(@RequestParam(required = false) String STATION, @RequestParam(required = false) String HEALTHLEVEL, @RequestParam(required = false) String EQUIPMENTNAME, @RequestParam(required = false) String POINTNAME) {
return ResponseHelper.buildResponse( idxBizFanHealthIndexServiceImpl.queryForLeftTableListByPointNum(STATION, HEALTHLEVEL, EQUIPMENTNAME,POINTNAME)); return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.queryForLeftTableListByPointNum(STATION, HEALTHLEVEL, EQUIPMENTNAME, POINTNAME));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测设备级统计", notes = "预警监测设备级统计") @ApiOperation(httpMethod = "GET", value = "预警监测设备级统计", notes = "预警监测设备级统计")
@GetMapping(value = "/queryForPointNum") @GetMapping(value = "/queryForPointNum")
public ResponseModel<List<Map<String,Object>>> queryForLeftTableListByPointNum(@RequestParam(required = false) String STATION,@RequestParam(required = false) String SUBARRAY,@RequestParam(required = false) String EQUIPMENTNAME) { public ResponseModel<List<Map<String, Object>>> queryForLeftTableListByPointNum(@RequestParam(required = false) String STATION, @RequestParam(required = false) String SUBARRAY, @RequestParam(required = false) String EQUIPMENTNAME) {
List<IdxBizFanWarningRecord> idxBizPvWarningRecordList = idxBizFanHealthIndexServiceImpl.warningData(STATION, SUBARRAY, EQUIPMENTNAME); List<IdxBizFanWarningRecord> idxBizPvWarningRecordList = idxBizFanHealthIndexServiceImpl.warningData(STATION, SUBARRAY, EQUIPMENTNAME);
int total = idxBizFanHealthIndexServiceImpl.pointNum(STATION, SUBARRAY, EQUIPMENTNAME); int total = idxBizFanHealthIndexServiceImpl.pointNum(STATION, SUBARRAY, EQUIPMENTNAME);
Map<String,Object> map =new HashMap<>(); Map<String, Object> map = new HashMap<>();
Map<String,Object> map1 =new HashMap<>(); Map<String, Object> map1 = new HashMap<>();
Map<String,Object> warningNum =new HashMap<>(); Map<String, Object> warningNum = new HashMap<>();
Map<String,Object> pointNum =new HashMap<>(); Map<String, Object> pointNum = new HashMap<>();
map1.put("name","危险"); map1.put("name", "危险");
map1.put("value",idxBizPvWarningRecordList.stream().filter(e->e.getWarningName().equals("危险")).count()); map1.put("value", idxBizPvWarningRecordList.stream().filter(e -> e.getWarningName().equals("危险")).count());
map.put("name","警告"); map.put("name", "警告");
map.put("value",idxBizPvWarningRecordList.stream().filter(e->e.getWarningName().equals("警告")).count()); map.put("value", idxBizPvWarningRecordList.stream().filter(e -> e.getWarningName().equals("警告")).count());
warningNum.put("name","注意"); warningNum.put("name", "注意");
warningNum.put("value",idxBizPvWarningRecordList.stream().filter(e->e.getWarningName().equals("注意")).count()); warningNum.put("value", idxBizPvWarningRecordList.stream().filter(e -> e.getWarningName().equals("注意")).count());
pointNum.put("name","安全"); pointNum.put("name", "安全");
pointNum.put("value",total - idxBizPvWarningRecordList.size()); pointNum.put("value", total - idxBizPvWarningRecordList.size());
List<Map<String,Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<>();
list.add(pointNum); list.add(pointNum);
list.add(warningNum); list.add(warningNum);
list.add(map); list.add(map);
list.add(map1); list.add(map1);
return ResponseHelper.buildResponse(list); return ResponseHelper.buildResponse(list);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "测点运行趋势图", notes = "测点运行趋势图") @ApiOperation(httpMethod = "GET", value = "测点运行趋势图", notes = "测点运行趋势图")
@GetMapping(value = "/getqyt") @GetMapping(value = "/getqyt")
public ResponseModel<Object> getqyt( public ResponseModel<Object> getqyt(
String type, String type,
String address, String address,
String statioName, String statioName,
String equipmentName, String equipmentName,
String arae, String arae,
@RequestParam(value = "startTime", required = false) String startTime, @RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime @RequestParam(value = "endTime", required = false) String endTime
) { ) {
if(StringUtils.isEmpty(address) || StringUtils.isEmpty(statioName) || StringUtils.isEmpty(equipmentName) || StringUtils.isEmpty(arae)){ if (StringUtils.isEmpty(address) || StringUtils.isEmpty(statioName) || StringUtils.isEmpty(equipmentName) || StringUtils.isEmpty(arae)) {
throw new RuntimeException("片区,场站,设备名称,子系统,分析变量不能为空"); throw new RuntimeException("片区,场站,设备名称,子系统,分析变量不能为空");
} }
List<String> gatewayIds = this.getGatewayIds(); List<String> gatewayIds = this.getGatewayIds();
return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.getqyt( type,address,statioName,equipmentName,arae,startTime,endTime,gatewayIds)); return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.getqyt(type, address, statioName, equipmentName, arae, startTime, endTime, gatewayIds));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "工况字典详情", notes = "工况字典详情") @ApiOperation(httpMethod = "GET", value = "工况字典详情", notes = "工况字典详情")
@GetMapping(value = "/getZDXQ") @GetMapping(value = "/getZDXQ")
public ResponseModel<Object> getZDXQ( public ResponseModel<Object> getZDXQ(
String type, String type,
String id String id
) { ) {
Object object=null; Object object = null;
if(type.equals("1")){ if (type.equals("1")) {
object= idxBizPvPointTagMapper.selectById(id); object = idxBizPvPointTagMapper.selectById(id);
}else{ } else {
object= idxBizFanPointTagMapper.selectById(id); object = idxBizFanPointTagMapper.selectById(id);
} }
return ResponseHelper.buildResponse(object); return ResponseHelper.buildResponse(object);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "工况字典修改", notes = "工况字典修改") @ApiOperation(httpMethod = "GET", value = "工况字典修改", notes = "工况字典修改")
@PostMapping (value = "/updateZDXQ") @PostMapping(value = "/updateZDXQ")
public ResponseModel<Object> updateZDXQ( public ResponseModel<Object> updateZDXQ(
String type, String type,
String id, String id,
String pointDirection, String pointDirection,
String tagCode String tagCode
) { ) {
idxBizFanHealthIndexServiceImpl.updatezd( type,id, pointDirection,tagCode); idxBizFanHealthIndexServiceImpl.updatezd(type, id, pointDirection, tagCode);
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测测点层左侧列表", notes = "预警监测风机层左侧列表") @ApiOperation(httpMethod = "GET", value = "预警监测测点层左侧列表", notes = "预警监测风机层左侧列表")
@GetMapping(value = "/selectPointByANALYSISTYPE") @GetMapping(value = "/selectPointByANALYSISTYPE")
public ResponseModel<Map<String,Object>> selectPointByANALYSISTYPE(@RequestParam(required = false) String STATION, @RequestParam(required = false)String HEALTHLEVEL,@RequestParam(required = false) String EQUIPMENTNAME,@RequestParam(required = false)String POINTNAME,@RequestParam(required = false)String startTime,@RequestParam(required = false) String endTime) { public ResponseModel<Map<String, Object>> selectPointByANALYSISTYPE(@RequestParam(required = false) String STATION, @RequestParam(required = false) String HEALTHLEVEL, @RequestParam(required = false) String EQUIPMENTNAME, @RequestParam(required = false) String POINTNAME, @RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) {
List<Map<String, Object>> maps = idxBizFanHealthIndexServiceImpl.selectPointByANALYSISTYPE(STATION, HEALTHLEVEL, EQUIPMENTNAME, POINTNAME,startTime,endTime); List<Map<String, Object>> maps = idxBizFanHealthIndexServiceImpl.selectPointByANALYSISTYPE(STATION, HEALTHLEVEL, EQUIPMENTNAME, POINTNAME, startTime, endTime);
Map<String,Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
List<Object> seriesData = new ArrayList<>(); List<Object> seriesData = new ArrayList<>();
List<Object> axisData = new ArrayList<>(); List<Object> axisData = new ArrayList<>();
for (Map<String, Object> map : maps) { for (Map<String, Object> map : maps) {
seriesData.add(map.get("value")); seriesData.add(map.get("value"));
axisData.add(map.get("REC_DATE")); axisData.add(map.get("REC_DATE"));
} }
result.put("seriesData",seriesData); result.put("seriesData", seriesData);
result.put("axisData",axisData); result.put("axisData", axisData);
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "查询场站下设备状态统计", notes = "查询场站下设备状态统计") @ApiOperation(httpMethod = "GET", value = "查询场站下设备状态统计", notes = "查询场站下设备状态统计")
@GetMapping (value = "/getFanEquipStatusByStation") @GetMapping(value = "/getFanEquipStatusByStation")
public ResponseModel<List<Map<String,Object>>> getFanEquipStatusByStation(String STATION) { public ResponseModel<List<Map<String, Object>>> getFanEquipStatusByStation(String STATION) {
Map<String, Object> map = idxBizFanHealthIndexServiceImpl.getFanEquipStatusByStation(STATION); Map<String, Object> map = idxBizFanHealthIndexServiceImpl.getFanEquipStatusByStation(STATION);
List<Map<String,Object>> maps = new ArrayList<>(); List<Map<String, Object>> maps = new ArrayList<>();
Map<String,Object> anquan = new HashMap<>(); Map<String, Object> anquan = new HashMap<>();
anquan.put("name","安全"); anquan.put("name", "安全");
anquan.put("value",map.get("安全")); anquan.put("value", map.get("安全"));
maps.add(anquan); maps.add(anquan);
Map<String,Object> zhuyi = new HashMap<>(); Map<String, Object> zhuyi = new HashMap<>();
zhuyi.put("name","注意"); zhuyi.put("name", "注意");
zhuyi.put("value",map.get("注意")); zhuyi.put("value", map.get("注意"));
maps.add(zhuyi); maps.add(zhuyi);
Map<String,Object> jinggao = new HashMap<>(); Map<String, Object> jinggao = new HashMap<>();
jinggao.put("name","警告"); jinggao.put("name", "警告");
jinggao.put("value",map.get("警告")); jinggao.put("value", map.get("警告"));
maps.add(jinggao); maps.add(jinggao);
Map<String,Object> weixian = new HashMap<>(); Map<String, Object> weixian = new HashMap<>();
weixian.put("name","危险"); weixian.put("name", "危险");
weixian.put("value",map.get("危险")); weixian.put("value", map.get("危险"));
maps.add(weixian); maps.add(weixian);
return ResponseHelper.buildResponse(maps); return ResponseHelper.buildResponse(maps);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "查询光伏场站所有设备状态统计", notes = "查询光伏场站所有设备状态统计") @ApiOperation(httpMethod = "GET", value = "查询光伏场站所有设备状态统计", notes = "查询光伏场站所有设备状态统计")
@GetMapping (value = "/getPvEquipStatusByStation") @GetMapping(value = "/getPvEquipStatusByStation")
public ResponseModel<List<Map<String,Object>>> getPvEquipStatusByStation(String STATION) { public ResponseModel<List<Map<String, Object>>> getPvEquipStatusByStation(String STATION) {
Map<String, Object> map = idxBizFanHealthIndexServiceImpl.getPvEquipStatusByStation(STATION); Map<String, Object> map = idxBizFanHealthIndexServiceImpl.getPvEquipStatusByStation(STATION);
List<Map<String,Object>> maps = new ArrayList<>(); List<Map<String, Object>> maps = new ArrayList<>();
Map<String,Object> anquan = new HashMap<>(); Map<String, Object> anquan = new HashMap<>();
anquan.put("name","安全"); anquan.put("name", "安全");
anquan.put("value",map.get("安全")); anquan.put("value", map.get("安全"));
maps.add(anquan); maps.add(anquan);
Map<String,Object> zhuyi = new HashMap<>(); Map<String, Object> zhuyi = new HashMap<>();
zhuyi.put("name","注意"); zhuyi.put("name", "注意");
zhuyi.put("value",map.get("注意")); zhuyi.put("value", map.get("注意"));
maps.add(zhuyi); maps.add(zhuyi);
Map<String,Object> jinggao = new HashMap<>(); Map<String, Object> jinggao = new HashMap<>();
jinggao.put("name","警告"); jinggao.put("name", "警告");
jinggao.put("value",map.get("警告")); jinggao.put("value", map.get("警告"));
maps.add(jinggao); maps.add(jinggao);
Map<String,Object> weixian = new HashMap<>(); Map<String, Object> weixian = new HashMap<>();
weixian.put("name","危险"); weixian.put("name", "危险");
weixian.put("value",map.get("危险")); weixian.put("value", map.get("危险"));
maps.add(weixian); maps.add(weixian);
return ResponseHelper.buildResponse(maps); return ResponseHelper.buildResponse(maps);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "TD 风电场站/设备左侧列表通用接口", notes = "TD 风电场站/设备列表通用接口") @ApiOperation(httpMethod = "GET", value = "TD 风电场站/设备左侧列表通用接口", notes = "TD 风电场站/设备列表通用接口")
@GetMapping(value = "/stationHealthIndexTable") @GetMapping(value = "/stationHealthIndexTable")
public ResponseModel<Page<FanHealthIndexDay>> stationHealthIndexTable(@RequestParam(value = "area",required = false) String area, public ResponseModel<Page<FanHealthIndexDay>> stationHealthIndexTable(@RequestParam(value = "area", required = false) String area,
@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,
@RequestParam(value = "analysisType",required = false) String analysisType, @RequestParam(value = "analysisType", required = false) String analysisType,
@RequestParam(value = "endTimeTop",required = false) String endTimeTop, @RequestParam(value = "endTimeTop", required = false) String endTimeTop,
@RequestParam(value = "startTimeTop",required = false) String startTimeTop, @RequestParam(value = "startTimeTop", required = false) String startTimeTop,
@RequestParam(value = "indexAddress",required = false) String indexAddress, @RequestParam(value = "indexAddress", required = false) String indexAddress,
@RequestParam(value = "pointName",required = false) String pointName, @RequestParam(value = "pointName", required = false) String pointName,
@RequestParam(value = "equipmentName",required = false) String equipmentName, @RequestParam(value = "equipmentName", required = false) String equipmentName,
@RequestParam(value = "healthLevel",required = false) String healthLevel, @RequestParam(value = "healthLevel", required = false) String healthLevel,
@RequestParam(value = "type",required = false) String type, @RequestParam(value = "type", required = false) String type,
@RequestParam(value = "subSystem",required = false) String subSystem, @RequestParam(value = "subSystem", required = false) String subSystem,
@RequestParam(value = "current",required = false)Integer current, @RequestParam(value = "current", required = false) Integer current,
@RequestParam(value = "size",required = false)Integer size){ @RequestParam(value = "size", required = false) Integer size) {
Page<FanHealthIndexDay> page = new Page<FanHealthIndexDay>(); Page<FanHealthIndexDay> page = new Page<FanHealthIndexDay>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
if (type.equals("0")){ if (type.equals("0")) {
Date startDayTime = DateUtils.getCurrentDayStartTime(new Date()); Date startDayTime = DateUtils.getCurrentDayStartTime(new Date());
Date date = DateUtils.dateAddHours(startDayTime, -9); Date date = DateUtils.dateAddHours(startDayTime, -9);
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);
}else{ } else {
Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -7); Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -7);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
endTimeTop = formatter.format(endDate); endTimeTop = formatter.format(endDate);
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -9); Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -9);
startTimeTop = formatter.format(startDate); startTimeTop = formatter.format(startDate);
} }
List<String> gatewayIds = permissionService.getCurrentUserAmosOrgCodes(); List<String> gatewayIds = permissionService.getCurrentUserAmosOrgCodes();
String orgCode = "NULL"; String orgCode = "NULL";
if(gatewayIds.size()>0){ if (gatewayIds.size() > 0) {
orgCode =gatewayIds.get(0)+"%"; orgCode = gatewayIds.get(0) + "%";
} }
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, orgCode); List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, (current - 1) * size, size, orgCode);
int total = fanHealthIndexDayMapper.selectDataTotal(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,orgCode); int total = fanHealthIndexDayMapper.selectDataTotal(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, orgCode);
if(CollectionUtils.isEmpty(fanHealthIndexDays)){ if (CollectionUtils.isEmpty(fanHealthIndexDays)) {
fanHealthIndexDays = fanHealthIndexDayMapper.selectLatestData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, null, null,(current-1)*size,size, orgCode); fanHealthIndexDays = fanHealthIndexDayMapper.selectLatestData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, null, null, (current - 1) * size, size, orgCode);
if(CollectionUtils.isEmpty(fanHealthIndexDays)){ if (CollectionUtils.isEmpty(fanHealthIndexDays)) {
logger.warn("根据条件:area:{},station:{},equipmentName:{},subSystem:{},pointName:{},analysisObjType:{}获取最新的数据为空",area,station,equipmentName,subSystem,pointName,analysisObjType); logger.warn("根据条件:area:{},station:{},equipmentName:{},subSystem:{},pointName:{},analysisObjType:{}获取最新的数据为空", area, station, equipmentName, subSystem, pointName, analysisObjType);
total = 0; total = 0;
}else{ } else {
total = fanHealthIndexDays.size(); total = fanHealthIndexDays.size();
} }
} }
fanHealthIndexDays.forEach(item -> { fanHealthIndexDays.forEach(item -> {
double roundedNumber = Double.parseDouble(df.format(item.getHealthIndex())); double roundedNumber = Double.parseDouble(df.format(item.getHealthIndex()));
item.setHealthIndex(roundedNumber); item.setHealthIndex(roundedNumber);
}); });
page.setRecords(fanHealthIndexDays); page.setRecords(fanHealthIndexDays);
page.setTotal(total); page.setTotal(total);
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "TD 风电场站/设备仪表盘", notes = "TD 风电场站/设备仪表盘") @ApiOperation(httpMethod = "GET", value = "TD 风电场站/设备仪表盘", notes = "TD 风电场站/设备仪表盘")
@GetMapping(value = "/HealthIndexValue") @GetMapping(value = "/HealthIndexValue")
public ResponseModel<Map<String,Object>> HealthIndexValue(@RequestParam(value = "area",required = false) String area, public ResponseModel<Map<String, Object>> HealthIndexValue(@RequestParam(value = "area", required = false) String area,
@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,
@RequestParam(value = "analysisType",required = false) String analysisType, @RequestParam(value = "analysisType", required = false) String analysisType,
@RequestParam(value = "endTimeTop",required = false) String endTimeTop, @RequestParam(value = "endTimeTop", required = false) String endTimeTop,
@RequestParam(value = "startTimeTop",required = false) String startTimeTop, @RequestParam(value = "startTimeTop", required = false) String startTimeTop,
@RequestParam(value = "indexAddress",required = false) String indexAddress, @RequestParam(value = "indexAddress", required = false) String indexAddress,
@RequestParam(value = "pointName",required = false) String pointName, @RequestParam(value = "pointName", required = false) String pointName,
@RequestParam(value = "equipmentName",required = false) String equipmentName, @RequestParam(value = "equipmentName", required = false) String equipmentName,
@RequestParam(value = "healthLevel",required = false) String healthLevel, @RequestParam(value = "healthLevel", required = false) String healthLevel,
@RequestParam(value = "type",required = false) String type, @RequestParam(value = "type", required = false) String type,
@RequestParam(value = "subSystem",required = false) String subSystem, @RequestParam(value = "subSystem", required = false) String subSystem,
@RequestParam(value = "current",required = false)Integer current, @RequestParam(value = "requiredType", required = false) String requiredType,
@RequestParam(value = "size",required = false)Integer size){ @RequestParam(value = "current", required = false) Integer current,
@RequestParam(value = "size", required = false) Integer size) {
List<String> gatewayIds = permissionService.getCurrentUserAmosOrgCodes();
String orgCode = "NULL";
if (type.equals("0")){ if (gatewayIds.size() > 0) {
Date startDayTime = DateUtils.getCurrentDayStartTime(new Date()); orgCode = gatewayIds.get(0) + "%";
Date date = DateUtils.dateAddHours(startDayTime, -8); }
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); if (requiredType.equals(WarningPeriodEnum.DAY.getName())) {
startTimeTop = formatter.format(date); Date startDayTime = DateUtils.getCurrentDayStartTime(new Date());
}else{ Date date = DateUtils.dateAddHours(startDayTime, -9);
Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -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);
endTimeTop = formatter.format(endDate); List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, null, null, orgCode);
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8); Map<String, Object> map = new HashMap<>();
startTimeTop = formatter.format(startDate); Double value = 0.00;
} if (CollectionUtil.isNotEmpty(fanHealthIndexDays)) {
List<String> gatewayIds = permissionService.getCurrentUserAmosOrgCodes(); value = Double.parseDouble(df.format(fanHealthIndexDays.get(0).getHealthIndex()));
String orgCode = "NULL"; }
if(gatewayIds.size()>0){ map.put("value", value);
orgCode =gatewayIds.get(0)+"%"; return ResponseHelper.buildResponse(map);
} } else if (requiredType.equals(WarningPeriodEnum.HOUR.getName())) {
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode); Date date = new Date();
date = DateUtil.offsetHour(date, -8);
Map<String,Object> map = new HashMap<>(); date = DateUtil.offsetMinute(date, -59);
//预防查询结果为空 startTimeTop = DateUtil.format(date, DatePattern.NORM_DATETIME_PATTERN);
if(CollectionUtils.isEmpty(fanHealthIndexDays)){ List<FanHealthIndexHour> fanHealthIndexHour = fanHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, null, null, orgCode);
map.put("value",0); Map<String, Object> map = new HashMap<>();
}else{ Double value = 0.00;
map.put("value",Double.parseDouble(df.format(Double.parseDouble(fanHealthIndexDays.get(0).getValue())))); if (CollectionUtil.isNotEmpty(fanHealthIndexHour)) {
} value = Double.parseDouble(df.format(fanHealthIndexHour.get(0).getHealthIndex()));
}
return ResponseHelper.buildResponse(map); map.put("value", value);
} return ResponseHelper.buildResponse(map);
} else {
Date date = DateUtils.dateAddMinutes(null, -9);
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) date = DateUtils.dateAddHours(date, -8);
@ApiOperation(httpMethod = "GET",value = "查询场站下设备状态统计", notes = "查询场站下设备状态统计") SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@GetMapping (value = "/selectEquipStatusByStation") startTimeTop = formatter.format(date);
public ResponseModel<List<Map<String,Object>>> getFanEquipStatusByStation(@RequestParam(value = "area",required = false) String area, List<FanHealthIndexMoment> fanHealthIndexMoment = fanHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, null, null, orgCode);
@RequestParam(value = "station",required = false) String station, Map<String, Object> map = new HashMap<>();
@RequestParam(value = "analysisObjType",required = false) String analysisObjType //预防查询结果为空
) { Double value = 0.00;
List<String> gatewayIds = this.getGatewayIds(); if (CollectionUtil.isNotEmpty(fanHealthIndexMoment)) {
List<Map<String, Object>> maps = fanHealthIndexDayMapper.selectEquipStatusByStation(area, analysisObjType, station, gatewayIds); value = Double.parseDouble(df.format(fanHealthIndexMoment.get(0).getHealthIndex()));
if (maps.size() == 4){ }
for (Map<String, Object> map : maps) { map.put("value", value);
map.put("name",map.get("healthlevel")); return ResponseHelper.buildResponse(map);
} }
} else { }
List<String> levels = new ArrayList<>();
levels.add("安全"); @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
levels.add("注意"); @ApiOperation(httpMethod = "GET", value = "查询场站下设备状态统计", notes = "查询场站下设备状态统计")
levels.add("警告"); @GetMapping(value = "/selectEquipStatusByStation")
levels.add("危险"); public ResponseModel<List<Map<String, Object>>> getFanEquipStatusByStation(@RequestParam(value = "area", required = false) String area,
@RequestParam(value = "station", required = false) String station,
for (Map<String, Object> map : maps) { @RequestParam(value = "analysisObjType", required = false) String analysisObjType,
map.put("name",map.get("healthlevel")); @RequestParam(value = "requiredType", required = false) String requiredType
String healthlevel = map.get("healthlevel").toString(); ) {
levels.remove(healthlevel); List<String> gatewayIds = this.getGatewayIds();
} List<Map<String, Object>> maps;
String startTimeTop;
if (levels.size()>0){ if (WarningPeriodEnum.DAY.getName().equals(requiredType)) {
for (String s : levels) { Date startDayTime = DateUtils.getCurrentDayStartTime(new Date());
Map<String, Object> map = new HashMap<>(); Date date = DateUtils.dateAddHours(startDayTime, -9);
map.put("name",s); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
map.put("value",0); startTimeTop = formatter.format(date);
map.put("sort",HealthLevelSortEnum.getCode(s)); maps = fanHealthIndexDayMapper.selectEquipStatusByStation(area, analysisObjType, station, gatewayIds,startTimeTop);
maps.add(map); }else if (WarningPeriodEnum.HOUR.getName().equals(requiredType)) {
} Date date = new Date();
maps = maps.stream().sorted(Comparator.comparingLong(e -> Long.valueOf(e.get("sort").toString()))).collect(Collectors.toList()); date = DateUtil.offsetHour(date, -8);
} date = DateUtil.offsetMinute(date, -59);
} startTimeTop = DateUtil.format(date, DatePattern.NORM_DATETIME_PATTERN);
return ResponseHelper.buildResponse(maps); maps = fanHealthIndexHourMapper.selectEquipStatusByStation(area, analysisObjType, station, gatewayIds,startTimeTop);
} }else{
Date date = DateUtils.dateAddMinutes(null, -9);
date = DateUtils.dateAddHours(date, -8);
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@ApiOperation(httpMethod = "GET",value = "预警监测设备级统计td 统计分类环图 ", notes = "预警监测设备级统计td 统计分类环图") startTimeTop = formatter.format(date);
@GetMapping(value = "/selectPointNum") maps = fanHealthIndexMomentMapper.selectEquipStatusByStation(area, analysisObjType, station, gatewayIds,startTimeTop);
public ResponseModel<List<Map<String,Object>>> selectPointNum(@RequestParam(required = false) String STATION,@RequestParam(required = false) String SUBSYSTEM,@RequestParam(required = false) String EQUIPMENTNAME) { }
// List<FanWarningRecord> idxBizPvWarningRecordList = fanWarningRecord.warningData(STATION,EQUIPMENTNAME ,SUBSYSTEM ); if (maps.size() == 4) {
List<Map<String, Object>> maps = fanHealthIndexDayMapper.selectEquipStatusByEquipment( "测点", STATION,EQUIPMENTNAME); for (Map<String, Object> map : maps) {
int total = idxBizFanHealthIndexServiceImpl.pointNum(STATION, SUBSYSTEM, EQUIPMENTNAME); map.put("name", map.get("healthlevel"));
}
// Map<String,Object> map =new HashMap<>(); } else {
// Map<String,Object> map1 =new HashMap<>();
// Map<String,Object> warningNum =new HashMap<>(); List<String> levels = new ArrayList<>();
// Map<String,Object> pointNum =new HashMap<>(); levels.add("安全");
// levels.add("注意");
// map1.put("name","危险"); levels.add("警告");
// map1.put("value",idxBizPvWarningRecordList.stream().filter(e->e.getWarningName().equals("危险")).count()); levels.add("危险");
// map.put("name","警告");
// map.put("value",idxBizPvWarningRecordList.stream().filter(e->e.getWarningName().equals("警告")).count()); for (Map<String, Object> map : maps) {
// warningNum.put("name","注意"); map.put("name", map.get("healthlevel"));
// warningNum.put("value",idxBizPvWarningRecordList.stream().filter(e->e.getWarningName().equals("注意")).count()); String healthlevel = map.get("healthlevel").toString();
// pointNum.put("name","安全"); levels.remove(healthlevel);
// pointNum.put("value",total - idxBizPvWarningRecordList.size()); }
//
// List<Map<String,Object>> list = new ArrayList<>(); if (levels.size() > 0) {
// list.add(pointNum); for (String s : levels) {
// list.add(warningNum); Map<String, Object> map = new HashMap<>();
// list.add(map); map.put("name", s);
// list.add(map1); map.put("value", 0);
// map.put("sort", HealthLevelSortEnum.getCode(s));
// return ResponseHelper.buildResponse(list); maps.add(map);
if (maps.size() == 4){ }
for (Map<String, Object> map : maps) { maps = maps.stream().sorted(Comparator.comparingLong(e -> Long.valueOf(e.get("sort").toString()))).collect(Collectors.toList());
map.put("name",map.get("healthlevel")); }
} }
} else { return ResponseHelper.buildResponse(maps);
}
List<String> levels = new ArrayList<>();
levels.add("安全");
levels.add("注意"); @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
levels.add("警告"); @ApiOperation(httpMethod = "GET", value = "预警监测设备级统计td 统计分类环图 ", notes = "预警监测设备级统计td 统计分类环图")
levels.add("危险"); @GetMapping(value = "/selectPointNum")
public ResponseModel<List<Map<String, Object>>> selectPointNum(@RequestParam(required = false) String STATION, @RequestParam(required = false) String SUBSYSTEM, @RequestParam(required = false) String EQUIPMENTNAME,@RequestParam(value = "requiredType", required = false) String requiredType) {
for (Map<String, Object> map : maps) { List<Map<String, Object>> maps;
map.put("name",map.get("healthlevel")); String startTimeTop;
String healthlevel = map.get("healthlevel").toString(); if (WarningPeriodEnum.DAY.getName().equals(requiredType)) {
levels.remove(healthlevel); Date startDayTime = DateUtils.getCurrentDayStartTime(new Date());
} Date date = DateUtils.dateAddHours(startDayTime, -9);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (levels.size()>0){ startTimeTop = formatter.format(date);
for (String s : levels) { maps = fanHealthIndexDayMapper.selectEquipStatusByEquipment("测点", STATION, EQUIPMENTNAME,startTimeTop);
Map<String, Object> map = new HashMap<>(); }else if (WarningPeriodEnum.HOUR.getName().equals(requiredType)) {
map.put("name",s); Date date = new Date();
map.put("value",0); date = DateUtil.offsetHour(date, -8);
map.put("sort",HealthLevelSortEnum.getCode(s)); date = DateUtil.offsetMinute(date, -59);
maps.add(map); startTimeTop = DateUtil.format(date, DatePattern.NORM_DATETIME_PATTERN);
} maps = fanHealthIndexHourMapper.selectEquipStatusByEquipment("测点", STATION, EQUIPMENTNAME,startTimeTop);
maps = maps.stream().sorted(Comparator.comparingLong(e -> Long.valueOf(e.get("sort").toString()))).collect(Collectors.toList()); }else{
} Date date = DateUtils.dateAddMinutes(null, -9);
} date = DateUtils.dateAddHours(date, -8);
return ResponseHelper.buildResponse(maps); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
} startTimeTop = formatter.format(date);
maps = fanHealthIndexMomentMapper.selectEquipStatusByEquipment("测点", STATION, EQUIPMENTNAME,startTimeTop);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) if (maps.size() == 4) {
@ApiOperation(httpMethod = "GET",value = "TD 风电场站/设备列表通用接口", notes = "TD 风电场站/设备列表通用接口") for (Map<String, Object> map : maps) {
@GetMapping(value = "/pointHealthIndexTable") map.put("name", map.get("healthlevel"));
public ResponseModel<Page> pointHealthIndexTable(@RequestParam(value = "area",required = false) String area, }
@RequestParam(value = "station",required = false) String station, } else {
@RequestParam(value = "analysisObjType",required = false) String analysisObjType,
@RequestParam(value = "analysisType",required = false) String analysisType, List<String> levels = new ArrayList<>();
@RequestParam(value = "endTimeTop",required = false) String endTimeTop, levels.add("安全");
@RequestParam(value = "startTimeTop",required = false) String startTimeTop, levels.add("注意");
@RequestParam(value = "indexAddress",required = false) String indexAddress, levels.add("警告");
@RequestParam(value = "pointName",required = false) String pointName, levels.add("危险");
@RequestParam(value = "equipmentName",required = false) String equipmentName,
@RequestParam(value = "healthLevel",required = false) String healthLevel, for (Map<String, Object> map : maps) {
@RequestParam(value = "type",required = false) String type, map.put("name", map.get("healthlevel"));
@RequestParam(value = "requiredType",required = false) String requiredType, String healthlevel = map.get("healthlevel").toString();
@RequestParam(value = "subSystem",required = false) String subSystem, levels.remove(healthlevel);
@RequestParam(value = "current",required = false) Integer current, }
@RequestParam(value = "size",required = false) Integer size){
List<String> gatewayIds = permissionService.getCurrentUserAmosOrgCodes(); if (levels.size() > 0) {
String orgCode = "NULL"; for (String s : levels) {
if(gatewayIds.size()>0){ Map<String, Object> map = new HashMap<>();
orgCode =gatewayIds.get(0)+"%"; map.put("name", s);
} map.put("value", 0);
if (requiredType.equals(WarningPeriodEnum.DAY.getName())){ map.put("sort", HealthLevelSortEnum.getCode(s));
maps.add(map);
}
maps = maps.stream().sorted(Comparator.comparingLong(e -> Long.valueOf(e.get("sort").toString()))).collect(Collectors.toList());
}
}
return ResponseHelper.buildResponse(maps);
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "TD 风电场站/设备列表通用接口", notes = "TD 风电场站/设备列表通用接口")
@GetMapping(value = "/pointHealthIndexTable")
public ResponseModel<Page> pointHealthIndexTable(@RequestParam(value = "area", required = false) String area,
@RequestParam(value = "station", required = false) String station,
@RequestParam(value = "analysisObjType", required = false) String analysisObjType,
@RequestParam(value = "analysisType", required = false) String analysisType,
@RequestParam(value = "endTimeTop", required = false) String endTimeTop,
@RequestParam(value = "startTimeTop", required = false) String startTimeTop,
@RequestParam(value = "indexAddress", required = false) String indexAddress,
@RequestParam(value = "pointName", required = false) String pointName,
@RequestParam(value = "equipmentName", required = false) String equipmentName,
@RequestParam(value = "healthLevel", required = false) String healthLevel,
@RequestParam(value = "type", required = false) String type,
@RequestParam(value = "requiredType", required = false) String requiredType,
@RequestParam(value = "subSystem", required = false) String subSystem,
@RequestParam(value = "current", required = false) Integer current,
@RequestParam(value = "size", required = false) Integer size) {
List<String> gatewayIds = permissionService.getCurrentUserAmosOrgCodes();
String orgCode = "NULL";
if (gatewayIds.size() > 0) {
orgCode = gatewayIds.get(0) + "%";
}
if (requiredType.equals(WarningPeriodEnum.DAY.getName())) {
// if (null != type && type.equals("0")){ // if (null != type && type.equals("0")){
Date startDayTime = DateUtils.getCurrentDayStartTime(new Date()); Date startDayTime = DateUtils.getCurrentDayStartTime(new Date());
Date date = DateUtils.dateAddHours(startDayTime, -9); Date date = DateUtils.dateAddHours(startDayTime, -9);
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);
// }else{ // }else{
// Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8); // Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8);
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
...@@ -618,24 +638,24 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -618,24 +638,24 @@ 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,orgCode ); List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, (current - 1) * size, size, orgCode);
fanHealthIndexDays.forEach(item -> { fanHealthIndexDays.forEach(item -> {
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex()))); item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex())));
}); });
Page page = new Page<>(); Page page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
int total = fanHealthIndexDayMapper.selectDataTotal(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,orgCode); int total = fanHealthIndexDayMapper.selectDataTotal(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, orgCode);
page.setTotal(total); page.setTotal(total);
page.setRecords(fanHealthIndexDays); page.setRecords(fanHealthIndexDays);
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
}else if (requiredType.equals(WarningPeriodEnum.HOUR.getName())){ } else if (requiredType.equals(WarningPeriodEnum.HOUR.getName())) {
// if (null != type && type.equals("0")){ // if (null != type && type.equals("0")){
Date date = new Date(); Date date = new Date();
date = DateUtil.offsetHour(date,-8); date = DateUtil.offsetHour(date, -8);
date = DateUtil.offsetMinute(date,-59); date = DateUtil.offsetMinute(date, -59);
startTimeTop = DateUtil.format(date,DatePattern.NORM_DATETIME_PATTERN); startTimeTop = DateUtil.format(date, DatePattern.NORM_DATETIME_PATTERN);
// }else{ // }else{
// Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8); // Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8);
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
...@@ -643,23 +663,23 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -643,23 +663,23 @@ 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<FanHealthIndexHour> fanHealthIndexHours = fanHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, orgCode); List<FanHealthIndexHour> fanHealthIndexHours = fanHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, (current - 1) * size, size, orgCode);
fanHealthIndexHours.forEach(item -> { fanHealthIndexHours.forEach(item -> {
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex()))); item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex())));
}); });
Page page = new Page<>(); Page page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
int total = fanHealthIndexDayMapper.selectDataTotal(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,orgCode); int total = fanHealthIndexDayMapper.selectDataTotal(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, orgCode);
page.setTotal(total); page.setTotal(total);
page.setRecords(fanHealthIndexHours); page.setRecords(fanHealthIndexHours);
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
}else { } else {
// if (null != type && type.equals("0")){ // if (null != type && type.equals("0")){
Date date = DateUtils.dateAddMinutes(null,-9); Date date = DateUtils.dateAddMinutes(null, -9);
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);
// }else{ // }else{
// Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8); // Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8);
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
...@@ -667,48 +687,47 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -667,48 +687,47 @@ 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<FanHealthIndexMoment> fanHealthIndexMoments = fanHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, orgCode); List<FanHealthIndexMoment> fanHealthIndexMoments = fanHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, (current - 1) * size, size, orgCode);
fanHealthIndexMoments.forEach(item -> { fanHealthIndexMoments.forEach(item -> {
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex()))); item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex())));
}); });
Page page = new Page<>(); Page page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
int total = fanHealthIndexDayMapper.selectDataTotal(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,orgCode); int total = fanHealthIndexDayMapper.selectDataTotal(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, orgCode);
page.setTotal(total); page.setTotal(total);
page.setRecords(fanHealthIndexMoments); page.setRecords(fanHealthIndexMoments);
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "TD 风电测点仪表盘", notes = "TD 风电测点仪表盘") @ApiOperation(httpMethod = "GET", value = "TD 风电测点仪表盘", notes = "TD 风电测点仪表盘")
@GetMapping(value = "/pointHealthIndexValue") @GetMapping(value = "/pointHealthIndexValue")
public ResponseModel<Map<String,Object>> pointHealthIndexValue(@RequestParam(value = "area",required = false) String area, public ResponseModel<Map<String, Object>> pointHealthIndexValue(@RequestParam(value = "area", required = false) String area,
@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,
@RequestParam(value = "analysisType",required = false) String analysisType, @RequestParam(value = "analysisType", required = false) String analysisType,
@RequestParam(value = "endTimeTop",required = false) String endTimeTop, @RequestParam(value = "endTimeTop", required = false) String endTimeTop,
@RequestParam(value = "startTimeTop",required = false) String startTimeTop, @RequestParam(value = "startTimeTop", required = false) String startTimeTop,
@RequestParam(value = "indexAddress",required = false) String indexAddress, @RequestParam(value = "indexAddress", required = false) String indexAddress,
@RequestParam(value = "pointName",required = false) String pointName, @RequestParam(value = "pointName", required = false) String pointName,
@RequestParam(value = "equipmentName",required = false) String equipmentName, @RequestParam(value = "equipmentName", required = false) String equipmentName,
@RequestParam(value = "healthLevel",required = false) String healthLevel, @RequestParam(value = "healthLevel", required = false) String healthLevel,
@RequestParam(value = "type",required = false) String type, @RequestParam(value = "type", required = false) String type,
@RequestParam(value = "requiredType",required = false) String requiredType, @RequestParam(value = "requiredType", required = false) String requiredType,
@RequestParam(value = "subSystem",required = false) String subSystem, @RequestParam(value = "subSystem", required = false) String subSystem,
@RequestParam(value = "current",required = false) Integer current, @RequestParam(value = "current", required = false) Integer current,
@RequestParam(value = "size",required = false) Integer size){ @RequestParam(value = "size", required = false) Integer size) {
if (requiredType.equals(WarningPeriodEnum.DAY.getName())) {
if (requiredType.equals(WarningPeriodEnum.DAY.getName())){
// if (null != type && type.equals("0")){ // if (null != type && type.equals("0")){
Date startDayTime = DateUtils.getCurrentDayStartTime(new Date()); Date startDayTime = DateUtils.getCurrentDayStartTime(new Date());
Date date = DateUtils.dateAddHours(startDayTime, -9); Date date = DateUtils.dateAddHours(startDayTime, -9);
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);
// }else{ // }else{
// Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8); // Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8);
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
...@@ -716,17 +735,17 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -716,17 +735,17 @@ 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<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, (current - 1) * size, size, null);
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("value",Double.parseDouble(df.format(fanHealthIndexDays.get(0).getHealthIndex()))); map.put("value", Double.parseDouble(df.format(fanHealthIndexDays.get(0).getHealthIndex())));
return ResponseHelper.buildResponse(map); return ResponseHelper.buildResponse(map);
}else if (requiredType.equals(WarningPeriodEnum.HOUR.getName())){ } else if (requiredType.equals(WarningPeriodEnum.HOUR.getName())) {
// if (null != type && type.equals("0")){ // if (null != type && type.equals("0")){
Date date = new Date(); Date date = new Date();
date = DateUtil.offsetHour(date,-8); date = DateUtil.offsetHour(date, -8);
date = DateUtil.offsetMinute(date,-59); date = DateUtil.offsetMinute(date, -59);
startTimeTop = DateUtil.format(date,DatePattern.NORM_DATETIME_PATTERN); startTimeTop = DateUtil.format(date, DatePattern.NORM_DATETIME_PATTERN);
// }else{ // }else{
// Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8); // Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8);
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
...@@ -734,16 +753,16 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -734,16 +753,16 @@ 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<FanHealthIndexHour> fanHealthIndexHours = fanHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, null); List<FanHealthIndexHour> fanHealthIndexHours = fanHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, (current - 1) * size, size, null);
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())));
return ResponseHelper.buildResponse(map); return ResponseHelper.buildResponse(map);
}else { } else {
// if (null != type && type.equals("0")){ // if (null != type && type.equals("0")){
Date date = DateUtils.dateAddMinutes(null,-9); Date date = DateUtils.dateAddMinutes(null, -9);
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);
// }else{ // }else{
// Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8); // Date endDate = DateUtils.dateAddHours(DateUtils.longStr2Date(endTimeTop), -8);
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
...@@ -751,127 +770,123 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -751,127 +770,123 @@ 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<FanHealthIndexMoment> fanHealthIndexMoments = fanHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, null); List<FanHealthIndexMoment> fanHealthIndexMoments = fanHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, (current - 1) * size, size, null);
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())));
return ResponseHelper.buildResponse(map); return ResponseHelper.buildResponse(map);
} }
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "TD 风电折线图", notes = "TD风电折线图") @ApiOperation(httpMethod = "GET", value = "TD 风电折线图", notes = "TD风电折线图")
@GetMapping(value = "/pointHealthIndexTrend") @GetMapping(value = "/pointHealthIndexTrend")
public ResponseModel<Object> pointHealthIndexTrend(@RequestParam(value = "area",required = false) String area, public ResponseModel<Object> pointHealthIndexTrend(@RequestParam(value = "area", required = false) String area,
@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,
@RequestParam(value = "analysisType",required = false) String analysisType, @RequestParam(value = "analysisType", required = false) String analysisType,
@RequestParam(value = "endTimeTop",required = false) String endTimeTop, @RequestParam(value = "endTimeTop", required = false) String endTimeTop,
@RequestParam(value = "startTimeTop",required = false) String startTimeTop, @RequestParam(value = "startTimeTop", required = false) String startTimeTop,
@RequestParam(value = "indexAddress",required = false) String indexAddress, @RequestParam(value = "indexAddress", required = false) String indexAddress,
@RequestParam(value = "pointName",required = false) String pointName, @RequestParam(value = "pointName", required = false) String pointName,
@RequestParam(value = "equipmentName",required = false) String equipmentName, @RequestParam(value = "equipmentName", required = false) String equipmentName,
@RequestParam(value = "healthLevel",required = false) String healthLevel, @RequestParam(value = "healthLevel", required = false) String healthLevel,
@RequestParam(value = "type",required = false) String type, @RequestParam(value = "type", required = false) String type,
@RequestParam(value = "requiredType",required = false) String requiredType, @RequestParam(value = "requiredType", required = false) String requiredType,
@RequestParam(value = "subSystem",required = false) String subSystem) { @RequestParam(value = "subSystem", required = false) String subSystem) {
Map<String,Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
List<Object> seriesData = new ArrayList<>(); List<Object> seriesData = new ArrayList<>();
List<Object> axisData = new ArrayList<>(); List<Object> axisData = new ArrayList<>();
List<String> gatewayIds = permissionService.getCurrentUserAmosOrgCodes(); List<String> gatewayIds = permissionService.getCurrentUserAmosOrgCodes();
String orgCode = "NULL"; String orgCode = "NULL";
if(gatewayIds.size()>0){ if (gatewayIds.size() > 0) {
orgCode =gatewayIds.get(0)+'%'; orgCode = gatewayIds.get(0) + '%';
} }
if (WarningPeriodEnum.DAY.getName().equals(requiredType)){ if (WarningPeriodEnum.DAY.getName().equals(requiredType)) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
if ( null != endTimeTop){ if (null != endTimeTop) {
Date endDate = DateUtils.dateParse(endTimeTop); Date endDate = DateUtils.dateParse(endTimeTop);
endTimeTop = formatter.format(endDate); endTimeTop = formatter.format(endDate);
} }
//处理空指针问题 如果为空差15天前数据 //处理空指针问题 如果为空差15天前数据
if(StrUtil.isEmpty(startTimeTop)){ if (StrUtil.isEmpty(startTimeTop)) {
startTimeTop = LocalDateTime.now().minusDays(15).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); startTimeTop = LocalDateTime.now().minusDays(15).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
} }
Date startDate = DateUtils.dateParse(startTimeTop); Date startDate = DateUtils.dateParse(startTimeTop);
startTimeTop = formatter.format(startDate); startTimeTop = formatter.format(startDate);
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectTrendData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode); List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectTrendData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, null, null, orgCode);
fanHealthIndexDays= fanHealthIndexDays.stream().sorted(Comparator.comparing(FanHealthIndexDay::getRecDate)).collect(Collectors.toList()); fanHealthIndexDays = fanHealthIndexDays.stream().sorted(Comparator.comparing(FanHealthIndexDay::getRecDate)).collect(Collectors.toList());
for (FanHealthIndexDay obj : fanHealthIndexDays) { for (FanHealthIndexDay obj : fanHealthIndexDays) {
if (type.equals("0")){ if (type.equals("0")) {
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { } else {
seriesData.add(obj.getAnomaly() > 7.5?7.5:dfSS.format(obj.getAnomaly())); seriesData.add(obj.getAnomaly() > 7.5 ? 7.5 : dfSS.format(obj.getAnomaly()));
} }
axisData.add(obj.getRecDate()); axisData.add(obj.getRecDate());
} }
result.put("seriesData",seriesData); result.put("seriesData", seriesData);
result.put("axisData",axisData); result.put("axisData", axisData);
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
}else if (WarningPeriodEnum.HOUR.getName().equals(requiredType)){ } else if (WarningPeriodEnum.HOUR.getName().equals(requiredType)) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if ( null != endTimeTop){ if (null != endTimeTop) {
Date endDate = DateUtils.dateParse(endTimeTop); Date endDate = DateUtils.dateParse(endTimeTop);
endTimeTop = formatter.format(endDate); endTimeTop = formatter.format(endDate);
} }
Date startDate = DateUtils.dateParse(startTimeTop); Date startDate = DateUtils.dateParse(startTimeTop);
startTimeTop = formatter.format(startDate); startTimeTop = formatter.format(startDate);
List<FanHealthIndexHour> fanHealthIndexHours = fanHealthIndexHourMapper.selectTrendData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode); List<FanHealthIndexHour> fanHealthIndexHours = fanHealthIndexHourMapper.selectTrendData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, null, null, orgCode);
fanHealthIndexHours= fanHealthIndexHours.stream().sorted(Comparator.comparing(FanHealthIndexHour::getRecDate)).collect(Collectors.toList()); fanHealthIndexHours = fanHealthIndexHours.stream().sorted(Comparator.comparing(FanHealthIndexHour::getRecDate)).collect(Collectors.toList());
for (FanHealthIndexHour obj : fanHealthIndexHours) { for (FanHealthIndexHour obj : fanHealthIndexHours) {
if (type.equals("0")){ if (type.equals("0")) {
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { } else {
seriesData.add(obj.getAnomaly() > 7.5 ? 7.5 : dfSS.format(obj.getAnomaly())); seriesData.add(obj.getAnomaly() > 7.5 ? 7.5 : dfSS.format(obj.getAnomaly()));
} }
// Date dateTime = DateUtil.parseDateTime(obj.getAnalysisTime()); axisData.add(obj.getRecDate());
// String format = DateUtil.format(dateTime, "yyyy-MM-dd HH:00"); }
axisData.add(obj.getRecDate()); result.put("seriesData", seriesData);
} result.put("axisData", axisData);
result.put("seriesData",seriesData); return ResponseHelper.buildResponse(result);
result.put("axisData",axisData); } else {
return ResponseHelper.buildResponse(result); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
}else { if (null != endTimeTop) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date endDate = DateUtils.dateParse(endTimeTop);
if ( null != endTimeTop){ endTimeTop = formatter.format(endDate);
Date endDate = DateUtils.dateParse(endTimeTop); }
endTimeTop = formatter.format(endDate); Date startDate = DateUtils.dateParse(startTimeTop);
} startTimeTop = formatter.format(startDate);
Date startDate = DateUtils.dateParse(startTimeTop);
startTimeTop = formatter.format(startDate); List<FanHealthIndexMoment> fanHealthIndexMoments = fanHealthIndexMomentMapper.selectTrendData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, null, null, orgCode);
fanHealthIndexMoments = fanHealthIndexMoments.stream().sorted(Comparator.comparing(FanHealthIndexMoment::getRecDate)).collect(Collectors.toList());
List<FanHealthIndexMoment> fanHealthIndexMoments = fanHealthIndexMomentMapper.selectTrendData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode); for (FanHealthIndexMoment obj : fanHealthIndexMoments) {
fanHealthIndexMoments= fanHealthIndexMoments.stream().sorted(Comparator.comparing(FanHealthIndexMoment::getRecDate)).collect(Collectors.toList()); if (type.equals("0")) {
for (FanHealthIndexMoment obj : fanHealthIndexMoments) { seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
if (type.equals("0")){ } else {
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); seriesData.add(obj.getAnomaly() > 7.5 ? 7.5 : dfSS.format(obj.getAnomaly()));
}else { }
seriesData.add(obj.getAnomaly() > 7.5 ? 7.5 : dfSS.format(obj.getAnomaly())); axisData.add(obj.getRecDate());
} }
// Date dateTime = DateUtil.parseDateTime(obj.getAnalysisTime()); result.put("seriesData", seriesData);
// String format = DateUtil.format(dateTime, DatePattern.NORM_DATETIME_MINUTE_PATTERN); result.put("axisData", axisData);
axisData.add(obj.getRecDate()); return ResponseHelper.buildResponse(result);
} }
result.put("seriesData",seriesData); }
result.put("axisData",axisData);
return ResponseHelper.buildResponse(result);
} /**
} * 获取用户权限(此处使用gatewayId)
*
* @return gatewayIds
/** */
* 获取用户权限(此处使用gatewayId) private List<String> getGatewayIds() {
* List<String> permissions = permissionService.getCurrentUserPermissions();
* @return gatewayIds if (Objects.isNull(permissions)) {
*/ permissions = Collections.emptyList();
private List<String> getGatewayIds() { }
List<String> permissions = permissionService.getCurrentUserPermissions(); return permissions;
if (Objects.isNull(permissions)) { }
permissions = Collections.emptyList();
}
return permissions;
}
} }
...@@ -11,10 +11,8 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils; ...@@ -11,10 +11,8 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.jxiop.biz.Enum.HealthLevelSortEnum; import com.yeejoin.amos.boot.module.jxiop.biz.Enum.HealthLevelSortEnum;
import com.yeejoin.amos.boot.module.jxiop.biz.Enum.WarningPeriodEnum; import com.yeejoin.amos.boot.module.jxiop.biz.Enum.WarningPeriodEnum;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvHealthIndexDto; import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvHealthIndexDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanPointProcessVariableClassification;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvPointProcessVariableClassification; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvPointProcessVariableClassification;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRecord; import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanPointProcessVariableClassificationMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvPointProcessVariableClassificationMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvPointProcessVariableClassificationMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.IPermissionService; import com.yeejoin.amos.boot.module.jxiop.biz.service.IPermissionService;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvHealthIndexServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvHealthIndexServiceImpl;
...@@ -34,7 +32,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -34,7 +32,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
...@@ -42,8 +39,6 @@ import java.util.*; ...@@ -42,8 +39,6 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
*
*
* @author system_generator * @author system_generator
* @date 2023-08-15 * @date 2023-08-15
*/ */
...@@ -52,56 +47,57 @@ import java.util.stream.Collectors; ...@@ -52,56 +47,57 @@ import java.util.stream.Collectors;
@RequestMapping(value = "/idx-biz-pv-health-index") @RequestMapping(value = "/idx-biz-pv-health-index")
public class IdxBizPvHealthIndexController extends BaseController { public class IdxBizPvHealthIndexController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(IdxBizPvHealthIndexController.class); private static final Logger logger = LoggerFactory.getLogger(IdxBizPvHealthIndexController.class);
@Autowired @Autowired
IdxBizPvHealthIndexServiceImpl idxBizPvHealthIndexServiceImpl; IdxBizPvHealthIndexServiceImpl idxBizPvHealthIndexServiceImpl;
@Autowired @Autowired
PvHealthIndexDayMapper pvHealthIndexDayMapper; PvHealthIndexDayMapper pvHealthIndexDayMapper;
@Autowired @Autowired
PvHealthIndexHourMapper pvHealthIndexHourMapper; PvHealthIndexHourMapper pvHealthIndexHourMapper;
@Autowired @Autowired
PvHealthIndexMomentMapper pvHealthIndexMomentMapper; PvHealthIndexMomentMapper pvHealthIndexMomentMapper;
@Autowired @Autowired
PvWaringRecordMapper pvWaringRecordMapper; PvWaringRecordMapper pvWaringRecordMapper;
@Autowired @Autowired
IPermissionService permissionService; IPermissionService permissionService;
@Autowired @Autowired
IdxBizPvPointProcessVariableClassificationMapper idxBizPvPointProcessVariableClassificationMapper; IdxBizPvPointProcessVariableClassificationMapper idxBizPvPointProcessVariableClassificationMapper;
public final DecimalFormat df = new DecimalFormat("0.0");
public final DecimalFormat df = new DecimalFormat("0.0"); public final DecimalFormat dfSS = new DecimalFormat("0.00");
public final DecimalFormat dfSS = new DecimalFormat("0.00");
/** /**
* 新增 * 新增
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增") @ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<IdxBizPvHealthIndexDto> save(@RequestBody IdxBizPvHealthIndexDto model) { public ResponseModel<IdxBizPvHealthIndexDto> save(@RequestBody IdxBizPvHealthIndexDto model) {
model = idxBizPvHealthIndexServiceImpl.createWithModel(model); model = idxBizPvHealthIndexServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
} }
/** /**
* 根据sequenceNbr更新 * 根据sequenceNbr更新
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}") @PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<IdxBizPvHealthIndexDto> updateBySequenceNbrIdxBizPvHealthIndex(@RequestBody IdxBizPvHealthIndexDto model,@PathVariable(value = "sequenceNbr") String sequenceNbr) { public ResponseModel<IdxBizPvHealthIndexDto> updateBySequenceNbrIdxBizPvHealthIndex(@RequestBody IdxBizPvHealthIndexDto model, @PathVariable(value = "sequenceNbr") String sequenceNbr) {
model.setSequenceNbr(sequenceNbr); model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.updateWithModel(model)); return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.updateWithModel(model));
} }
/** /**
* 根据sequenceNbr删除 * 根据sequenceNbr删除
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
...@@ -110,605 +106,635 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -110,605 +106,635 @@ public class IdxBizPvHealthIndexController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}") @DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除", notes = "根据sequenceNbr删除") @ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除", notes = "根据sequenceNbr删除")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){ public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.removeById(sequenceNbr)); return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.removeById(sequenceNbr));
} }
/** /**
* 根据sequenceNbr查询 * 根据sequenceNbr查询
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个") @ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<IdxBizPvHealthIndexDto> selectOne(@PathVariable Long sequenceNbr) { public ResponseModel<IdxBizPvHealthIndexDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.queryBySeq(sequenceNbr)); return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.queryBySeq(sequenceNbr));
} }
/** /**
* 列表分页查询 * 列表分页查询
* *
* @param current 当前页 * @param current 当前页
* @param current 每页大小 * @param current 每页大小
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询") @ApiOperation(httpMethod = "GET", value = "分页查询", notes = "分页查询")
public ResponseModel<Page<IdxBizPvHealthIndexDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam public ResponseModel<Page<IdxBizPvHealthIndexDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) { (value = "size") int size) {
Page<IdxBizPvHealthIndexDto> page = new Page<IdxBizPvHealthIndexDto>(); Page<IdxBizPvHealthIndexDto> page = new Page<IdxBizPvHealthIndexDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.queryForIdxBizPvHealthIndexPage(page)); return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.queryForIdxBizPvHealthIndexPage(page));
} }
/** /**
* 列表全部数据查询 * 列表全部数据查询
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "列表全部数据查询", notes = "列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public ResponseModel<List<IdxBizPvHealthIndexDto>> selectForList() { public ResponseModel<List<IdxBizPvHealthIndexDto>> selectForList() {
return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.queryForIdxBizPvHealthIndexList()); return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.queryForIdxBizPvHealthIndexList());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测设备级左侧列表", notes = "预警监测设备级左侧列表") @ApiOperation(httpMethod = "GET", value = "预警监测设备级左侧列表", notes = "预警监测设备级左侧列表")
@GetMapping(value = "/queryForLeftTableListByEquip") @GetMapping(value = "/queryForLeftTableListByEquip")
public ResponseModel<Page<Map<String,Object>>> queryForLeftTableListByEquip(@RequestParam(required = false) String STATION, @RequestParam(required = false) String SUBARRAY, @RequestParam(required = false) String HEALTHLEVEL, @RequestParam(required = false) String EQUIPMENTNAME, @RequestParam(required = false) Integer current, @RequestParam(required = false) Integer size ) { public ResponseModel<Page<Map<String, Object>>> queryForLeftTableListByEquip(@RequestParam(required = false) String STATION, @RequestParam(required = false) String SUBARRAY, @RequestParam(required = false) String HEALTHLEVEL, @RequestParam(required = false) String EQUIPMENTNAME, @RequestParam(required = false) Integer current, @RequestParam(required = false) Integer size) {
Page<Map<String,Object>> page = new Page<Map<String,Object>>(); Page<Map<String, Object>> page = new Page<Map<String, Object>>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
int total = idxBizPvHealthIndexServiceImpl.queryForLeftTableListByEquipCount(STATION, SUBARRAY, HEALTHLEVEL,EQUIPMENTNAME); int total = idxBizPvHealthIndexServiceImpl.queryForLeftTableListByEquipCount(STATION, SUBARRAY, HEALTHLEVEL, EQUIPMENTNAME);
Long num = Long.valueOf(total); Long num = Long.valueOf(total);
page.setTotal(num); page.setTotal(num);
page.setRecords(idxBizPvHealthIndexServiceImpl.queryForLeftTableListByEquip(STATION,SUBARRAY,HEALTHLEVEL,EQUIPMENTNAME,(current-1)*size,size)); page.setRecords(idxBizPvHealthIndexServiceImpl.queryForLeftTableListByEquip(STATION, SUBARRAY, HEALTHLEVEL, EQUIPMENTNAME, (current - 1) * size, size));
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测测点级左侧列表", notes = "预警监测设备级左侧列表") @ApiOperation(httpMethod = "GET", value = "预警监测测点级左侧列表", notes = "预警监测设备级左侧列表")
@GetMapping(value = "/queryForLeftTableListByPoint") @GetMapping(value = "/queryForLeftTableListByPoint")
public ResponseModel<Page<Map<String,Object>>> queryForLeftTableListByPoint(@RequestParam(required = false) String STATION,@RequestParam(required = false) String SUBARRAY,@RequestParam(required = false) String HEALTHLEVEL,@RequestParam(required = false) String EQUIPMENTNAME,@RequestParam(required = false) String POINTNAME,@RequestParam(required = false) Integer current,@RequestParam(required = false) Integer size) { public ResponseModel<Page<Map<String, Object>>> queryForLeftTableListByPoint(@RequestParam(required = false) String STATION, @RequestParam(required = false) String SUBARRAY, @RequestParam(required = false) String HEALTHLEVEL, @RequestParam(required = false) String EQUIPMENTNAME, @RequestParam(required = false) String POINTNAME, @RequestParam(required = false) Integer current, @RequestParam(required = false) Integer size) {
Page<Map<String,Object>> page = new Page<Map<String,Object>>(); Page<Map<String, Object>> page = new Page<Map<String, Object>>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
int total = idxBizPvHealthIndexServiceImpl.queryForLeftTableListByPointCount(STATION, SUBARRAY, HEALTHLEVEL, EQUIPMENTNAME, POINTNAME); int total = idxBizPvHealthIndexServiceImpl.queryForLeftTableListByPointCount(STATION, SUBARRAY, HEALTHLEVEL, EQUIPMENTNAME, POINTNAME);
Long num = Long.valueOf(total); Long num = Long.valueOf(total);
page.setTotal(num); page.setTotal(num);
page.setRecords(idxBizPvHealthIndexServiceImpl.queryForLeftTableListByPoint(STATION,SUBARRAY,HEALTHLEVEL,EQUIPMENTNAME,POINTNAME,(current-1)*size,size)); page.setRecords(idxBizPvHealthIndexServiceImpl.queryForLeftTableListByPoint(STATION, SUBARRAY, HEALTHLEVEL, EQUIPMENTNAME, POINTNAME, (current - 1) * size, size));
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测设备级仪表盘", notes = "预警监测设备级仪表盘") @ApiOperation(httpMethod = "GET", value = "预警监测设备级仪表盘", notes = "预警监测设备级仪表盘")
@GetMapping(value = "/queryForLeftTableListByEquipNum") @GetMapping(value = "/queryForLeftTableListByEquipNum")
public ResponseModel<Map<String,Object>> queryForLeftTableListByEquipNum(@RequestParam(required = false) String STATION, @RequestParam(required = false) String SUBARRAY, @RequestParam(required = false) String HEALTHLEVEL, @RequestParam(required = false) String EQUIPMENTNAME) { public ResponseModel<Map<String, Object>> queryForLeftTableListByEquipNum(@RequestParam(required = false) String STATION, @RequestParam(required = false) String SUBARRAY, @RequestParam(required = false) String HEALTHLEVEL, @RequestParam(required = false) String EQUIPMENTNAME) {
; ;
return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.queryForLeftTableListByEquipNum(STATION, SUBARRAY, HEALTHLEVEL,EQUIPMENTNAME)); return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.queryForLeftTableListByEquipNum(STATION, SUBARRAY, HEALTHLEVEL, EQUIPMENTNAME));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测测点级仪表盘", notes = "预警监测设备级仪表盘") @ApiOperation(httpMethod = "GET", value = "预警监测测点级仪表盘", notes = "预警监测设备级仪表盘")
@GetMapping(value = "/queryForLeftTableListByPointNum") @GetMapping(value = "/queryForLeftTableListByPointNum")
public ResponseModel<Map<String,Object>> queryForLeftTableListByPointNum(@RequestParam(required = false) String STATION,@RequestParam(required = false) String SUBARRAY,@RequestParam(required = false) String HEALTHLEVEL,@RequestParam(required = false) String EQUIPMENTNAME,@RequestParam(required = false) String POINTNAME) { public ResponseModel<Map<String, Object>> queryForLeftTableListByPointNum(@RequestParam(required = false) String STATION, @RequestParam(required = false) String SUBARRAY, @RequestParam(required = false) String HEALTHLEVEL, @RequestParam(required = false) String EQUIPMENTNAME, @RequestParam(required = false) String POINTNAME) {
return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.queryForLeftTableListByPointNum(STATION, SUBARRAY, HEALTHLEVEL, EQUIPMENTNAME, POINTNAME)); return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.queryForLeftTableListByPointNum(STATION, SUBARRAY, HEALTHLEVEL, EQUIPMENTNAME, POINTNAME));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测设备级统计", notes = "预警监测设备级统计") @ApiOperation(httpMethod = "GET", value = "预警监测设备级统计", notes = "预警监测设备级统计")
@GetMapping(value = "/queryForPointNum") @GetMapping(value = "/queryForPointNum")
public ResponseModel<List<Map<String,Object>>> queryForLeftTableListByPointNum(@RequestParam(required = false) String STATION,@RequestParam(required = false) String SUBARRAY,@RequestParam(required = false) String EQUIPMENTNAME) { public ResponseModel<List<Map<String, Object>>> queryForLeftTableListByPointNum(@RequestParam(required = false) String STATION, @RequestParam(required = false) String SUBARRAY, @RequestParam(required = false) String EQUIPMENTNAME) {
List<IdxBizPvWarningRecord> idxBizPvWarningRecordList = idxBizPvHealthIndexServiceImpl.warningData(STATION, SUBARRAY, EQUIPMENTNAME); List<IdxBizPvWarningRecord> idxBizPvWarningRecordList = idxBizPvHealthIndexServiceImpl.warningData(STATION, SUBARRAY, EQUIPMENTNAME);
int total = idxBizPvHealthIndexServiceImpl.pointNum(STATION, SUBARRAY, EQUIPMENTNAME); int total = idxBizPvHealthIndexServiceImpl.pointNum(STATION, SUBARRAY, EQUIPMENTNAME);
Map<String,Object> map =new HashMap<>(); Map<String, Object> map = new HashMap<>();
Map<String,Object> map1 =new HashMap<>(); Map<String, Object> map1 = new HashMap<>();
Map<String,Object> warningNum =new HashMap<>(); Map<String, Object> warningNum = new HashMap<>();
Map<String,Object> pointNum =new HashMap<>(); Map<String, Object> pointNum = new HashMap<>();
map1.put("name","危险"); map1.put("name", "危险");
map1.put("value",idxBizPvWarningRecordList.stream().filter(e->e.getWarningName().equals("危险")).count()); map1.put("value", idxBizPvWarningRecordList.stream().filter(e -> e.getWarningName().equals("危险")).count());
map.put("name","警告"); map.put("name", "警告");
map.put("value",idxBizPvWarningRecordList.stream().filter(e->e.getWarningName().equals("警告")).count()); map.put("value", idxBizPvWarningRecordList.stream().filter(e -> e.getWarningName().equals("警告")).count());
warningNum.put("name","注意"); warningNum.put("name", "注意");
warningNum.put("value",idxBizPvWarningRecordList.stream().filter(e->e.getWarningName().equals("注意")).count()); warningNum.put("value", idxBizPvWarningRecordList.stream().filter(e -> e.getWarningName().equals("注意")).count());
pointNum.put("name","安全"); pointNum.put("name", "安全");
pointNum.put("value", Math.max((total - idxBizPvWarningRecordList.size()), 0)); pointNum.put("value", Math.max((total - idxBizPvWarningRecordList.size()), 0));
List<Map<String,Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<>();
list.add(pointNum); list.add(pointNum);
list.add(warningNum); list.add(warningNum);
list.add(map); list.add(map);
list.add(map1); list.add(map1);
return ResponseHelper.buildResponse(list); return ResponseHelper.buildResponse(list);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测设备级统计", notes = "预警监测设备级统计") @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/selectPointByANALYSISTYPE") @ApiOperation(httpMethod = "GET", value = "预警监测设备级统计", notes = "预警监测设备级统计")
public ResponseModel<Map<String,Object>> selectPointByANALYSISTYPE(@RequestParam(required = false) String STATION, @RequestParam(required = false)String HEALTHLEVEL,@RequestParam(required = false) String EQUIPMENTNAME,@RequestParam(required = false)String POINTNAME,@RequestParam(required = false)String SUBARRAY,@RequestParam(required = false)String startTime,@RequestParam(required = false) String endTime) { @GetMapping(value = "/selectPointByANALYSISTYPE")
public ResponseModel<Map<String, Object>> selectPointByANALYSISTYPE(@RequestParam(required = false) String STATION, @RequestParam(required = false) String HEALTHLEVEL, @RequestParam(required = false) String EQUIPMENTNAME, @RequestParam(required = false) String POINTNAME, @RequestParam(required = false) String SUBARRAY, @RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) {
List<Map<String, Object>> maps = idxBizPvHealthIndexServiceImpl.selectPointByANALYSISTYPE(STATION, HEALTHLEVEL, EQUIPMENTNAME, POINTNAME,SUBARRAY,startTime,endTime);
Map<String,Object> result = new HashMap<>(); List<Map<String, Object>> maps = idxBizPvHealthIndexServiceImpl.selectPointByANALYSISTYPE(STATION, HEALTHLEVEL, EQUIPMENTNAME, POINTNAME, SUBARRAY, startTime, endTime);
List<Object> seriesData = new ArrayList<>(); Map<String, Object> result = new HashMap<>();
List<Object> axisData = new ArrayList<>(); List<Object> seriesData = new ArrayList<>();
Collections.reverse(seriesData); List<Object> axisData = new ArrayList<>();
Collections.reverse(axisData); Collections.reverse(seriesData);
Collections.reverse(axisData);
for (Map<String, Object> map : maps) {
seriesData.add(map.get("value")); for (Map<String, Object> map : maps) {
axisData.add(map.get("REC_DATE")); seriesData.add(map.get("value"));
} axisData.add(map.get("REC_DATE"));
}
result.put("seriesData",seriesData);
result.put("axisData",axisData); result.put("seriesData", seriesData);
return ResponseHelper.buildResponse(result);} result.put("axisData", axisData);
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "TD 光伏场站/设备列表通用接口", notes = "TD 光伏场站/设备列表通用接口")
@GetMapping(value = "/pointHealthIndexTable") @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
public ResponseModel<Page> pointHealthIndexTable(@RequestParam(value = "area",required = false) String area, @ApiOperation(httpMethod = "GET", value = "TD 光伏场站/设备列表通用接口", notes = "TD 光伏场站/设备列表通用接口")
@RequestParam(value = "station",required = false) String station, @GetMapping(value = "/pointHealthIndexTable")
@RequestParam(value = "analysisObjType",required = false) String analysisObjType, public ResponseModel<Page> pointHealthIndexTable(@RequestParam(value = "area", required = false) String area,
@RequestParam(value = "analysisType",required = false) String analysisType, @RequestParam(value = "station", required = false) String station,
@RequestParam(value = "endTimeTop",required = false) String endTimeTop, @RequestParam(value = "analysisObjType", required = false) String analysisObjType,
@RequestParam(value = "startTimeTop",required = false) String startTimeTop, @RequestParam(value = "analysisType", required = false) String analysisType,
@RequestParam(value = "indexAddress",required = false) String indexAddress, @RequestParam(value = "endTimeTop", required = false) String endTimeTop,
@RequestParam(value = "pointName",required = false) String pointName, @RequestParam(value = "startTimeTop", required = false) String startTimeTop,
@RequestParam(value = "equipmentName",required = false) String equipmentName, @RequestParam(value = "indexAddress", required = false) String indexAddress,
@RequestParam(value = "healthLevel",required = false) String healthLevel, @RequestParam(value = "pointName", required = false) String pointName,
@RequestParam(value = "type",required = false) String type, @RequestParam(value = "equipmentName", required = false) String equipmentName,
@RequestParam(value = "requiredType",required = false) String requiredType, @RequestParam(value = "healthLevel", required = false) String healthLevel,
@RequestParam(value = "current",required = false) Integer current, @RequestParam(value = "type", required = false) String type,
@RequestParam(value = "size",required = false) Integer size, @RequestParam(value = "requiredType", required = false) String requiredType,
@RequestParam(value = "subarray",required = false) String subarray){ @RequestParam(value = "current", required = false) Integer current,
@RequestParam(value = "size", required = false) Integer size,
@RequestParam(value = "subarray", required = false) String subarray) {
List<String> gatewayIds = permissionService.getCurrentUserAmosOrgCodes();
String orgCode = "NULL";
if(gatewayIds.size()>0){ List<String> gatewayIds = permissionService.getCurrentUserAmosOrgCodes();
orgCode =gatewayIds.get(0)+"%"; String orgCode = "NULL";
} if (gatewayIds.size() > 0) {
if (requiredType.equals(WarningPeriodEnum.DAY.getName())){ orgCode = gatewayIds.get(0) + "%";
Date startDayTime = DateUtils.getCurrentDayStartTime(new Date()); }
Date date = DateUtils.dateAddHours(startDayTime, -9); if (requiredType.equals(WarningPeriodEnum.DAY.getName())) {
startTimeTop = DateUtil.format(date,DatePattern.NORM_DATETIME_PATTERN); Date startDayTime = DateUtils.getCurrentDayStartTime(new Date());
List<PvHealthIndexDay> fanHealthIndexDays = pvHealthIndexDayMapper.selectData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName,(current-1)*size,size, orgCode); Date date = DateUtils.dateAddHours(startDayTime, -9);
int total = pvHealthIndexDayMapper.selectDataTotal(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName, orgCode); startTimeTop = DateUtil.format(date, DatePattern.NORM_DATETIME_PATTERN);
List<PvHealthIndexDay> pvHealthIndexDays = pvHealthIndexDayMapper.selectData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName, (current - 1) * size, size, orgCode);
if(CollectionUtils.isEmpty(fanHealthIndexDays)){ int total = pvHealthIndexDayMapper.selectDataTotal(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName, orgCode);
fanHealthIndexDays = pvHealthIndexDayMapper.selectLatestData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, null, null, equipmentName, (current-1)*size,size,orgCode);
if(CollectionUtils.isEmpty(fanHealthIndexDays)){ if (CollectionUtils.isEmpty(pvHealthIndexDays)) {
logger.warn("根据条件:area:{},station:{},equipmentName:{},subarray:{},pointName:{},analysisObjType:{}获取最新的数据为空",area,station,equipmentName,subarray,pointName,analysisObjType); pvHealthIndexDays = pvHealthIndexDayMapper.selectLatestData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, null, null, equipmentName, (current - 1) * size, size, orgCode);
total = 0; if (CollectionUtils.isEmpty(pvHealthIndexDays)) {
}else{ logger.warn("根据条件:area:{},station:{},equipmentName:{},subarray:{},pointName:{},analysisObjType:{}获取最新的数据为空", area, station, equipmentName, subarray, pointName, analysisObjType);
total = fanHealthIndexDays.size(); total = 0;
} } else {
} total = pvHealthIndexDays.size();
fanHealthIndexDays.forEach(item -> { }
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex()))); }
}); pvHealthIndexDays.forEach(item -> {
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex())));
Page page = new Page<>(); });
page.setCurrent(current);
page.setSize(size); Page page = new Page<>();
page.setRecords(fanHealthIndexDays); page.setCurrent(current);
page.setTotal(total); page.setSize(size);
return ResponseHelper.buildResponse(page); page.setRecords(pvHealthIndexDays);
}else if (requiredType.equals(WarningPeriodEnum.HOUR.getName())){ page.setTotal(total);
Date date = new Date(); return ResponseHelper.buildResponse(page);
date = DateUtil.offsetHour(date,-8); } else if (requiredType.equals(WarningPeriodEnum.HOUR.getName())) {
date = DateUtil.offsetMinute(date,-59); Date date = new Date();
startTimeTop = DateUtil.format(date,DatePattern.NORM_DATETIME_PATTERN); date = DateUtil.offsetHour(date, -8);
List<PvHealthIndexHour> fanHealthIndexHours = pvHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, orgCode); date = DateUtil.offsetMinute(date, -59);
int total = pvHealthIndexHourMapper.selectDataTotal(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, orgCode); startTimeTop = DateUtil.format(date, DatePattern.NORM_DATETIME_PATTERN);
if(CollectionUtils.isEmpty(fanHealthIndexHours)){ List<PvHealthIndexHour> pvHealthIndexHours = pvHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, (current - 1) * size, size, orgCode);
fanHealthIndexHours = pvHealthIndexHourMapper.selectLatestData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, null, null, equipmentName, (current-1)*size,size,orgCode); int total = pvHealthIndexHourMapper.selectDataTotal(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, orgCode);
if(CollectionUtils.isEmpty(fanHealthIndexHours)){ if (CollectionUtils.isEmpty(pvHealthIndexHours)) {
logger.warn("根据条件:area:{},station:{},equipmentName:{},subarray:{},pointName:{},analysisObjType:{}获取最新的数据为空",area,station,equipmentName,subarray,pointName,analysisObjType); pvHealthIndexHours = pvHealthIndexHourMapper.selectLatestData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, null, null, equipmentName, (current - 1) * size, size, orgCode);
total = 0; if (CollectionUtils.isEmpty(pvHealthIndexHours)) {
}else{ logger.warn("根据条件:area:{},station:{},equipmentName:{},subarray:{},pointName:{},analysisObjType:{}获取最新的数据为空", area, station, equipmentName, subarray, pointName, analysisObjType);
total = fanHealthIndexHours.size(); total = 0;
} } else {
} total = pvHealthIndexHours.size();
fanHealthIndexHours.forEach(item -> { }
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex()))); }
}); pvHealthIndexHours.forEach(item -> {
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex())));
Page page = new Page<>(); });
page.setCurrent(current);
page.setSize(size); Page page = new Page<>();
page.setRecords(fanHealthIndexHours); page.setCurrent(current);
page.setTotal(total); page.setSize(size);
return ResponseHelper.buildResponse(page); page.setRecords(pvHealthIndexHours);
}else { page.setTotal(total);
Date date = DateUtils.dateAddMinutes(null,-9); return ResponseHelper.buildResponse(page);
date = DateUtils.dateAddHours(date, -8); } else {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = DateUtils.dateAddMinutes(null, -9);
startTimeTop = formatter.format(date); date = DateUtils.dateAddHours(date, -8);
List<PvHealthIndexMoment> fanHealthIndexMoments = pvHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, orgCode); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
int total = pvHealthIndexMomentMapper.selectDataTotal(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, orgCode); startTimeTop = formatter.format(date);
if(CollectionUtils.isEmpty(fanHealthIndexMoments)){ List<PvHealthIndexMoment> pvHealthIndexMoments = pvHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, (current - 1) * size, size, orgCode);
fanHealthIndexMoments = pvHealthIndexMomentMapper.selectLatestData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, null, null, equipmentName, (current-1)*size,size,orgCode); int total = pvHealthIndexMomentMapper.selectDataTotal(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop, orgCode);
if(CollectionUtils.isEmpty(fanHealthIndexMoments)){ if (CollectionUtils.isEmpty(pvHealthIndexMoments)) {
logger.warn("根据条件:area:{},station:{},equipmentName:{},subarray:{},pointName:{},analysisObjType:{}获取最新的数据为空",area,station,equipmentName,subarray,pointName,analysisObjType); pvHealthIndexMoments = pvHealthIndexMomentMapper.selectLatestData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, null, null, equipmentName, (current - 1) * size, size, orgCode);
total = 0; if (CollectionUtils.isEmpty(pvHealthIndexMoments)) {
}else{ logger.warn("根据条件:area:{},station:{},equipmentName:{},subarray:{},pointName:{},analysisObjType:{}获取最新的数据为空", area, station, equipmentName, subarray, pointName, analysisObjType);
total = fanHealthIndexMoments.size(); total = 0;
} } else {
} total = pvHealthIndexMoments.size();
fanHealthIndexMoments.forEach(item -> { }
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex()))); }
}); pvHealthIndexMoments.forEach(item -> {
Page page = new Page<>(); item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex())));
page.setCurrent(current); });
page.setSize(size); Page page = new Page<>();
page.setRecords(fanHealthIndexMoments); page.setCurrent(current);
page.setTotal(total); page.setSize(size);
return ResponseHelper.buildResponse(page); page.setRecords(pvHealthIndexMoments);
} page.setTotal(total);
} return ResponseHelper.buildResponse(page);
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "仪表盘", notes = "仪表盘")
@GetMapping(value = "/pointHealthIndexTableByPanel") @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
public ResponseModel<Map<String, Object>> pointHealthIndexTableByPanel(@RequestParam(value = "area",required = false) String area, @ApiOperation(httpMethod = "GET", value = "仪表盘", notes = "仪表盘")
@RequestParam(value = "station",required = false) String station, @GetMapping(value = "/pointHealthIndexTableByPanel")
@RequestParam(value = "analysisObjType",required = false) String analysisObjType, public ResponseModel<Map<String, Object>> pointHealthIndexTableByPanel(@RequestParam(value = "area", required = false) String area,
@RequestParam(value = "analysisType",required = false) String analysisType, @RequestParam(value = "station", required = false) String station,
@RequestParam(value = "endTimeTop",required = false) String endTimeTop, @RequestParam(value = "analysisObjType", required = false) String analysisObjType,
@RequestParam(value = "startTimeTop",required = false) String startTimeTop, @RequestParam(value = "analysisType", required = false) String analysisType,
@RequestParam(value = "indexAddress",required = false) String indexAddress, @RequestParam(value = "endTimeTop", required = false) String endTimeTop,
@RequestParam(value = "pointName",required = false) String pointName, @RequestParam(value = "startTimeTop", required = false) String startTimeTop,
@RequestParam(value = "equipmentName",required = false) String equipmentName, @RequestParam(value = "indexAddress", required = false) String indexAddress,
@RequestParam(value = "healthLevel",required = false) String healthLevel, @RequestParam(value = "pointName", required = false) String pointName,
@RequestParam(value = "type",required = false) String type, @RequestParam(value = "equipmentName", required = false) String equipmentName,
@RequestParam(value = "requiredType",required = false) String requiredType, @RequestParam(value = "healthLevel", required = false) String healthLevel,
@RequestParam(value = "current",required = false) Integer current, @RequestParam(value = "type", required = false) String type,
@RequestParam(value = "size",required = false) Integer size, @RequestParam(value = "requiredType", required = false) String requiredType,
@RequestParam(value = "subarray",required = false) String subarray){ @RequestParam(value = "current", required = false) Integer current,
@RequestParam(value = "size", required = false) Integer size,
@RequestParam(value = "subarray", required = false) String subarray) {
List<String> gatewayIds = permissionService.getCurrentUserAmosOrgCodes();
String orgCode = "NULL";
if(gatewayIds.size()>0){ List<String> gatewayIds = permissionService.getCurrentUserAmosOrgCodes();
orgCode =gatewayIds.get(0)+"%"; String orgCode = "NULL";
} if (gatewayIds.size() > 0) {
if (requiredType.equals(WarningPeriodEnum.DAY.getName())){ orgCode = gatewayIds.get(0) + "%";
Date startDayTime = DateUtils.getCurrentDayStartTime(new Date()); }
Date date = DateUtils.dateAddHours(startDayTime, -9); if (requiredType.equals(WarningPeriodEnum.DAY.getName())) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date startDayTime = DateUtils.getCurrentDayStartTime(new Date());
startTimeTop = formatter.format(date); Date date = DateUtils.dateAddHours(startDayTime, -9);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
List<PvHealthIndexDay> fanHealthIndexDays = pvHealthIndexDayMapper.selectData(station, requiredType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName,(current-1)*size,size, orgCode); startTimeTop = formatter.format(date);
List<PvHealthIndexDay> pvHealthIndexDays = pvHealthIndexDayMapper.selectData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName, (current - 1) * size, size, orgCode);
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
Double value=null; Double value = 0.00;
if(CollectionUtil.isNotEmpty(fanHealthIndexDays)){ if (CollectionUtil.isNotEmpty(pvHealthIndexDays)) {
value = Double.parseDouble(df.format(fanHealthIndexDays.get(0).getHealthIndex())); value = Double.parseDouble(df.format(pvHealthIndexDays.get(0).getHealthIndex()));
} }
map.put("value", value);
map.put("value", value); return ResponseHelper.buildResponse(map);
} else if (requiredType.equals(WarningPeriodEnum.HOUR.getName())) {
return ResponseHelper.buildResponse(map); Date date = new Date();
date = DateUtil.offsetHour(date, -8);
date = DateUtil.offsetMinute(date, -59);
startTimeTop = DateUtil.format(date, DatePattern.NORM_DATETIME_PATTERN);
List<PvHealthIndexHour> pvHealthIndexHours = pvHealthIndexHourMapper.selectData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName, (current - 1) * size, size, orgCode);
}else if (requiredType.equals(WarningPeriodEnum.HOUR.getName())){ Map<String, Object> map = new HashMap<>();
Double value = 0.00;
Date date = new Date(); if (CollectionUtil.isNotEmpty(pvHealthIndexHours)) {
date = DateUtil.offsetHour(date,-8); value = Double.parseDouble(df.format(pvHealthIndexHours.get(0).getHealthIndex()));
date = DateUtil.offsetMinute(date,-59); }
startTimeTop = DateUtil.format(date,DatePattern.NORM_DATETIME_PATTERN); map.put("value", value);
List<PvHealthIndexHour> fanHealthIndexHours = pvHealthIndexHourMapper.selectData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName,(current-1)*size,size, orgCode); return ResponseHelper.buildResponse(map);
Map<String,Object> map = new HashMap<>(); } else {
Date date = DateUtils.dateAddMinutes(null, -9);
date = DateUtils.dateAddHours(date, -8);
map.put("value", Double.parseDouble(df.format(fanHealthIndexHours.get(0).getHealthIndex()))); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
startTimeTop = formatter.format(date);
return ResponseHelper.buildResponse(map); List<PvHealthIndexMoment> pvHealthIndexMoment = pvHealthIndexMomentMapper.selectData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName, (current - 1) * size, size, orgCode);
}else { Map<String, Object> map = new HashMap<>();
Date date = DateUtils.dateAddMinutes(null,-9); Double value = 0.00;
date = DateUtils.dateAddHours(date, -8); if (CollectionUtil.isNotEmpty(pvHealthIndexMoment)) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); value = Double.parseDouble(df.format(pvHealthIndexMoment.get(0).getHealthIndex()));
startTimeTop = formatter.format(date); }
List<PvHealthIndexMoment> fanHealthIndexMoments = pvHealthIndexMomentMapper.selectData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName,(current-1)*size,size, orgCode); map.put("value", value);
Map<String,Object> map = new HashMap<>(); return ResponseHelper.buildResponse(map);
}
map.put("value", Double.parseDouble(df.format(fanHealthIndexMoments.get(0).getHealthIndex()))); }
return ResponseHelper.buildResponse(map);
} @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
} @ApiOperation(httpMethod = "GET", value = "TD 光伏折线图", notes = "TD光伏折线图")
@GetMapping(value = "/pointHealthIndexTrend")
public ResponseModel<Object> pointHealthIndexTrend(@RequestParam(value = "area", required = false) String area,
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @RequestParam(value = "station", required = false) String station,
@ApiOperation(httpMethod = "GET",value = "TD 光伏折线图", notes = "TD光伏折线图") @RequestParam(value = "analysisObjType", required = false) String analysisObjType,
@GetMapping(value = "/pointHealthIndexTrend") @RequestParam(value = "analysisType", required = false) String analysisType,
public ResponseModel<Object> pointHealthIndexTrend(@RequestParam(value = "area",required = false) String area, @RequestParam(value = "endTimeTop", required = false) String endTimeTop,
@RequestParam(value = "station",required = false) String station, @RequestParam(value = "startTimeTop", required = false) String startTimeTop,
@RequestParam(value = "analysisObjType",required = false) String analysisObjType, @RequestParam(value = "indexAddress", required = false) String indexAddress,
@RequestParam(value = "analysisType",required = false) String analysisType, @RequestParam(value = "pointName", required = false) String pointName,
@RequestParam(value = "endTimeTop",required = false) String endTimeTop, @RequestParam(value = "equipmentName", required = false) String equipmentName,
@RequestParam(value = "startTimeTop",required = false) String startTimeTop, @RequestParam(value = "healthLevel", required = false) String healthLevel,
@RequestParam(value = "indexAddress",required = false) String indexAddress, @RequestParam(value = "type", required = false) String type,
@RequestParam(value = "pointName",required = false) String pointName, @RequestParam(value = "requiredType", required = false) String requiredType,
@RequestParam(value = "equipmentName",required = false) String equipmentName, @RequestParam(value = "current", required = false) Integer current,
@RequestParam(value = "healthLevel",required = false) String healthLevel, @RequestParam(value = "size", required = false) Integer size,
@RequestParam(value = "type",required = false) String type, @RequestParam(value = "subarray", required = false) String subarray) {
@RequestParam(value = "requiredType",required = false) String requiredType,
@RequestParam(value = "current",required = false) Integer current, Map<String, Object> result = new HashMap<>();
@RequestParam(value = "size",required = false) Integer size, List<Object> seriesData = new ArrayList<>();
@RequestParam(value = "subarray",required = false) String subarray) { List<Object> axisData = new ArrayList<>();
List<String> gatewayIds = permissionService.getCurrentUserAmosOrgCodes();
Map<String,Object> result = new HashMap<>(); String orgCode = "NULL";
List<Object> seriesData = new ArrayList<>(); if (gatewayIds.size() > 0) {
List<Object> axisData = new ArrayList<>(); orgCode = gatewayIds.get(0) + "%";
List<String> gatewayIds = permissionService.getCurrentUserAmosOrgCodes(); }
String orgCode = "NULL"; if (WarningPeriodEnum.DAY.getName().equals(requiredType)) {
if(gatewayIds.size()>0){ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
orgCode =gatewayIds.get(0)+"%"; if (null != endTimeTop) {
} Date endDate = DateUtils.dateParse(endTimeTop);
if (WarningPeriodEnum.DAY.getName().equals(requiredType)){ endTimeTop = formatter.format(endDate);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); }
if ( null != endTimeTop){ //处理空指针问题 如果为空差15天前数据
Date endDate =DateUtils.dateParse(endTimeTop); if (StrUtil.isEmpty(startTimeTop)) {
endTimeTop = formatter.format(endDate); startTimeTop = LocalDateTime.now().minusDays(15).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
} }
//处理空指针问题 如果为空差15天前数据 Date startDate = DateUtils.dateParse(startTimeTop);
if(StrUtil.isEmpty(startTimeTop)){ startTimeTop = formatter.format(startDate);
startTimeTop = LocalDateTime.now().minusDays(15).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
} List<PvHealthIndexDay> pvHealthIndexDays = pvHealthIndexDayMapper.selectTrendData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName, null, null, orgCode);
Date startDate = DateUtils.dateParse(startTimeTop); pvHealthIndexDays = pvHealthIndexDays.stream().sorted(Comparator.comparing(PvHealthIndexDay::getRecDate)).collect(Collectors.toList());
startTimeTop = formatter.format(startDate);
for (PvHealthIndexDay obj : pvHealthIndexDays) {
List<PvHealthIndexDay> fanHealthIndexDays = pvHealthIndexDayMapper.selectTrendData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName, null, null, orgCode); if (type.equals("0")) {
fanHealthIndexDays= fanHealthIndexDays.stream().sorted(Comparator.comparing(PvHealthIndexDay::getRecDate)).collect(Collectors.toList()); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
} else {
for (PvHealthIndexDay obj : fanHealthIndexDays) { seriesData.add(obj.getAnomaly() > 7.5 ? 7.5 : dfSS.format(obj.getAnomaly()));
if (type.equals("0")){ }
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); axisData.add(obj.getRecDate());
}else { }
seriesData.add(obj.getAnomaly() > 7.5?7.5:dfSS.format(obj.getAnomaly())); result.put("seriesData", seriesData);
} result.put("axisData", axisData);
axisData.add(obj.getRecDate()); return ResponseHelper.buildResponse(result);
} } else if (WarningPeriodEnum.HOUR.getName().equals(requiredType)) {
result.put("seriesData",seriesData); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
result.put("axisData",axisData); if (null != endTimeTop) {
return ResponseHelper.buildResponse(result); Date endDate = DateUtils.dateParse(endTimeTop);
}else if (WarningPeriodEnum.HOUR.getName().equals(requiredType)){ endTimeTop = formatter.format(endDate);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); }
if ( null != endTimeTop){ Date startDate = DateUtils.dateParse(startTimeTop);
Date endDate = DateUtils.dateParse(endTimeTop); startTimeTop = formatter.format(startDate);
endTimeTop = formatter.format(endDate); List<PvHealthIndexHour> pvHealthIndexHours = pvHealthIndexHourMapper.selectData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName, (current - 1) * size, size, orgCode);
} pvHealthIndexHours = pvHealthIndexHours.stream().sorted(Comparator.comparing(PvHealthIndexHour::getRecDate)).collect(Collectors.toList());
Date startDate = DateUtils.dateParse(startTimeTop); for (PvHealthIndexHour obj : pvHealthIndexHours) {
startTimeTop = formatter.format(startDate); if (type.equals("0")) {
List<PvHealthIndexHour> fanHealthIndexHours = pvHealthIndexHourMapper.selectTrendData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
fanHealthIndexHours= fanHealthIndexHours.stream().sorted(Comparator.comparing(PvHealthIndexHour::getRecDate)).collect(Collectors.toList()); } else {
for (PvHealthIndexHour obj : fanHealthIndexHours) { seriesData.add(obj.getAnomaly() > 7.5 ? 7.5 : dfSS.format(obj.getAnomaly()));
if (type.equals("0")){ }
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); axisData.add(obj.getRecDate());
}else { }
seriesData.add(obj.getAnomaly() > 7.5?7.5:dfSS.format(obj.getAnomaly())); result.put("seriesData", seriesData);
} result.put("axisData", axisData);
// Date dateTime = DateUtil.parseDateTime(obj.getAnalysisTime()); return ResponseHelper.buildResponse(result);
// String format = DateUtil.format(dateTime, "yyyy-MM-dd HH:00"); } else {
axisData.add(obj.getRecDate()); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
} if (null != endTimeTop) {
result.put("seriesData",seriesData); Date endDate = DateUtils.dateParse(endTimeTop);
result.put("axisData",axisData); endTimeTop = formatter.format(endDate);
return ResponseHelper.buildResponse(result); }
}else { Date startDate = DateUtils.dateParse(startTimeTop);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); startTimeTop = formatter.format(startDate);
SimpleDateFormat formatterNYRSF = new SimpleDateFormat("yyyy-MM-dd HH:mm"); List<PvHealthIndexMoment> pvHealthIndexMoment = pvHealthIndexMomentMapper.selectData(station, analysisType, indexAddress, healthLevel, area, analysisObjType, subarray, pointName, startTimeTop, endTimeTop, equipmentName, (current - 1) * size, size, orgCode);
pvHealthIndexMoment = pvHealthIndexMoment.stream().sorted(Comparator.comparing(PvHealthIndexMoment::getAnalysisTime)).collect(Collectors.toList());
if ( null != endTimeTop){ for (PvHealthIndexMoment obj : pvHealthIndexMoment) {
Date endDate = DateUtils.dateParse(endTimeTop); if (type.equals("0")) {
endTimeTop = formatter.format(endDate); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
} } else {
Date startDate = DateUtils.dateParse(startTimeTop); seriesData.add(obj.getAnomaly() > 7.5 ? 7.5 : dfSS.format(obj.getAnomaly()));
startTimeTop = formatter.format(startDate); }
axisData.add(obj.getRecDate());
List<PvHealthIndexMoment> fanHealthIndexMoments = pvHealthIndexMomentMapper.selectTrendData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null, orgCode); }
fanHealthIndexMoments= fanHealthIndexMoments.stream().sorted(Comparator.comparing(PvHealthIndexMoment::getAnalysisTime)).collect(Collectors.toList()); result.put("seriesData", seriesData);
for (PvHealthIndexMoment obj : fanHealthIndexMoments) { result.put("axisData", axisData);
if (type.equals("0")){ return ResponseHelper.buildResponse(result);
seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex()))); }
}else { }
seriesData.add(obj.getAnomaly() > 7.5?7.5:dfSS.format(obj.getAnomaly()));
} @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
// Date dateTime = DateUtil.parseDateTime(obj.getAnalysisTime()); @ApiOperation(httpMethod = "GET", value = "预警监测设备级统计 TD", notes = "预警监测设备级统计 TD")
// String format = DateUtil.format(dateTime, DatePattern.NORM_DATETIME_MINUTE_PATTERN); @GetMapping(value = "/selectPointNum")
axisData.add(obj.getRecDate()); public ResponseModel<List<Map<String, Object>>> selectPointNum(@RequestParam(required = false) String STATION, @RequestParam(required = false) String SUBARRAY, @RequestParam(required = false) String EQUIPMENTNAME, @RequestParam(value = "requiredType", required = false) String requiredType) {
} List<String> gatewayIds = this.getGatewayIds();
result.put("seriesData",seriesData); String startTimeTop;
result.put("axisData",axisData); List<Map<String, Object>> maps;
return ResponseHelper.buildResponse(result); if (requiredType.equals(WarningPeriodEnum.DAY.getName())) {
} Date startDayTime = DateUtils.getCurrentDayStartTime(new Date());
} Date date = DateUtils.dateAddHours(startDayTime, -9);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) startTimeTop = formatter.format(date);
@ApiOperation(httpMethod = "GET",value = "预警监测设备级统计 TD", notes = "预警监测设备级统计 TD") maps = pvHealthIndexDayMapper.selectEquipStatusByEquipment("测点", STATION, EQUIPMENTNAME, SUBARRAY, gatewayIds,startTimeTop);
@GetMapping(value = "/selectPointNum") }else if (requiredType.equals(WarningPeriodEnum.HOUR.getName())) {
public ResponseModel<List<Map<String,Object>>> selectPointNum(@RequestParam(required = false) String STATION,@RequestParam(required = false) String SUBARRAY,@RequestParam(required = false) String EQUIPMENTNAME) { Date date = new Date();
List<String> gatewayIds = this.getGatewayIds(); date = DateUtil.offsetHour(date, -8);
List<Map<String, Object>> maps = pvHealthIndexDayMapper.selectEquipStatusByEquipment( "测点", STATION,EQUIPMENTNAME, SUBARRAY, gatewayIds); date = DateUtil.offsetMinute(date, -59);
if (maps.size() == 4){ startTimeTop = DateUtil.format(date, DatePattern.NORM_DATETIME_PATTERN);
for (Map<String, Object> map : maps) { maps = pvHealthIndexHourMapper.selectEquipStatusByEquipment("测点", STATION, EQUIPMENTNAME, SUBARRAY, gatewayIds,startTimeTop);
map.put("name",map.get("healthlevel")); } else {
} Date date = DateUtils.dateAddMinutes(null, -9);
} else { date = DateUtils.dateAddHours(date, -8);
List<String> levels = new ArrayList<>(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
levels.add("安全"); startTimeTop = formatter.format(date);
levels.add("注意"); maps = pvHealthIndexMomentMapper.selectEquipStatusByEquipment("测点", STATION, EQUIPMENTNAME, SUBARRAY, gatewayIds,startTimeTop);
levels.add("警告"); }
levels.add("危险"); 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")); }
String healthlevel = map.get("healthlevel").toString(); } else {
levels.remove(healthlevel); List<String> levels = new ArrayList<>();
} levels.add("安全");
levels.add("注意");
if (levels.size()>0){ levels.add("警告");
for (String s : levels) { levels.add("危险");
Map<String, Object> map = new HashMap<>();
map.put("name",s); for (Map<String, Object> map : maps) {
map.put("value",0); map.put("name", map.get("healthlevel"));
map.put("sort",HealthLevelSortEnum.getCode(s)); String healthlevel = map.get("healthlevel").toString();
maps.add(map); levels.remove(healthlevel);
} }
maps = maps.stream().sorted(Comparator.comparingLong(e -> Long.valueOf(e.get("sort").toString()))).collect(Collectors.toList());
} if (levels.size() > 0) {
} for (String s : levels) {
return ResponseHelper.buildResponse(maps); Map<String, Object> map = new HashMap<>();
} map.put("name", s);
map.put("value", 0);
map.put("sort", HealthLevelSortEnum.getCode(s));
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) maps.add(map);
@GetMapping(value = "/selectWarningPoint") }
@ApiOperation(httpMethod = "GET", value = "预警监测设备右侧预警重复列表", notes = "预警监测设备右侧预警重复列表") maps = maps.stream().sorted(Comparator.comparingLong(e -> Long.valueOf(e.get("sort").toString()))).collect(Collectors.toList());
public ResponseModel<Page<PvWarningRecord>> selectFanWarningNum(@RequestParam String STATION,@RequestParam String EQUIPMENTNAME,@RequestParam(required = false) String SUBARRAY,Integer current,Integer size) { }
Page<PvWarningRecord> page = new Page<>(); }
page.setCurrent(current); return ResponseHelper.buildResponse(maps);
page.setSize(size); }
List<String> gatewayIds = this.getGatewayIds();
List<PvWarningRecord> maps = pvWaringRecordMapper.selectWarningPoint(STATION,EQUIPMENTNAME,SUBARRAY,(current-1)*size,size, gatewayIds);
page.setRecords(maps); @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
int total = pvWaringRecordMapper.selectWarningPointTotal(STATION, EQUIPMENTNAME,SUBARRAY, gatewayIds); @GetMapping(value = "/selectWarningPoint")
page.setTotal(total); @ApiOperation(httpMethod = "GET", value = "预警监测设备右侧预警重复列表", notes = "预警监测设备右侧预警重复列表")
return ResponseHelper.buildResponse(page); public ResponseModel<Page<PvWarningRecord>> selectFanWarningNum(@RequestParam String STATION, @RequestParam String EQUIPMENTNAME, @RequestParam(required = false) String SUBARRAY, Integer current, Integer size) {
} Page<PvWarningRecord> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) List<String> gatewayIds = this.getGatewayIds();
@GetMapping(value = "/selectEquipWarningTotal") List<PvWarningRecord> maps = pvWaringRecordMapper.selectWarningPoint(STATION, EQUIPMENTNAME, SUBARRAY, (current - 1) * size, size, gatewayIds);
@ApiOperation(httpMethod = "GET", value = "预警信息统计富文本", notes = "预警信息统计富文本") page.setRecords(maps);
public ResponseModel<Map<String,Object>> selectEquipWarningTotal(@RequestParam String STATION,@RequestParam String EQUIPMENTNAME,@RequestParam(required = false) String SUBARRAY) { int total = pvWaringRecordMapper.selectWarningPointTotal(STATION, EQUIPMENTNAME, SUBARRAY, gatewayIds);
List<String> gatewayIds = this.getGatewayIds(); page.setTotal(total);
Map<String, Object> map = pvWaringRecordMapper.selectEquipWarningTotal(STATION,EQUIPMENTNAME,SUBARRAY, gatewayIds); return ResponseHelper.buildResponse(page);
return ResponseHelper.buildResponse(map); }
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "查询场站下设备状态统计", notes = "查询场站下设备状态统计") @GetMapping(value = "/selectEquipWarningTotal")
@GetMapping (value = "/selectEquipStatusByStationPv") @ApiOperation(httpMethod = "GET", value = "预警信息统计富文本", notes = "预警信息统计富文本")
public ResponseModel<List<Map<String,Object>>> selectEquipStatusByStationPv(@RequestParam(value = "area",required = false) String area, public ResponseModel<Map<String, Object>> selectEquipWarningTotal(@RequestParam String STATION, @RequestParam String EQUIPMENTNAME, @RequestParam(required = false) String SUBARRAY) {
@RequestParam(value = "station",required = false) String station, List<String> gatewayIds = this.getGatewayIds();
@RequestParam(value = "analysisObjType",required = false) String analysisObjType Map<String, Object> map = pvWaringRecordMapper.selectEquipWarningTotal(STATION, EQUIPMENTNAME, SUBARRAY, gatewayIds);
) { return ResponseHelper.buildResponse(map);
List<String> gatewayIds = this.getGatewayIds(); }
List<Map<String, Object>> maps = pvHealthIndexDayMapper.selectEquipStatusByStationPv(area, analysisObjType, station, gatewayIds);
if (maps.size() == 4){ @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
for (Map<String, Object> map : maps) { @ApiOperation(httpMethod = "GET", value = "查询场站下设备状态统计", notes = "查询场站下设备状态统计")
map.put("name",map.get("healthlevel")); @GetMapping(value = "/selectEquipStatusByStationPv")
} public ResponseModel<List<Map<String, Object>>> selectEquipStatusByStationPv(@RequestParam(value = "area", required = false) String area,
} else { @RequestParam(value = "station", required = false) String station,
@RequestParam(value = "analysisObjType", required = false) String analysisObjType,
List<String> levels = new ArrayList<>(); @RequestParam(value = "requiredType", required = false) String requiredType
levels.add("安全"); ) {
levels.add("注意"); List<String> gatewayIds = this.getGatewayIds();
levels.add("警告"); List<Map<String, Object>> maps;
levels.add("危险"); String startTimeTop;
if (WarningPeriodEnum.DAY.getName().equals(requiredType)) {
for (Map<String, Object> map : maps) { Date startDayTime = DateUtils.getCurrentDayStartTime(new Date());
map.put("name",map.get("healthlevel")); Date date = DateUtils.dateAddHours(startDayTime, -9);
String healthlevel = map.get("healthlevel").toString(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
levels.remove(healthlevel); startTimeTop = formatter.format(date);
} maps = pvHealthIndexDayMapper.selectEquipStatusByStationPv(area, analysisObjType, station, gatewayIds,startTimeTop);
}else if (WarningPeriodEnum.HOUR.getName().equals(requiredType)) {
if (levels.size()>0){ Date date = new Date();
for (String s : levels) { date = DateUtil.offsetHour(date, -8);
Map<String, Object> map = new HashMap<>(); date = DateUtil.offsetMinute(date, -59);
map.put("name",s); startTimeTop = DateUtil.format(date, DatePattern.NORM_DATETIME_PATTERN);
map.put("value",0); maps = pvHealthIndexHourMapper.selectEquipStatusByStationPv(area, analysisObjType, station, gatewayIds,startTimeTop);
map.put("sort", HealthLevelSortEnum.getCode(s)); }else{
maps.add(map); Date date = DateUtils.dateAddMinutes(null, -9);
} date = DateUtils.dateAddHours(date, -8);
maps = maps.stream().sorted(Comparator.comparingLong(e -> Long.valueOf(e.get("sort").toString()))).collect(Collectors.toList()); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
} startTimeTop = formatter.format(date);
} maps = pvHealthIndexMomentMapper.selectEquipStatusByStationPv(area, analysisObjType, station, gatewayIds,startTimeTop);
return ResponseHelper.buildResponse(maps); }
} if (maps.size() == 4) {
for (Map<String, Object> map : maps) {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) map.put("name", map.get("healthlevel"));
@GetMapping(value = "/selectFanWarningNum") }
@ApiOperation(httpMethod = "GET", value = "查询各风机预警状况", notes = "查询各风机预警状况") } else {
public ResponseModel<Map<String,Object>> selectFanWarningNum(@RequestParam String station) {
List<String> levels = new ArrayList<>();
levels.add("安全");
LambdaQueryWrapper<IdxBizPvPointProcessVariableClassification> wrapper = new LambdaQueryWrapper<>(); levels.add("注意");
wrapper.select(IdxBizPvPointProcessVariableClassification::getSubarray); levels.add("警告");
wrapper.eq(IdxBizPvPointProcessVariableClassification::getStation, station); levels.add("危险");
wrapper.groupBy(IdxBizPvPointProcessVariableClassification::getSubarray);
wrapper.last(" ORDER BY SUBARRAY desc"); for (Map<String, Object> map : maps) {
List<IdxBizPvPointProcessVariableClassification> variableClassificationList = idxBizPvPointProcessVariableClassificationMapper.selectList(wrapper); map.put("name", map.get("healthlevel"));
Map<String, Object> resultMap = new HashMap<>(); String healthlevel = map.get("healthlevel").toString();
List<String> gatewayIds = this.getGatewayIds(); levels.remove(healthlevel);
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));
if (levels.size() > 0) {
List<Integer> wxList = new ArrayList<>(); for (String s : levels) {
List<Integer> zyList = new ArrayList<>(); Map<String, Object> map = new HashMap<>();
List<Integer> jgList = new ArrayList<>(); map.put("name", s);
List<String> list =new ArrayList<>(); map.put("value", 0);
for (Map<String, Object> map : maps) { map.put("sort", HealthLevelSortEnum.getCode(s));
wxList.add(Integer.valueOf(map.get("危险").toString())); maps.add(map);
zyList.add(Integer.valueOf(map.get("注意").toString())); }
jgList.add(Integer.valueOf(map.get("警告").toString())); maps = maps.stream().sorted(Comparator.comparingLong(e -> Long.valueOf(e.get("sort").toString()))).collect(Collectors.toList());
list.add(map.get("subarray").toString()); }
}
} return ResponseHelper.buildResponse(maps);
variableClassificationList.forEach(item -> { }
if (!equipmentNameInfoMap.containsKey(item.getSubarray())) {
wxList.add(0); @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
zyList.add(0); @GetMapping(value = "/selectFanWarningNum")
jgList.add(0); @ApiOperation(httpMethod = "GET", value = "查询各风机预警状况", notes = "查询各风机预警状况")
list.add(item.getSubarray()); public ResponseModel<Map<String, Object>> selectFanWarningNum(@RequestParam String station) {
}
});
LambdaQueryWrapper<IdxBizPvPointProcessVariableClassification> wrapper = new LambdaQueryWrapper<>();
HashMap<String, Object> wxMapResult = new HashMap<>(); wrapper.select(IdxBizPvPointProcessVariableClassification::getSubarray);
wxMapResult.put("data", wxList); wrapper.eq(IdxBizPvPointProcessVariableClassification::getStation, station);
wxMapResult.put("name", "危险"); wrapper.groupBy(IdxBizPvPointProcessVariableClassification::getSubarray);
HashMap<String, Object> zyMapResult = new HashMap<>(); wrapper.last(" ORDER BY SUBARRAY desc");
zyMapResult.put("data", zyList); List<IdxBizPvPointProcessVariableClassification> variableClassificationList = idxBizPvPointProcessVariableClassificationMapper.selectList(wrapper);
zyMapResult.put("name", "注意"); Map<String, Object> resultMap = new HashMap<>();
HashMap<String, Object> jgMapResult = new HashMap<>(); List<String> gatewayIds = this.getGatewayIds();
jgMapResult.put("data", jgList); List<Map<String, Object>> maps = pvWaringRecordMapper.selectFanWarningNum(station, gatewayIds);
jgMapResult.put("name", "警告"); Map<String, Map<String, Object>> equipmentNameInfoMap = maps.stream().collect(Collectors.toMap(t -> t.get("subarray").toString(), t -> t));
List<Map<String, Object>> hashMaps = Arrays.asList(wxMapResult, zyMapResult, jgMapResult); List<Integer> wxList = new ArrayList<>();
resultMap.put("axisData", list); List<Integer> zyList = new ArrayList<>();
resultMap.put("seriesData", hashMaps); List<Integer> jgList = new ArrayList<>();
return ResponseHelper.buildResponse(resultMap); List<String> list = new ArrayList<>();
for (Map<String, Object> map : maps) {
} wxList.add(Integer.valueOf(map.get("危险").toString()));
zyList.add(Integer.valueOf(map.get("注意").toString()));
/** jgList.add(Integer.valueOf(map.get("警告").toString()));
* 获取用户权限(此处使用gatewayId) list.add(map.get("subarray").toString());
*
* @return gatewayIds }
*/ variableClassificationList.forEach(item -> {
private List<String> getGatewayIds() { if (!equipmentNameInfoMap.containsKey(item.getSubarray())) {
List<String> permissions = permissionService.getCurrentUserPermissions(); wxList.add(0);
if (Objects.isNull(permissions)) { zyList.add(0);
permissions = Collections.emptyList(); jgList.add(0);
} list.add(item.getSubarray());
return permissions; }
} });
HashMap<String, Object> wxMapResult = new HashMap<>();
wxMapResult.put("data", wxList);
wxMapResult.put("name", "危险");
HashMap<String, Object> zyMapResult = new HashMap<>();
zyMapResult.put("data", zyList);
zyMapResult.put("name", "注意");
HashMap<String, Object> jgMapResult = new HashMap<>();
jgMapResult.put("data", jgList);
jgMapResult.put("name", "警告");
List<Map<String, Object>> hashMaps = Arrays.asList(wxMapResult, zyMapResult, jgMapResult);
resultMap.put("axisData", list);
resultMap.put("seriesData", hashMaps);
return ResponseHelper.buildResponse(resultMap);
}
/**
* 获取用户权限(此处使用gatewayId)
*
* @return gatewayIds
*/
private List<String> getGatewayIds() {
List<String> permissions = permissionService.getCurrentUserPermissions();
if (Objects.isNull(permissions)) {
permissions = Collections.emptyList();
}
return permissions;
}
} }
...@@ -145,8 +145,8 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -145,8 +145,8 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
StationBasic stationBasic = stationBasicMapper.selectById(stationCode); StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getFanGatewayId(); stationCode = stationBasic.getFanGatewayId();
if ("FDZ".equals(stationBasic.getStationType())) { if ("FDZ".equals(stationBasic.getStationType())) {
wrapper.eq(FanHealthIndex::getAnalysisObjType, "场站"); wrapper.eq(FanHealthIndex::getAnalysisObjType, "场站").and(
wrapper.eq(FanHealthIndex::getGatewayId, stationCode); qw->qw.eq(FanHealthIndex::getGatewayId, stationBasic.getFanGatewayId()).or().eq(FanHealthIndex::getGatewayId, stationBasic.getBoosterGatewayId()));
FanHealthIndex fanHealthIndex = fanHealthIndexMapper.selectOne(wrapper); FanHealthIndex fanHealthIndex = fanHealthIndexMapper.selectOne(wrapper);
// 预防空指针 // 预防空指针
if (Objects.isNull(fanHealthIndex)) { if (Objects.isNull(fanHealthIndex)) {
...@@ -157,8 +157,8 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -157,8 +157,8 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
} }
} else { } else {
LambdaQueryWrapper<PvHealthIndex> pvwrapper = new LambdaQueryWrapper<PvHealthIndex>(); LambdaQueryWrapper<PvHealthIndex> pvwrapper = new LambdaQueryWrapper<PvHealthIndex>();
pvwrapper.eq(PvHealthIndex::getAnalysisObjType, "场站"); pvwrapper.eq(PvHealthIndex::getAnalysisObjType, "场站").and(
pvwrapper.eq(PvHealthIndex::getGatewayId, stationCode); qw->qw.eq(PvHealthIndex::getGatewayId, stationBasic.getFanGatewayId()).or().eq(PvHealthIndex::getGatewayId, stationBasic.getBoosterGatewayId()));
pvwrapper.orderByDesc(PvHealthIndex::getTs); pvwrapper.orderByDesc(PvHealthIndex::getTs);
pvwrapper.last("limit 1"); pvwrapper.last("limit 1");
PvHealthIndex pvHealthIndex = pvHealthIndexMapper.selectOne(pvwrapper); PvHealthIndex pvHealthIndex = pvHealthIndexMapper.selectOne(pvwrapper);
...@@ -283,11 +283,13 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -283,11 +283,13 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
@RequestParam(required = false) Date startTime, @RequestParam(required = false) Date endTime) { @RequestParam(required = false) Date startTime, @RequestParam(required = false) Date endTime) {
String finalStationCode = null; String finalStationCode = null;
String zyzfinalStationCode = null;
String finalAreaCode = null; String finalAreaCode = null;
String stationType = null; String stationType = null;
if (StrUtil.isNotEmpty(stationCode)) { if (StrUtil.isNotEmpty(stationCode)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode); StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
finalStationCode = stationBasic.getFanGatewayId(); finalStationCode = stationBasic.getFanGatewayId();
zyzfinalStationCode=stationBasic.getBoosterGatewayId();
stationType = stationBasic.getStationType(); stationType = stationBasic.getStationType();
} else if (StrUtil.isNotEmpty(station)) { } else if (StrUtil.isNotEmpty(station)) {
// 由于命名不统一 // 由于命名不统一
...@@ -296,6 +298,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -296,6 +298,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
.eq(StationBasic::getStationName, station.substring(0, station.length() - 1) + '站')); .eq(StationBasic::getStationName, station.substring(0, station.length() - 1) + '站'));
finalStationCode = stationBasic.getFanGatewayId(); finalStationCode = stationBasic.getFanGatewayId();
stationType = stationBasic.getStationType(); stationType = stationBasic.getStationType();
zyzfinalStationCode=stationBasic.getBoosterGatewayId();
} }
if (StrUtil.isNotEmpty(areaCode)) { if (StrUtil.isNotEmpty(areaCode)) {
finalAreaCode = "%" + areaCode + "%"; finalAreaCode = "%" + areaCode + "%";
...@@ -316,8 +319,10 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -316,8 +319,10 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
if (CharSequenceUtil.isNotEmpty(finalStationCode)) { if (CharSequenceUtil.isNotEmpty(finalStationCode)) {
if ("FDZ".equals(stationType)) { if ("FDZ".equals(stationType)) {
wrapper.eq(FanHealthIndex::getAnalysisObjType, "场站"); final String fanGatewayId=finalStationCode;
wrapper.eq(FanHealthIndex::getGatewayId, finalStationCode); final String syzGatewayId=zyzfinalStationCode;
wrapper.eq(FanHealthIndex::getAnalysisObjType, "场站").and(
qw->qw.eq(FanHealthIndex::getGatewayId, fanGatewayId).or().eq(FanHealthIndex::getGatewayId, syzGatewayId));
List<FanHealthIndex> fanHealthIndexList = fanHealthIndexMapper.selectList(wrapper); List<FanHealthIndex> fanHealthIndexList = fanHealthIndexMapper.selectList(wrapper);
valueList = fanHealthIndexList.stream() valueList = fanHealthIndexList.stream()
.map(t -> String .map(t -> String
...@@ -326,9 +331,11 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -326,9 +331,11 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
dateList = fanHealthIndexList.stream().map(t -> t.getRecDate()).collect(Collectors.toList()); dateList = fanHealthIndexList.stream().map(t -> t.getRecDate()).collect(Collectors.toList());
} else { } else {
final String fanGatewayId=finalStationCode;
final String syzGatewayId=zyzfinalStationCode;
LambdaQueryWrapper<PvHealthIndex> pvwrapper = new LambdaQueryWrapper<PvHealthIndex>(); LambdaQueryWrapper<PvHealthIndex> pvwrapper = new LambdaQueryWrapper<PvHealthIndex>();
pvwrapper.eq(PvHealthIndex::getAnalysisObjType, "场站"); pvwrapper.eq(PvHealthIndex::getAnalysisObjType, "场站").and(
pvwrapper.eq(PvHealthIndex::getGatewayId, finalStationCode); qw->qw.eq(PvHealthIndex::getGatewayId, fanGatewayId).or().eq(PvHealthIndex::getGatewayId, syzGatewayId));
pvwrapper.orderByDesc(PvHealthIndex::getTs); pvwrapper.orderByDesc(PvHealthIndex::getTs);
pvwrapper.last("limit 15"); pvwrapper.last("limit 15");
List<PvHealthIndex> pvHealthIndexList = pvHealthIndexMapper.selectList(pvwrapper); List<PvHealthIndex> pvHealthIndexList = pvHealthIndexMapper.selectList(pvwrapper);
...@@ -584,16 +591,17 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -584,16 +591,17 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
@RequestParam(value = "stationId", required = false) String stationId, @RequestParam(value = "stationId", required = false) String stationId,
@RequestParam(value = "startDate", required = false) String startDate, @RequestParam(value = "startDate", required = false) String startDate,
@RequestParam(value = "endDate", required = false) String endDate) { @RequestParam(value = "endDate", required = false) String endDate) {
String syzGatewayId="";
if (StrUtil.isNotEmpty(stationId)) { if (StrUtil.isNotEmpty(stationId)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
stationId = stationBasic.getFanGatewayId(); stationId = stationBasic.getFanGatewayId();
syzGatewayId=stationBasic.getBoosterGatewayId();
} }
if (arae != null) { if (arae != null) {
arae = "%" + arae + "%"; arae = "%" + arae + "%";
} }
Integer count = fanWaringRecordMapper.getEquipWarningInfoByPageCount(arae, station, stationType, warningName, Integer count = fanWaringRecordMapper.getEquipWarningInfoByPageCount(arae, station, stationType, warningName,
stationId, startDate, endDate); stationId, startDate, endDate,syzGatewayId);
// 前端存在分页bug 此处限制分页后筛选导致页面超出问题 // 前端存在分页bug 此处限制分页后筛选导致页面超出问题
if (count > 0 && current > (count / 10 + 1)) { if (count > 0 && current > (count / 10 + 1)) {
current = 1; current = 1;
...@@ -603,7 +611,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -603,7 +611,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
// stationType, (current - 1) * size, size, warningName, stationId, startDate, // stationType, (current - 1) * size, size, warningName, stationId, startDate,
// endDate); // endDate);
List<FanWarningRecord> idxBizFanWarningRecordIPage = fanWaringRecordMapper.getEquipWarningInfoByPage(arae, List<FanWarningRecord> idxBizFanWarningRecordIPage = fanWaringRecordMapper.getEquipWarningInfoByPage(arae,
station, stationType, (current - 1) * size, size, warningName, stationId, startDate, endDate); station, stationType, (current - 1) * size, size, warningName, stationId, startDate, endDate,syzGatewayId);
Page<FanWarningRecord> idxBizFanWarningRecordPage = new Page<>(current, size); Page<FanWarningRecord> idxBizFanWarningRecordPage = new Page<>(current, size);
idxBizFanWarningRecordPage.setRecords(idxBizFanWarningRecordIPage); idxBizFanWarningRecordPage.setRecords(idxBizFanWarningRecordIPage);
...@@ -768,10 +776,10 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -768,10 +776,10 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
private Page<Map<String, Object>> fanInfoByPage(String stationId) { private Page<Map<String, Object>> fanInfoByPage(String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper
.getFanInfoByPage(stationBasic.getFanGatewayId()); .getFanInfoByPage(stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
List<Map<String, Object>> healthInfoList = idxBizFanHealthIndexMapper List<Map<String, Object>> healthInfoList = idxBizFanHealthIndexMapper
.getFanHealthInfoList(stationBasic.getFanGatewayId()); .getFanHealthInfoList(stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
Map<Object, Double> equipmentHealthIndexMap = healthInfoList.stream().collect(Collectors Map<Object, Double> equipmentHealthIndexMap = healthInfoList.stream().collect(Collectors
.toMap(t -> t.get("equipmentName"), t -> Double.parseDouble(t.get("avgHealthIndex").toString()))); .toMap(t -> t.get("equipmentName"), t -> Double.parseDouble(t.get("avgHealthIndex").toString())));
...@@ -824,7 +832,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -824,7 +832,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getSubSystemInfo(equipmentName, List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getSubSystemInfo(equipmentName,
stationBasic.getFanGatewayId()); stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
Map<Object, Object> equipmentHealthIndexMap = healthListInfo.stream() Map<Object, Object> equipmentHealthIndexMap = healthListInfo.stream()
.collect(Collectors.toMap(t -> t.get("subSystem"), t -> t.get("healthIndex"))); .collect(Collectors.toMap(t -> t.get("subSystem"), t -> t.get("healthIndex")));
...@@ -832,7 +840,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -832,7 +840,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
List<Object> axisData = new ArrayList<>(); List<Object> axisData = new ArrayList<>();
List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper
.getSumSystemListByEquipment(stationBasic.getFanGatewayId(), equipmentName); .getSumSystemListByEquipment(stationBasic.getFanGatewayId(), equipmentName,stationBasic.getBoosterGatewayId());
equipmentList.forEach(item -> { equipmentList.forEach(item -> {
Object equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("subSystem"), 100.0); Object equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("subSystem"), 100.0);
seriesData.add(equipmentHealthScore); seriesData.add(equipmentHealthScore);
...@@ -857,13 +865,13 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -857,13 +865,13 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
equipmentName = StrUtil.isNotEmpty(equipmentName) ? "%" + equipmentName + "风机%" : equipmentName; equipmentName = StrUtil.isNotEmpty(equipmentName) ? "%" + equipmentName + "风机%" : equipmentName;
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoBySubSystem(subSystem, List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoBySubSystem(subSystem,
stationBasic.getFanGatewayId(), equipmentName); stationBasic.getFanGatewayId(), equipmentName,stationBasic.getBoosterGatewayId());
Map<Object, Double> equipmentHealthIndexMap = healthListInfo.stream().collect( Map<Object, Double> equipmentHealthIndexMap = healthListInfo.stream().collect(
Collectors.toMap(t -> t.get("pointName"), t -> Double.parseDouble(t.get("healthIndex").toString()))); Collectors.toMap(t -> t.get("pointName"), t -> Double.parseDouble(t.get("healthIndex").toString())));
List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper
.getPointNameListBySumSystem(stationBasic.getFanGatewayId(), subSystem, equipmentName); .getPointNameListBySumSystem(stationBasic.getFanGatewayId(), subSystem, equipmentName,stationBasic.getBoosterGatewayId());
pointNameList.forEach(item -> { pointNameList.forEach(item -> {
Double equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), 100.0); Double equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), 100.0);
...@@ -920,10 +928,10 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -920,10 +928,10 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper
.getPvInfoByPage(stationBasic.getFanGatewayId()); .getPvInfoByPage(stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
List<Map<String, Object>> healthInfoList = idxBizFanHealthIndexMapper List<Map<String, Object>> healthInfoList = idxBizFanHealthIndexMapper
.getPvHealthInfoList(stationBasic.getFanGatewayId()); .getPvHealthInfoList(stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
Map<Object, Double> equipmentHealthIndexMap = healthInfoList.stream().collect( Map<Object, Double> equipmentHealthIndexMap = healthInfoList.stream().collect(
Collectors.toMap(t -> t.get("subarray"), t -> Double.parseDouble(t.get("avgHealthIndex").toString()))); Collectors.toMap(t -> t.get("subarray"), t -> Double.parseDouble(t.get("avgHealthIndex").toString())));
...@@ -967,7 +975,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -967,7 +975,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvSubSystemInfo(subarray, List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvSubSystemInfo(subarray,
stationBasic.getFanGatewayId()); stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
Map<Object, Object> equipmentHealthIndexMap = healthListInfo.stream() Map<Object, Object> equipmentHealthIndexMap = healthListInfo.stream()
.collect(Collectors.toMap(t -> t.get("equipmentName"), t -> t.get("avgHealthIndex"))); .collect(Collectors.toMap(t -> t.get("equipmentName"), t -> t.get("avgHealthIndex")));
...@@ -975,7 +983,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -975,7 +983,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
List<Object> axisData = new ArrayList<>(); List<Object> axisData = new ArrayList<>();
List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper List<Map<String, Object>> equipmentList = idxBizFanHealthIndexMapper
.getPvSumSystemListByEquipment(stationBasic.getFanGatewayId(), subarray); .getPvSumSystemListByEquipment(stationBasic.getFanGatewayId(), subarray,stationBasic.getBoosterGatewayId());
equipmentList.forEach(item -> { equipmentList.forEach(item -> {
Object equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("equipmentName"), 100.0); Object equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("equipmentName"), 100.0);
seriesData.add(equipmentHealthScore); seriesData.add(equipmentHealthScore);
...@@ -998,13 +1006,13 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -998,13 +1006,13 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
private Page<Map<String, Object>> pvSubSystemPointInfo(String equipmentName,String stationId) { private Page<Map<String, Object>> pvSubSystemPointInfo(String equipmentName,String stationId) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvHealthInfoBySubSystem(equipmentName, List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvHealthInfoBySubSystem(equipmentName,
stationBasic.getFanGatewayId()); stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
Map<Object, Double> equipmentHealthIndexMap = healthListInfo.stream().collect( Map<Object, Double> equipmentHealthIndexMap = healthListInfo.stream().collect(
Collectors.toMap(t -> t.get("pointName"), t -> Double.parseDouble(t.get("healthIndex").toString()))); Collectors.toMap(t -> t.get("pointName"), t -> Double.parseDouble(t.get("healthIndex").toString())));
List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper
.getPvPointNameListBySumSystem(stationBasic.getFanGatewayId(), equipmentName); .getPvPointNameListBySumSystem(stationBasic.getFanGatewayId(), equipmentName,stationBasic.getBoosterGatewayId());
pointNameList.forEach(item -> { pointNameList.forEach(item -> {
Double equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), 100.0); Double equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), 100.0);
...@@ -1101,11 +1109,11 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -1101,11 +1109,11 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
@RequestParam(value = "tableName2", required = false) String tableName2) { @RequestParam(value = "tableName2", required = false) String tableName2) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String nameByIndexAddress = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(indexAddress, tableName, String nameByIndexAddress = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(indexAddress, tableName,
stationBasic.getFanGatewayId()); stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
int num = 0; int num = 0;
if (StringUtils.isNotEmpty(tableName2)) { if (StringUtils.isNotEmpty(tableName2)) {
num = idxBizFanHealthIndexMapper.getIsWarningByPointId(indexAddress, stationBasic.getFanGatewayId(), num = idxBizFanHealthIndexMapper.getIsWarningByPointId(indexAddress, stationBasic.getFanGatewayId(),
tableName2); tableName2,stationBasic.getBoosterGatewayId());
} }
HashMap<String, Object> resultMap = new HashMap<>(); HashMap<String, Object> resultMap = new HashMap<>();
...@@ -1124,7 +1132,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -1124,7 +1132,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
varDesc = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(varDesc, tableName, varDesc = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(varDesc, tableName,
stationBasic.getFanGatewayId()); stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
FeignClientResult<List<String>> sevenEntityMcb = null; FeignClientResult<List<String>> sevenEntityMcb = null;
try { try {
sevenEntityMcb = riskWarningFeign.getRiskHandleByVarDesc(varDesc); sevenEntityMcb = riskWarningFeign.getRiskHandleByVarDesc(varDesc);
...@@ -1639,8 +1647,8 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -1639,8 +1647,8 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
LambdaQueryWrapper<FanHealthIndex> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<FanHealthIndex> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(FanHealthIndex::getIndexAddress, indexAddress); lambdaQueryWrapper.eq(FanHealthIndex::getIndexAddress, indexAddress).and(
lambdaQueryWrapper.eq(FanHealthIndex::getGatewayId, stationBasic.getFanGatewayId()); qw->qw.eq(FanHealthIndex::getGatewayId, stationBasic.getFanGatewayId()).or().eq(FanHealthIndex::getGatewayId, stationBasic.getBoosterGatewayId()));
lambdaQueryWrapper.eq(FanHealthIndex::getAnalysisObjType, "测点"); lambdaQueryWrapper.eq(FanHealthIndex::getAnalysisObjType, "测点");
lambdaQueryWrapper.orderByDesc(FanHealthIndex::getTs); lambdaQueryWrapper.orderByDesc(FanHealthIndex::getTs);
...@@ -1677,8 +1685,8 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -1677,8 +1685,8 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
LambdaQueryWrapper<PvHealthIndex> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PvHealthIndex> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(PvHealthIndex::getIndexAddress, indexAddress); lambdaQueryWrapper.eq(PvHealthIndex::getIndexAddress, indexAddress).and(
lambdaQueryWrapper.eq(PvHealthIndex::getGatewayId, stationBasic.getFanGatewayId()); qw->qw.eq(PvHealthIndex::getGatewayId, stationBasic.getFanGatewayId()).or().eq(PvHealthIndex::getGatewayId, stationBasic.getBoosterGatewayId()));
lambdaQueryWrapper.eq(PvHealthIndex::getAnalysisObjType, "测点"); lambdaQueryWrapper.eq(PvHealthIndex::getAnalysisObjType, "测点");
lambdaQueryWrapper.orderByDesc(PvHealthIndex::getTs); lambdaQueryWrapper.orderByDesc(PvHealthIndex::getTs);
lambdaQueryWrapper.eq(PvHealthIndex::getAnalysisType, "按10分钟"); lambdaQueryWrapper.eq(PvHealthIndex::getAnalysisType, "按10分钟");
...@@ -1714,7 +1722,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -1714,7 +1722,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Map<String, Object> healthIndexMap = idxBizFanHealthIndexMapper Map<String, Object> healthIndexMap = idxBizFanHealthIndexMapper
.getHealthIndexByIndexAddress(stationBasic.getFanGatewayId(), varDesc); .getHealthIndexByIndexAddress(stationBasic.getFanGatewayId(), varDesc,stationBasic.getBoosterGatewayId());
if (ObjectUtils.isEmpty(healthIndexMap)) { if (ObjectUtils.isEmpty(healthIndexMap)) {
HashMap<String, String> stringStringHashMap = new HashMap<>(); HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("content", "正常运行"); stringStringHashMap.put("content", "正常运行");
...@@ -1733,7 +1741,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -1733,7 +1741,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
} }
varDesc = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(varDesc, tableName, varDesc = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(varDesc, tableName,
stationBasic.getFanGatewayId()); stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
FeignClientResult<List<String>> sevenEntityMcb = null; FeignClientResult<List<String>> sevenEntityMcb = null;
try { try {
sevenEntityMcb = riskWarningFeign.getRiskHandleByVarDesc(varDesc); sevenEntityMcb = riskWarningFeign.getRiskHandleByVarDesc(varDesc);
...@@ -1765,7 +1773,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -1765,7 +1773,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
Map<String, Object> healthIndexMap = idxBizFanHealthIndexMapper Map<String, Object> healthIndexMap = idxBizFanHealthIndexMapper
.getHealthIndexByIndexAddressPv(stationBasic.getFanGatewayId(), varDesc); .getHealthIndexByIndexAddressPv(stationBasic.getFanGatewayId(), varDesc,stationBasic.getBoosterGatewayId());
if (ObjectUtils.isEmpty(healthIndexMap)) { if (ObjectUtils.isEmpty(healthIndexMap)) {
HashMap<String, String> stringStringHashMap = new HashMap<>(); HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("content", "正常运行"); stringStringHashMap.put("content", "正常运行");
...@@ -1784,7 +1792,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl ...@@ -1784,7 +1792,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
} }
varDesc = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(varDesc, tableName, varDesc = idxBizFanHealthIndexMapper.getPointNameByIndexAddress(varDesc, tableName,
stationBasic.getFanGatewayId()); stationBasic.getFanGatewayId(),stationBasic.getBoosterGatewayId());
FeignClientResult<List<String>> sevenEntityMcb = null; FeignClientResult<List<String>> sevenEntityMcb = null;
try { try {
sevenEntityMcb = riskWarningFeign.getRiskHandleByVarDesc(varDesc); sevenEntityMcb = riskWarningFeign.getRiskHandleByVarDesc(varDesc);
......
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
...@@ -124,4 +125,6 @@ public class IdxBizFanWarningRuleSet { ...@@ -124,4 +125,6 @@ public class IdxBizFanWarningRuleSet {
@TableField("GATEWAY_ID") @TableField("GATEWAY_ID")
private String gatewayId; private String gatewayId;
@TableField("ORG_CODE")
private String orgCode;
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
...@@ -140,4 +141,8 @@ public class IdxBizPvWarningRuleSet{ ...@@ -140,4 +141,8 @@ public class IdxBizPvWarningRuleSet{
*/ */
@TableField("GATEWAY_ID") @TableField("GATEWAY_ID")
private String gatewayId; private String gatewayId;
@TableField("ORG_CODE")
private String orgCode;
} }
...@@ -59,47 +59,49 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn ...@@ -59,47 +59,49 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List<Map<String, Object>> getAllEquipAlarmInfoAnalysisByArea(@Param("areaCode") String areaCode); List<Map<String, Object>> getAllEquipAlarmInfoAnalysisByArea(@Param("areaCode") String areaCode);
List<Map<String, Object>> getSubSystemInfo(@Param("equipmentName") String equipmentName, List<Map<String, Object>> getSubSystemInfo(@Param("equipmentName") String equipmentName,
@Param("gatewayId") String gatewayId); @Param("gatewayId") String gatewayId,@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> getFanInfoByPage(@Param("gatewayId") String gatewayId); List<Map<String, Object>> getFanInfoByPage(@Param("gatewayId") String gatewayId,@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> getFanHealthInfoList(@Param("gatewayId") String gatewayId); List<Map<String, Object>> getFanHealthInfoList(@Param("gatewayId") String gatewayId,@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> getSumSystemListByEquipment(@Param("gatewayId") String gatewayId, List<Map<String, Object>> getSumSystemListByEquipment(@Param("gatewayId") String gatewayId,
@Param("equipmentName") String equipmentName); @Param("equipmentName") String equipmentName,@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> getPointNameListBySumSystem(@Param("gatewayId") String gatewayId, List<Map<String, Object>> getPointNameListBySumSystem(@Param("gatewayId") String gatewayId,
@Param("subSystem") String subSystem, @Param("subSystem") String subSystem,
@Param("equipmentName") String equipmentName); @Param("equipmentName") String equipmentName,
@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> getHealthInfoBySubSystem(@Param("subSystem") String subSystem, List<Map<String, Object>> getHealthInfoBySubSystem(@Param("subSystem") String subSystem,
@Param("gatewayId") String gatewayId, @Param("gatewayId") String gatewayId,
@Param("equipmentName") String equipmentName); @Param("equipmentName") String equipmentName,
@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> getWarningInfoBySubSystem(@Param("subSystem") String subSystem, List<Map<String, Object>> getWarningInfoBySubSystem(@Param("subSystem") String subSystem,
@Param("gatewayId") String gatewayId); @Param("gatewayId") String gatewayId,@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> getPvInfoByPage(@Param("gatewayId") String gatewayId); List<Map<String, Object>> getPvInfoByPage(@Param("gatewayId") String gatewayId,@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> getPvHealthInfoList(@Param("gatewayId") String gatewayId); List<Map<String, Object>> getPvHealthInfoList(@Param("gatewayId") String gatewayId,@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> getPvSubSystemInfo(@Param("subarray") String subarray, List<Map<String, Object>> getPvSubSystemInfo(@Param("subarray") String subarray,
@Param("gatewayId") String gatewayId); @Param("gatewayId") String gatewayId,@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> getPvSumSystemListByEquipment(@Param("gatewayId") String gatewayId, List<Map<String, Object>> getPvSumSystemListByEquipment(@Param("gatewayId") String gatewayId,
@Param("subarray") String subarray); @Param("subarray") String subarray,@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> getPvHealthInfoBySubSystem(@Param("equipmentName") String equipmentName, List<Map<String, Object>> getPvHealthInfoBySubSystem(@Param("equipmentName") String equipmentName,
@Param("gatewayId") String gatewayId); @Param("gatewayId") String gatewayId,@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> getPvWarningInfoBySubSystem(@Param("equipmentName") String equipmentName, List<Map<String, Object>> getPvWarningInfoBySubSystem(@Param("equipmentName") String equipmentName,
@Param("gatewayId") String gatewayId); @Param("gatewayId") String gatewayId,@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> getPvPointNameListBySumSystem(@Param("gatewayId") String gatewayId, List<Map<String, Object>> getPvPointNameListBySumSystem(@Param("gatewayId") String gatewayId,
@Param("equipmentName") String equipmentName); @Param("equipmentName") String equipmentName,@Param("syzGatewayId") String syzGatewayId);
String getPointNameByIndexAddress(@Param("varDesc") String varDesc, @Param("tableName") String tableName, String getPointNameByIndexAddress(@Param("varDesc") String varDesc, @Param("tableName") String tableName,
@Param("gatewayId") String gatewayId); @Param("gatewayId") String gatewayId,@Param("syzGatewayId") String syzGatewayId);
List<FullViewRecallDataDTO> getFullViewRecall(@Param("gatewayIds") List<String> gatewayIds); List<FullViewRecallDataDTO> getFullViewRecall(@Param("gatewayIds") List<String> gatewayIds);
...@@ -150,19 +152,19 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn ...@@ -150,19 +152,19 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
Map<String, Object> getPvEquipStatusByStation(String station); Map<String, Object> getPvEquipStatusByStation(String station);
String getRecDateByIndexAddress(@Param("fanGatewayId") String fanGatewayId, String getRecDateByIndexAddress(@Param("fanGatewayId") String fanGatewayId,
@Param("indexAddress") String indexAddress, @Param("tableName") String tableName); @Param("indexAddress") String indexAddress, @Param("tableName") String tableName,@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> getInfoListByTableName(@Param("fanGatewayId") String fanGatewayId, List<Map<String, Object>> getInfoListByTableName(@Param("fanGatewayId") String fanGatewayId,
@Param("indexAddress") String indexAddress, @Param("tableName") String tableName, @Param("indexAddress") String indexAddress, @Param("tableName") String tableName,
@Param("recDate") String recDate); @Param("recDate") String recDate,@Param("syzGatewayId") String syzGatewayId);
int getIsWarningByPointId(@Param("indexAddress") String indexAddress, @Param("fanGatewayId") String fanGatewayId, int getIsWarningByPointId(@Param("indexAddress") String indexAddress, @Param("fanGatewayId") String fanGatewayId,
@Param("tableName") String tableName); @Param("tableName") String tableName,@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> queryIndexByArae(String ARAE, String ANALYSISTYPE, String startTimeTop, List<Map<String, Object>> queryIndexByArae(String ARAE, String ANALYSISTYPE, String startTimeTop,
String endTimeTop); String endTimeTop);
Map<String, Object> getHealthIndexByIndexAddress(@Param("gatewayId") String gatewayId, @Param("indexAddress") String indexAddress); Map<String, Object> getHealthIndexByIndexAddress(@Param("gatewayId") String gatewayId, @Param("indexAddress") String indexAddress,@Param("syzGatewayId") String syzGatewayId);
Map<String, Object> getHealthIndexByIndexAddressPv(@Param("gatewayId") String gatewayId, @Param("indexAddress") String indexAddress); Map<String, Object> getHealthIndexByIndexAddressPv(@Param("gatewayId") String gatewayId, @Param("indexAddress") String indexAddress,@Param("syzGatewayId") String syzGatewayId);
} }
...@@ -619,7 +619,7 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService { ...@@ -619,7 +619,7 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
processValue1 = 0.0; processValue1 = 0.0;
} }
currentValueMap.put("processValue1", keepOneKeepDecimalPlace(processValue1)); currentValueMap.put("processValue1", keepOneKeepDecimalPlace(processValue1));
if(ObjectUtils.isEmpty(analyseValue)){ if(ObjectUtils.isEmpty(processValue2)){
processValue2 = 0.0; processValue2 = 0.0;
} }
currentValueMap.put("processValue2", keepOneKeepDecimalPlace(processValue2)); currentValueMap.put("processValue2", keepOneKeepDecimalPlace(processValue2));
......
...@@ -205,7 +205,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -205,7 +205,7 @@ public class HealthStatusIndicatorServiceImpl {
for (String gateWayId : gateWayMaps.keySet()) { for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId); basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1"); basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper); StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic); stationMap.put(gateWayId, stationBasic);
...@@ -588,7 +588,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -588,7 +588,7 @@ public class HealthStatusIndicatorServiceImpl {
// for (String gateWayId : gateWayMaps.keySet()) { // for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gatewayId); basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gatewayId).or().eq(StationBasic::getBoosterGatewayId, gatewayId);
basicLambdaQueryWrapper.last("limit 1"); basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper); StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gatewayId, stationBasic); stationMap.put(gatewayId, stationBasic);
...@@ -792,7 +792,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -792,7 +792,7 @@ public class HealthStatusIndicatorServiceImpl {
for (String gateWayId : gateWayMaps.keySet()) { for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId); basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1"); basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper); StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic); stationMap.put(gateWayId, stationBasic);
...@@ -1005,7 +1005,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1005,7 +1005,7 @@ public class HealthStatusIndicatorServiceImpl {
// for (String gateWayId : gateWayMaps.keySet()) { // for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId); basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1"); basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper); StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic); stationMap.put(gateWayId, stationBasic);
...@@ -1218,7 +1218,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1218,7 +1218,7 @@ public class HealthStatusIndicatorServiceImpl {
for (String gateWayId : gateWayMaps.keySet()) { for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId); basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1"); basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper); StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic); stationMap.put(gateWayId, stationBasic);
...@@ -1433,7 +1433,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1433,7 +1433,7 @@ public class HealthStatusIndicatorServiceImpl {
// for (String gateWayId : gateWayMaps.keySet()) { // for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId); basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1"); basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper); StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic); stationMap.put(gateWayId, stationBasic);
...@@ -1658,7 +1658,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1658,7 +1658,7 @@ public class HealthStatusIndicatorServiceImpl {
for (String gateWayId : gateWayMaps.keySet()) { for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId); basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1"); basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper); StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic); stationMap.put(gateWayId, stationBasic);
...@@ -1887,7 +1887,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1887,7 +1887,7 @@ public class HealthStatusIndicatorServiceImpl {
// for (String gateWayId : gateWayMaps.keySet()) { // for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gatewayId); basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gatewayId).or().eq(StationBasic::getBoosterGatewayId, gatewayId);
basicLambdaQueryWrapper.last("limit 1"); basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper); StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gatewayId, stationBasic); stationMap.put(gatewayId, stationBasic);
...@@ -2111,7 +2111,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -2111,7 +2111,7 @@ public class HealthStatusIndicatorServiceImpl {
for (String gateWayId : gateWayMaps.keySet()) { for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId); basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1"); basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper); StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic); stationMap.put(gateWayId, stationBasic);
...@@ -2331,7 +2331,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -2331,7 +2331,7 @@ public class HealthStatusIndicatorServiceImpl {
// for (String gateWayId : gateWayMaps.keySet()) { // for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId); basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1"); basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper); StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic); stationMap.put(gateWayId, stationBasic);
...@@ -2550,7 +2550,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -2550,7 +2550,7 @@ public class HealthStatusIndicatorServiceImpl {
for (String gateWayId : gateWayMaps.keySet()) { for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId); basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1"); basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper); StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic); stationMap.put(gateWayId, stationBasic);
...@@ -2768,7 +2768,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -2768,7 +2768,7 @@ public class HealthStatusIndicatorServiceImpl {
// for (String gateWayId : gateWayMaps.keySet()) { // for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gatewayId); basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gatewayId).or().eq(StationBasic::getBoosterGatewayId, gatewayId);
basicLambdaQueryWrapper.last("limit 1"); basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper); StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gatewayId, stationBasic); stationMap.put(gatewayId, stationBasic);
......
...@@ -50,23 +50,23 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> { ...@@ -50,23 +50,23 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
@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 (select distinct station,health_level,equipment_name from analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= TODAY()-9h" + "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 (select distinct station,health_level,equipment_name from analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= #{startTimeTop}" +
"<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>" + "<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, @Param("gatewayIds") List<String> gatewayIds); List<Map<String, Object>> selectEquipStatusByStation(@Param("area") String area, @Param("analysisObjType") String analysisObjType, @Param("station") String station, @Param("gatewayIds") List<String> gatewayIds, @Param("startTimeTop") String startTimeTop);
List<Map<String, Object>> getHealthInfoByArea(); List<Map<String, Object>> getHealthInfoByArea();
@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 (select distinct station,health_level,equipment_name from analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null 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 (select distinct station,health_level,equipment_name from analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= #{startTimeTop}" +
"<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>" +
" )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); List<Map<String, Object>> selectEquipStatusByEquipment( @Param("analysisObjType") String analysisObjType, @Param("station") String station, @Param("equipmentName") String equipmentName,@Param("startTimeTop") String startTimeTop);
@Select("<script>" + @Select("<script>" +
"SELECT distinct `health_index` AS healthIndex,anomaly,rec_date as recDate, `health_index` AS `value`, substr(analysis_time,1,10) as analysisTime, station,equipment_name AS equipmentName,point_name as pointName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" + "SELECT distinct `health_index` AS healthIndex,anomaly,rec_date as recDate, `health_index` AS `value`, substr(analysis_time,1,10) as analysisTime, station,equipment_name AS equipmentName,point_name as pointName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" +
......
...@@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Param; ...@@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
import java.util.Map;
public interface FanHealthIndexHourMapper extends BaseMapper<FanHealthIndexHour> { public interface FanHealthIndexHourMapper extends BaseMapper<FanHealthIndexHour> {
@Select("<script>" + @Select("<script>" +
...@@ -47,4 +48,22 @@ public interface FanHealthIndexHourMapper extends BaseMapper<FanHealthIndexHour> ...@@ -47,4 +48,22 @@ public interface FanHealthIndexHourMapper extends BaseMapper<FanHealthIndexHour>
@Param("current") Integer current, @Param("size") Integer size, @Param("current") Integer current, @Param("size") Integer size,
@Param("orgCode") String orgCode @Param("orgCode") String orgCode
); );
@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 (select distinct station,health_level,equipment_name from analysis_data.fan_health_index_hour WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= #{startTimeTop}" +
"<if test='area!= null'> AND area = #{area} </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" +
"</script>")
List<Map<String, Object>> selectEquipStatusByStation(@Param("area") String area, @Param("analysisObjType") String analysisObjType, @Param("station") String station, @Param("gatewayIds") List<String> gatewayIds, @Param("startTimeTop") String startTimeTop);
@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 (select distinct station,health_level,equipment_name from analysis_data.fan_health_index_hour WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= #{startTimeTop}" +
"<if test='station!= null'>AND station = #{station} </if>" +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
" )GROUP BY station,health_level,equipment_name order by sort" +
"</script>")
List<Map<String, Object>> selectEquipStatusByEquipment( @Param("analysisObjType") String analysisObjType, @Param("station") String station, @Param("equipmentName") String equipmentName,@Param("startTimeTop") String startTimeTop);
} }
...@@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Param; ...@@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
import java.util.Map;
public interface FanHealthIndexMomentMapper extends BaseMapper<FanHealthIndexMoment> { public interface FanHealthIndexMomentMapper extends BaseMapper<FanHealthIndexMoment> {
@Select("<script>" + @Select("<script>" +
...@@ -46,4 +47,22 @@ public interface FanHealthIndexMomentMapper extends BaseMapper<FanHealthIndexMom ...@@ -46,4 +47,22 @@ public interface FanHealthIndexMomentMapper extends BaseMapper<FanHealthIndexMom
@Param("current") Integer current, @Param("size") Integer size, @Param("current") Integer current, @Param("size") Integer size,
@Param("orgCode") String orgCode @Param("orgCode") String orgCode
); );
@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 (select distinct station,health_level,equipment_name from analysis_data.fan_health_index_moment WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= #{startTimeTop}" +
"<if test='area!= null'> AND area = #{area} </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" +
"</script>")
List<Map<String, Object>> selectEquipStatusByStation(@Param("area") String area, @Param("analysisObjType") String analysisObjType, @Param("station") String station, @Param("gatewayIds") List<String> gatewayIds, @Param("startTimeTop") String startTimeTop);
@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 (select distinct station,health_level,equipment_name from analysis_data.fan_health_index_moment WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= #{startTimeTop}" +
"<if test='station!= null'>AND station = #{station} </if>" +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
" )GROUP BY station,health_level,equipment_name order by sort" +
"</script>")
List<Map<String, Object>> selectEquipStatusByEquipment( @Param("analysisObjType") String analysisObjType, @Param("station") String station, @Param("equipmentName") String equipmentName,@Param("startTimeTop") String startTimeTop);
} }
...@@ -41,9 +41,9 @@ public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> { ...@@ -41,9 +41,9 @@ public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> {
@Param("warningName") String warningName, @Param("warningName") String warningName,
@Param("stationId") String stationId, @Param("stationId") String stationId,
@Param("startDate") String startDate, @Param("startDate") String startDate,
@Param("endDate") String endDate); @Param("endDate") String endDate,@Param("syzGatewayId") String syzGatewayId);
List<FanWarningRecord> getEquipWarningInfoByPage(String arae, String station, String stationType, Integer current, Integer size, String warningName, String stationId, String startDate, String endDate); List<FanWarningRecord> getEquipWarningInfoByPage(String arae, String station, String stationType, Integer current, Integer size, String warningName, String stationId, String startDate, String endDate,@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> getAllEquipAlarmInfoAnalysisByArea(String araeCode, String stationType); List<Map<String, Object>> getAllEquipAlarmInfoAnalysisByArea(String araeCode, String stationType);
......
package com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2; package com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndexDay;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndexDay; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndexDay;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
...@@ -59,24 +58,24 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> { ...@@ -59,24 +58,24 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
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("orgCode") String orgCode); 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("orgCode") String orgCode);
@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 (select distinct station,health_level,equipment_name from analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= TODAY()-9h" + "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 (select distinct station,health_level,equipment_name from analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= #{startTimeTop}" +
"<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>" + "<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, @Param("gatewayIds") List<String> gatewayIds); List<Map<String,Object>> selectEquipStatusByStationPv(@Param("area") String area, @Param("analysisObjType") String analysisObjType, @Param("station") String station, @Param("gatewayIds") List<String> gatewayIds, @Param("startTimeTop") String startTimeTop);
@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 (select distinct station,health_level,equipment_name from analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null 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 (select distinct station,health_level,equipment_name from analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= #{startTimeTop}" +
"<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>" + "<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, @Param("gatewayIds") List<String> gatewayIds); 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, @Param("startTimeTop") String startTimeTop);
@Select("<script>"+ @Select("<script>"+
......
package com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2; package com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndexDay;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndexDay;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndexHour; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndexHour;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
import java.util.Map;
public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> { public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> {
@Select("<script>" +
@Select("<script>"+
"SELECT `health_index` AS healthIndex, `health_index` AS `value`, rec_date AS recDate, anomaly, analysis_time,station,equipment_name AS equipmentName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status" + "SELECT `health_index` AS healthIndex, `health_index` AS `value`, rec_date AS recDate, anomaly, analysis_time,station,equipment_name AS equipmentName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status" +
" FROM analysis_data.pv_health_index_hour WHERE analysis_obj_type = #{analysisObjType}" + " FROM analysis_data.pv_health_index_hour WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" +
"<if test='endTimeTop!= null'> and analysis_time &lt;= #{endTimeTop} </if> " + "<if test='endTimeTop!= null'> and ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and analysis_time &gt;= #{startTimeTop} </if> " + "<if test='startTimeTop!= null'> and ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null '> AND area = #{area} </if> " + "<if test='area!= null '> AND area = #{area} </if> " +
"<if test='indexAddress!= null '> AND index_address = #{indexAddress} </if> " + "<if test='indexAddress!= null '> AND index_address = #{indexAddress} </if> " +
"<if test='pointName!= null '>AND point_name = #{pointName} </if> " + "<if test='pointName!= null '>AND point_name = #{pointName} </if> " +
...@@ -24,11 +24,22 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> { ...@@ -24,11 +24,22 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> {
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" + "<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"<if test='orgCode!= null'>AND org_code like '${orgCode}' </if>" + "<if test='orgCode!= null'>AND org_code like '${orgCode}' </if>" +
// "<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>" + // "<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>" +
"order by health_index " + "order by health_index "+
"<if test='current != null and size != null'>limit ${current},${size} </if>" + "<if test='current != null and size != null'>limit ${current},${size} </if>" +
"</script>") "</script>")
List<PvHealthIndexHour> selectData(@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 List<PvHealthIndexHour> selectData(@Param("station")String station,
, @Param("current") Integer current, @Param("size") Integer size, @Param("orgCode") String orgCode); @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("current")Integer current, @Param("size")Integer size,@Param("orgCode") String orgCode);
@Select("<script>" + @Select("<script>" +
"SELECT count(1)" + "SELECT count(1)" +
...@@ -130,4 +141,24 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> { ...@@ -130,4 +141,24 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> {
@Param("endTimeTop")String endTimeTop, @Param("endTimeTop")String endTimeTop,
@Param("equipmentName")String equipmentName @Param("equipmentName")String equipmentName
, @Param("current")Integer current, @Param("size")Integer size,@Param("orgCode") String orgCode); , @Param("current")Integer current, @Param("size")Integer size,@Param("orgCode") String orgCode);
@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 (select distinct station,health_level,equipment_name from analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= #{startTimeTop}" +
"<if test='area!= null'> AND area = #{area} </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"+
"</script>")
List<Map<String,Object>> selectEquipStatusByStationPv(@Param("area") String area, @Param("analysisObjType") String analysisObjType, @Param("station") String station, @Param("gatewayIds") List<String> gatewayIds, @Param("startTimeTop") String startTimeTop);
@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 (select distinct station,health_level,equipment_name from analysis_data.pv_health_index_hour WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= #{startTimeTop}" +
"<if test='station!= null'>AND station = #{station} </if>" +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </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"+
"</script>")
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, @Param("startTimeTop") String startTimeTop);
} }
...@@ -8,13 +8,15 @@ import org.apache.ibatis.annotations.Param; ...@@ -8,13 +8,15 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
import java.util.Map;
public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMoment> { public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMoment> {
@Select("<script>" +
@Select("<script>"+
"SELECT `health_index` AS healthIndex,`health_index` AS `value`, rec_date AS recDate, anomaly, analysis_time,station,equipment_name AS equipmentName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status" + "SELECT `health_index` AS healthIndex,`health_index` AS `value`, rec_date AS recDate, anomaly, analysis_time,station,equipment_name AS equipmentName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status" +
" FROM analysis_data.pv_health_index_moment WHERE analysis_obj_type = #{analysisObjType}" + " FROM analysis_data.pv_health_index_moment WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" +
"<if test='endTimeTop!= null'> and analysis_time &lt;= #{endTimeTop} </if> " + "<if test='endTimeTop!= null'> and ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and analysis_time &gt;= #{startTimeTop} </if> " + "<if test='startTimeTop!= null'> and ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null '> AND area = #{area} </if> " + "<if test='area!= null '> AND area = #{area} </if> " +
"<if test='indexAddress!= null '> AND index_address = #{indexAddress} </if> " + "<if test='indexAddress!= null '> AND index_address = #{indexAddress} </if> " +
"<if test='pointName!= null '>AND point_name = #{pointName} </if> " + "<if test='pointName!= null '>AND point_name = #{pointName} </if> " +
...@@ -22,13 +24,25 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen ...@@ -22,13 +24,25 @@ 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>" +
"<if test='orgCode!= null'>AND org_code like '${orgCode}' </if>" + "<if test='orgCode!= null'>AND org_code like '${orgCode}' </if>" +
"order by health_index " + // "<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>" +
"order by health_index "+
"<if test='current != null and size != null'>limit ${current},${size} </if>" + "<if test='current != null and size != null'>limit ${current},${size} </if>" +
"</script>") "</script>")
List<PvHealthIndexMoment> selectData(@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 List<PvHealthIndexMoment> selectData(@Param("station")String station,
, @Param("current") Integer current, @Param("size") Integer size, @Param("orgCode") String orgCode); @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("current")Integer current, @Param("size")Integer size,@Param("orgCode") String orgCode);
@Select("<script>" + @Select("<script>" +
"SELECT count(1)" + "SELECT count(1)" +
...@@ -127,4 +141,25 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen ...@@ -127,4 +141,25 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen
@Param("endTimeTop")String endTimeTop, @Param("endTimeTop")String endTimeTop,
@Param("equipmentName")String equipmentName @Param("equipmentName")String equipmentName
, @Param("current")Integer current, @Param("size")Integer size,@Param("orgCode") String orgCode); , @Param("current")Integer current, @Param("size")Integer size,@Param("orgCode") String orgCode);
@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 (select distinct station,health_level,equipment_name from analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= #{startTimeTop}" +
"<if test='area!= null'> AND area = #{area} </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"+
"</script>")
List<Map<String,Object>> selectEquipStatusByStationPv(@Param("area") String area, @Param("analysisObjType") String analysisObjType, @Param("station") String station, @Param("gatewayIds") List<String> gatewayIds, @Param("startTimeTop") String startTimeTop);
@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 (select distinct station,health_level,equipment_name from analysis_data.pv_health_index_moment WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= #{startTimeTop}" +
"<if test='station!= null'>AND station = #{station} </if>" +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </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"+
"</script>")
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, @Param("startTimeTop") String startTimeTop);
} }
...@@ -34,7 +34,7 @@ spring.redis.host=10.20.1.210 ...@@ -34,7 +34,7 @@ spring.redis.host=10.20.1.210
spring.redis.port=6379 spring.redis.port=6379
spring.redis.password=yeejoin@2020 spring.redis.password=yeejoin@2020
openHealth=true openHealth=false
spring.cache.type=GENERIC spring.cache.type=GENERIC
j2cache.open-spring-cache=true j2cache.open-spring-cache=true
j2cache.cache-clean-mode=passive j2cache.cache-clean-mode=passive
......
...@@ -493,10 +493,10 @@ FROM ( ...@@ -493,10 +493,10 @@ FROM (
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY--> <!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')--> <!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
<if test="equipmentName != null and equipmentName != ''"> <if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机') AND (EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机') or EQUIPMENT_NAME = #{equipmentName})
</if> </if>
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if> </if>
</where> </where>
group by subSystem group by subSystem
...@@ -509,9 +509,9 @@ FROM ( ...@@ -509,9 +509,9 @@ FROM (
FROM FROM
idx_biz_fan_point_process_variable_classification idx_biz_fan_point_process_variable_classification
<where> <where>
EQUIPMENT_NAME LIKE '%#%' (EQUIPMENT_NAME LIKE '%#%' or EQUIPMENT_NAME='升压站')
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if> </if>
</where> </where>
GROUP BY GROUP BY
...@@ -530,7 +530,7 @@ FROM ( ...@@ -530,7 +530,7 @@ FROM (
AND ANALYSIS_TYPE = '按10分钟' AND ANALYSIS_TYPE = '按10分钟'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY--> <!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if> </if>
</where> </where>
GROUP BY GROUP BY
...@@ -546,10 +546,10 @@ FROM ( ...@@ -546,10 +546,10 @@ FROM (
SUB_SYSTEM IS NOT NULL AND SUB_SYSTEM != '' SUB_SYSTEM IS NOT NULL AND SUB_SYSTEM != ''
AND TAG_CODE = '分析变量' AND TAG_CODE = '分析变量'
<if test="equipmentName != null and equipmentName != ''"> <if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机') AND (EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机') or EQUIPMENT_NAME = #{equipmentName})
</if> </if>
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if> </if>
</where> </where>
GROUP BY GROUP BY
...@@ -568,7 +568,7 @@ FROM ( ...@@ -568,7 +568,7 @@ FROM (
AND SUB_SYSTEM = #{subSystem} AND SUB_SYSTEM = #{subSystem}
</if> </if>
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if> </if>
<if test="equipmentName != null and equipmentName != ''"> <if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME like #{equipmentName} AND EQUIPMENT_NAME like #{equipmentName}
...@@ -592,7 +592,7 @@ FROM ( ...@@ -592,7 +592,7 @@ FROM (
AND SUB_SYSTEM = #{subSystem} AND SUB_SYSTEM = #{subSystem}
</if> </if>
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if> </if>
<if test="equipmentName != null and equipmentName != ''"> <if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME like #{equipmentName} AND EQUIPMENT_NAME like #{equipmentName}
...@@ -613,7 +613,7 @@ FROM ( ...@@ -613,7 +613,7 @@ FROM (
AND SUB_SYSTEM = #{subSystem} AND SUB_SYSTEM = #{subSystem}
</if> </if>
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if> </if>
</where> </where>
GROUP BY GROUP BY
...@@ -629,7 +629,7 @@ FROM ( ...@@ -629,7 +629,7 @@ FROM (
idx_biz_pv_point_process_variable_classification idx_biz_pv_point_process_variable_classification
<where> <where>
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
GATEWAY_ID = #{gatewayId} GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId}
</if> </if>
</where> </where>
GROUP BY GROUP BY
...@@ -648,7 +648,7 @@ FROM ( ...@@ -648,7 +648,7 @@ FROM (
AND ANALYSIS_TYPE = '按10分钟' AND ANALYSIS_TYPE = '按10分钟'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY--> <!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if> </if>
</where> </where>
GROUP BY SUBARRAY GROUP BY SUBARRAY
...@@ -666,10 +666,10 @@ FROM ( ...@@ -666,10 +666,10 @@ FROM (
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY--> <!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')--> <!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
<if test="subarray != null and subarray != ''"> <if test="subarray != null and subarray != ''">
AND SUBARRAY = concat('#', #{subarray}) AND (SUBARRAY = concat('#', #{subarray}) or SUBARRAY=#{subarray})
</if> </if>
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if> </if>
</where> </where>
group by EQUIPMENT_NAME group by EQUIPMENT_NAME
...@@ -684,10 +684,10 @@ FROM ( ...@@ -684,10 +684,10 @@ FROM (
AND EQUIPMENT_NAME != '' AND EQUIPMENT_NAME != ''
AND TAG_CODE = '分析变量' AND TAG_CODE = '分析变量'
<if test="subarray != null and subarray != ''"> <if test="subarray != null and subarray != ''">
AND SUBARRAY = concat('#', #{subarray}) AND (SUBARRAY = concat('#', #{subarray}) or SUBARRAY=#{subarray})
</if> </if>
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if> </if>
</where> </where>
GROUP BY GROUP BY
...@@ -708,7 +708,7 @@ FROM ( ...@@ -708,7 +708,7 @@ FROM (
AND EQUIPMENT_NAME = #{equipmentName} AND EQUIPMENT_NAME = #{equipmentName}
</if> </if>
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if> </if>
</where> </where>
GROUP BY GROUP BY
...@@ -726,7 +726,7 @@ FROM ( ...@@ -726,7 +726,7 @@ FROM (
AND EQUIPMENT_NAME = #{equipmentName} AND EQUIPMENT_NAME = #{equipmentName}
</if> </if>
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if> </if>
</where> </where>
GROUP BY GROUP BY
...@@ -747,7 +747,7 @@ FROM ( ...@@ -747,7 +747,7 @@ FROM (
AND EQUIPMENT_NAME = #{equipmentName} AND EQUIPMENT_NAME = #{equipmentName}
</if> </if>
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if> </if>
</where> </where>
GROUP BY GROUP BY
...@@ -757,7 +757,7 @@ FROM ( ...@@ -757,7 +757,7 @@ FROM (
select POINT_NAME select POINT_NAME
from ${tableName} from ${tableName}
where INDEX_ADDRESS = #{varDesc} where INDEX_ADDRESS = #{varDesc}
and GATEWAY_ID = #{gatewayId} AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
limit 1 limit 1
...@@ -1354,7 +1354,7 @@ FROM ( ...@@ -1354,7 +1354,7 @@ FROM (
WHERE WHERE
INDEX_ADDRESS = #{indexAddress} INDEX_ADDRESS = #{indexAddress}
AND DISPOSOTION_STATE = '待确认' AND DISPOSOTION_STATE = '待确认'
and GATEWAY_ID = #{fanGatewayId} AND (GATEWAY_ID = #{fanGatewayId} or GATEWAY_ID = #{syzGatewayId})
ORDER BY ORDER BY
sort DESC, sort DESC,
REC_DATE DESC REC_DATE DESC
...@@ -1372,12 +1372,12 @@ FROM ( ...@@ -1372,12 +1372,12 @@ FROM (
AND REC_DATE >= DATE_ADD( #{recDate}, INTERVAL - 12 hour ) AND REC_DATE >= DATE_ADD( #{recDate}, INTERVAL - 12 hour )
AND ANALYSIS_TYPE = '按10分钟' AND ANALYSIS_TYPE = '按10分钟'
AND INDEX_ADDRESS = #{indexAddress} AND INDEX_ADDRESS = #{indexAddress}
AND GATEWAY_ID = #{fanGatewayId} AND (GATEWAY_ID = #{fanGatewayId} or GATEWAY_ID = #{syzGatewayId})
</select> </select>
<select id="getIsWarningByPointId" resultType="int"> <select id="getIsWarningByPointId" resultType="int">
select count(1) from ${tableName} select count(1) from ${tableName}
where INDEX_ADDRESS = #{indexAddress} where INDEX_ADDRESS = #{indexAddress}
AND GATEWAY_ID = #{fanGatewayId} AND (GATEWAY_ID = #{fanGatewayId} or GATEWAY_ID = #{syzGatewayId})
and DISPOSOTION_STATE = '待确认' and DISPOSOTION_STATE = '待确认'
</select> </select>
<select id="getStationIndexInfoByParam" resultType="java.util.Map"> <select id="getStationIndexInfoByParam" resultType="java.util.Map">
...@@ -1770,7 +1770,7 @@ TIMESTAMPDIFF( MINUTE, #{startTime} , #{endTime})/10 >= @s-1 ...@@ -1770,7 +1770,7 @@ TIMESTAMPDIFF( MINUTE, #{startTime} , #{endTime})/10 >= @s-1
from fan_health_index_latest_data from fan_health_index_latest_data
where where
INDEX_ADDRESS = #{indexAddress} INDEX_ADDRESS = #{indexAddress}
and GATEWAY_ID = #{gatewayId} AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
and ANALYSIS_OBJ_TYPE = '测点' and ANALYSIS_OBJ_TYPE = '测点'
and ANALYSIS_TYPE = '按天' and ANALYSIS_TYPE = '按天'
limit 1 limit 1
...@@ -1782,7 +1782,7 @@ TIMESTAMPDIFF( MINUTE, #{startTime} , #{endTime})/10 >= @s-1 ...@@ -1782,7 +1782,7 @@ TIMESTAMPDIFF( MINUTE, #{startTime} , #{endTime})/10 >= @s-1
from pv_health_index_latest_data from pv_health_index_latest_data
where where
INDEX_ADDRESS = #{indexAddress} INDEX_ADDRESS = #{indexAddress}
and GATEWAY_ID = #{gatewayId} AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
and ANALYSIS_OBJ_TYPE = '测点' and ANALYSIS_OBJ_TYPE = '测点'
and ANALYSIS_TYPE = '按天' and ANALYSIS_TYPE = '按天'
limit 1 limit 1
......
...@@ -373,7 +373,7 @@ ...@@ -373,7 +373,7 @@
and a.warningname = #{warningName} and a.warningname = #{warningName}
</if> </if>
<if test="stationId != '' and stationId != null"> <if test="stationId != '' and stationId != null">
and a.gateway_id = #{stationId} and (a.gateway_id = #{stationId} or a.gateway_id=#{syzGatewayId})
</if> </if>
<if test="startDate != '' and startDate != null"> <if test="startDate != '' and startDate != null">
and a.recDate >= concat(#{startDate}, ' 00:00:00') and a.recDate >= concat(#{startDate}, ' 00:00:00')
...@@ -438,7 +438,7 @@ ...@@ -438,7 +438,7 @@
and a.warningname = #{warningName} and a.warningname = #{warningName}
</if> </if>
<if test="stationId != '' and stationId != null"> <if test="stationId != '' and stationId != null">
and a.gateway_id = #{stationId} and (a.gateway_id = #{stationId} or a.gateway_id=#{syzGatewayId})
</if> </if>
<if test="startDate != '' and startDate != null"> <if test="startDate != '' and startDate != null">
and a.recDate >= concat(#{startDate}, ' 00:00:00') and a.recDate >= concat(#{startDate}, ' 00:00:00')
......
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