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 {
@GetMapping("/getFanInfoByPage")
public ResponseModel<Page<Map<String, Object>>> getFanInfoByPage(@RequestParam(value = "stationId", required = false) String 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())));
equipmentList.forEach(item -> {
......@@ -488,13 +488,13 @@ public class BigScreenAnalyseController extends BaseController {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
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", ""))));
List<Object> seriesData = 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 -> {
Integer equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("subSystem"), 100);
seriesData.add(equipmentHealthScore);
......@@ -524,7 +524,7 @@ private FanHealthIndexMapper fanHealthIndexMapper;
Map<Object, String> equipmentHealthIndexMap = healthListInfo.stream()
.collect(Collectors.toMap(t -> t.get("pointname"), t -> t.get("warningname").toString()));
List<Map<String, Object>> pointNameList = idxBizFanHealthIndexMapper
.getPointNameListBySumSystem(stationBasic.getFanGatewayId(), subSystem, equipmentName);
.getPointNameListBySumSystem(stationBasic.getFanGatewayId(), subSystem, equipmentName,stationBasic.getBoosterGatewayId());
pointNameList.forEach(item -> {
String warningName = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), "安全");
int sort = 4;
......@@ -557,9 +557,9 @@ private FanHealthIndexMapper fanHealthIndexMapper;
@GetMapping("/getPvInfoByPage")
public ResponseModel<Page<Map<String, Object>>> getPvInfoByPage(@RequestParam(value = "stationId", required = false) String 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())));
equipmentList.forEach(item -> {
......@@ -599,13 +599,13 @@ private FanHealthIndexMapper fanHealthIndexMapper;
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
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", "")));
List<Object> seriesData = 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 -> {
Object equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("equipmentName"), 100);
seriesData.add(equipmentHealthScore);
......@@ -623,11 +623,11 @@ private FanHealthIndexMapper fanHealthIndexMapper;
@RequestParam(value = "stationId", required = false) String 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())));
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 -> {
Double equipmentHealthScore = equipmentHealthIndexMap.getOrDefault(item.get("pointName"), 100.0);
......@@ -724,9 +724,9 @@ private FanHealthIndexDayMapper fanHealthIndexDayMapper;
@RequestParam(value = "stationId", required = true) String stationId,
@RequestParam(value = "tableName2", required = false) String tableName2) {
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<>();
resultMap.put("text", nameByIndexAddress);
......@@ -742,7 +742,7 @@ private FanHealthIndexDayMapper fanHealthIndexDayMapper;
@RequestParam(value = "stationId") String 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;
try {
sevenEntityMcb = riskWarningFeign.getRiskHandleByVarDesc(varDesc);
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
......@@ -124,4 +125,6 @@ public class IdxBizFanWarningRuleSet {
@TableField("GATEWAY_ID")
private String gatewayId;
@TableField("ORG_CODE")
private String orgCode;
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
......@@ -140,4 +141,8 @@ public class IdxBizPvWarningRuleSet{
*/
@TableField("GATEWAY_ID")
private String gatewayId;
@TableField("ORG_CODE")
private String orgCode;
}
......@@ -59,47 +59,49 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List<Map<String, Object>> getAllEquipAlarmInfoAnalysisByArea(@Param("areaCode") String areaCode);
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,
@Param("equipmentName") String equipmentName);
@Param("equipmentName") String equipmentName,@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> getPointNameListBySumSystem(@Param("gatewayId") String gatewayId,
@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,
@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,
@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,
@Param("gatewayId") String gatewayId);
@Param("gatewayId") String gatewayId,@Param("syzGatewayId") String syzGatewayId);
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,
@Param("gatewayId") String gatewayId);
@Param("gatewayId") String gatewayId,@Param("syzGatewayId") String syzGatewayId);
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,
@Param("equipmentName") String equipmentName);
@Param("equipmentName") String equipmentName,@Param("syzGatewayId") String syzGatewayId);
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);
......@@ -150,19 +152,19 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
Map<String, Object> getPvEquipStatusByStation(String station);
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,
@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,
@Param("tableName") String tableName);
@Param("tableName") String tableName,@Param("syzGatewayId") String syzGatewayId);
List<Map<String, Object>> queryIndexByArae(String ARAE, String ANALYSISTYPE, String startTimeTop,
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 {
processValue1 = 0.0;
}
currentValueMap.put("processValue1", keepOneKeepDecimalPlace(processValue1));
if(ObjectUtils.isEmpty(analyseValue)){
if(ObjectUtils.isEmpty(processValue2)){
processValue2 = 0.0;
}
currentValueMap.put("processValue2", keepOneKeepDecimalPlace(processValue2));
......
......@@ -205,7 +205,7 @@ public class HealthStatusIndicatorServiceImpl {
for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId);
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic);
......@@ -588,7 +588,7 @@ public class HealthStatusIndicatorServiceImpl {
// for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gatewayId);
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gatewayId).or().eq(StationBasic::getBoosterGatewayId, gatewayId);
basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gatewayId, stationBasic);
......@@ -792,7 +792,7 @@ public class HealthStatusIndicatorServiceImpl {
for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId);
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic);
......@@ -1005,7 +1005,7 @@ public class HealthStatusIndicatorServiceImpl {
// for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId);
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic);
......@@ -1218,7 +1218,7 @@ public class HealthStatusIndicatorServiceImpl {
for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId);
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic);
......@@ -1433,7 +1433,7 @@ public class HealthStatusIndicatorServiceImpl {
// for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId);
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic);
......@@ -1658,7 +1658,7 @@ public class HealthStatusIndicatorServiceImpl {
for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId);
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic);
......@@ -1887,7 +1887,7 @@ public class HealthStatusIndicatorServiceImpl {
// for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gatewayId);
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gatewayId).or().eq(StationBasic::getBoosterGatewayId, gatewayId);
basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gatewayId, stationBasic);
......@@ -2111,7 +2111,7 @@ public class HealthStatusIndicatorServiceImpl {
for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId);
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic);
......@@ -2331,7 +2331,7 @@ public class HealthStatusIndicatorServiceImpl {
// for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId);
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic);
......@@ -2550,7 +2550,7 @@ public class HealthStatusIndicatorServiceImpl {
for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId);
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gateWayId).or().eq(StationBasic::getBoosterGatewayId, gateWayId);
basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gateWayId, stationBasic);
......@@ -2768,7 +2768,7 @@ public class HealthStatusIndicatorServiceImpl {
// for (String gateWayId : gateWayMaps.keySet()) {
LambdaQueryWrapper<StationBasic> basicLambdaQueryWrapper = new LambdaQueryWrapper<>();
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gatewayId);
basicLambdaQueryWrapper.eq(StationBasic::getFanGatewayId, gatewayId).or().eq(StationBasic::getBoosterGatewayId, gatewayId);
basicLambdaQueryWrapper.last("limit 1");
StationBasic stationBasic = stationBasicMapper.selectOne(basicLambdaQueryWrapper);
stationMap.put(gatewayId, stationBasic);
......
......@@ -50,23 +50,23 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
@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='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);
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();
@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='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);
List<Map<String, Object>> selectEquipStatusByEquipment( @Param("analysisObjType") String analysisObjType, @Param("station") String station, @Param("equipmentName") String equipmentName,@Param("startTimeTop") String startTimeTop);
@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" +
......
......@@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
public interface FanHealthIndexHourMapper extends BaseMapper<FanHealthIndexHour> {
@Select("<script>" +
......@@ -47,4 +48,22 @@ public interface FanHealthIndexHourMapper extends BaseMapper<FanHealthIndexHour>
@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.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;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
public interface FanHealthIndexMomentMapper extends BaseMapper<FanHealthIndexMoment> {
@Select("<script>" +
......@@ -46,4 +47,22 @@ public interface FanHealthIndexMomentMapper extends BaseMapper<FanHealthIndexMom
@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.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> {
@Param("warningName") String warningName,
@Param("stationId") String stationId,
@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);
......
package com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2;
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 org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
......@@ -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);
@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='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);
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_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='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);
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>"+
......
package com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2;
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 org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
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" +
" FROM analysis_data.pv_health_index_hour WHERE analysis_obj_type = #{analysisObjType}" +
"<if test='endTimeTop!= null'> and analysis_time &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and analysis_time &gt;= #{startTimeTop} </if> " +
" FROM analysis_data.pv_health_index_hour WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" +
"<if test='endTimeTop!= null'> and ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null '> AND area = #{area} </if> " +
"<if test='indexAddress!= null '> AND index_address = #{indexAddress} </if> " +
"<if test='pointName!= null '>AND point_name = #{pointName} </if> " +
......@@ -24,11 +24,22 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> {
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </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>" +
"order by health_index " +
"order by health_index "+
"<if test='current != null and size != null'>limit ${current},${size} </if>" +
"</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
, @Param("current") Integer current, @Param("size") Integer size, @Param("orgCode") String orgCode);
List<PvHealthIndexHour> selectData(@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("current")Integer current, @Param("size")Integer size,@Param("orgCode") String orgCode);
@Select("<script>" +
"SELECT count(1)" +
......@@ -130,4 +141,24 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> {
@Param("endTimeTop")String endTimeTop,
@Param("equipmentName")String equipmentName
, @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;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
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" +
" FROM analysis_data.pv_health_index_moment WHERE analysis_obj_type = #{analysisObjType}" +
"<if test='endTimeTop!= null'> and analysis_time &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and analysis_time &gt;= #{startTimeTop} </if> " +
" FROM analysis_data.pv_health_index_moment WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" +
"<if test='endTimeTop!= null'> and ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null '> AND area = #{area} </if> " +
"<if test='indexAddress!= null '> AND index_address = #{indexAddress} </if> " +
"<if test='pointName!= null '>AND point_name = #{pointName} </if> " +
......@@ -22,13 +24,25 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" +
"<if test='subarray!= null'>AND subarray = #{subarray} </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>" +
"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>" +
"</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
, @Param("current") Integer current, @Param("size") Integer size, @Param("orgCode") String orgCode);
List<PvHealthIndexMoment> selectData(@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("current")Integer current, @Param("size")Integer size,@Param("orgCode") String orgCode);
@Select("<script>" +
"SELECT count(1)" +
......@@ -127,4 +141,25 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen
@Param("endTimeTop")String endTimeTop,
@Param("equipmentName")String equipmentName
, @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
spring.redis.port=6379
spring.redis.password=yeejoin@2020
openHealth=true
openHealth=false
spring.cache.type=GENERIC
j2cache.open-spring-cache=true
j2cache.cache-clean-mode=passive
......
......@@ -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' ) = get_time_sub(1,'DAY')-->
<if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机')
AND (EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机') or EQUIPMENT_NAME = #{equipmentName})
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if>
</where>
group by subSystem
......@@ -509,9 +509,9 @@ FROM (
FROM
idx_biz_fan_point_process_variable_classification
<where>
EQUIPMENT_NAME LIKE '%#%'
(EQUIPMENT_NAME LIKE '%#%' or EQUIPMENT_NAME='升压站')
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if>
</where>
GROUP BY
......@@ -530,7 +530,7 @@ FROM (
AND ANALYSIS_TYPE = '按10分钟'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if>
</where>
GROUP BY
......@@ -546,10 +546,10 @@ FROM (
SUB_SYSTEM IS NOT NULL AND SUB_SYSTEM != ''
AND TAG_CODE = '分析变量'
<if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机')
AND (EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机') or EQUIPMENT_NAME = #{equipmentName})
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if>
</where>
GROUP BY
......@@ -568,7 +568,7 @@ FROM (
AND SUB_SYSTEM = #{subSystem}
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if>
<if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME like #{equipmentName}
......@@ -592,7 +592,7 @@ FROM (
AND SUB_SYSTEM = #{subSystem}
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if>
<if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME like #{equipmentName}
......@@ -613,7 +613,7 @@ FROM (
AND SUB_SYSTEM = #{subSystem}
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if>
</where>
GROUP BY
......@@ -629,7 +629,7 @@ FROM (
idx_biz_pv_point_process_variable_classification
<where>
<if test="gatewayId != null and gatewayId != ''">
GATEWAY_ID = #{gatewayId}
GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId}
</if>
</where>
GROUP BY
......@@ -648,7 +648,7 @@ FROM (
AND ANALYSIS_TYPE = '按10分钟'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if>
</where>
GROUP BY SUBARRAY
......@@ -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' ) = get_time_sub(1,'DAY')-->
<if test="subarray != null and subarray != ''">
AND SUBARRAY = concat('#', #{subarray})
AND (SUBARRAY = concat('#', #{subarray}) or SUBARRAY=#{subarray})
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if>
</where>
group by EQUIPMENT_NAME
......@@ -684,10 +684,10 @@ FROM (
AND EQUIPMENT_NAME != ''
AND TAG_CODE = '分析变量'
<if test="subarray != null and subarray != ''">
AND SUBARRAY = concat('#', #{subarray})
AND (SUBARRAY = concat('#', #{subarray}) or SUBARRAY=#{subarray})
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if>
</where>
GROUP BY
......@@ -708,7 +708,7 @@ FROM (
AND EQUIPMENT_NAME = #{equipmentName}
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if>
</where>
GROUP BY
......@@ -726,7 +726,7 @@ FROM (
AND EQUIPMENT_NAME = #{equipmentName}
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if>
</where>
GROUP BY
......@@ -747,7 +747,7 @@ FROM (
AND EQUIPMENT_NAME = #{equipmentName}
</if>
<if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
</if>
</where>
GROUP BY
......@@ -757,7 +757,7 @@ FROM (
select POINT_NAME
from ${tableName}
where INDEX_ADDRESS = #{varDesc}
and GATEWAY_ID = #{gatewayId}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
limit 1
......@@ -1354,7 +1354,7 @@ FROM (
WHERE
INDEX_ADDRESS = #{indexAddress}
AND DISPOSOTION_STATE = '待确认'
and GATEWAY_ID = #{fanGatewayId}
AND (GATEWAY_ID = #{fanGatewayId} or GATEWAY_ID = #{syzGatewayId})
ORDER BY
sort DESC,
REC_DATE DESC
......@@ -1372,12 +1372,12 @@ FROM (
AND REC_DATE >= DATE_ADD( #{recDate}, INTERVAL - 12 hour )
AND ANALYSIS_TYPE = '按10分钟'
AND INDEX_ADDRESS = #{indexAddress}
AND GATEWAY_ID = #{fanGatewayId}
AND (GATEWAY_ID = #{fanGatewayId} or GATEWAY_ID = #{syzGatewayId})
</select>
<select id="getIsWarningByPointId" resultType="int">
select count(1) from ${tableName}
where INDEX_ADDRESS = #{indexAddress}
AND GATEWAY_ID = #{fanGatewayId}
AND (GATEWAY_ID = #{fanGatewayId} or GATEWAY_ID = #{syzGatewayId})
and DISPOSOTION_STATE = '待确认'
</select>
<select id="getStationIndexInfoByParam" resultType="java.util.Map">
......@@ -1770,7 +1770,7 @@ TIMESTAMPDIFF( MINUTE, #{startTime} , #{endTime})/10 >= @s-1
from fan_health_index_latest_data
where
INDEX_ADDRESS = #{indexAddress}
and GATEWAY_ID = #{gatewayId}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
and ANALYSIS_OBJ_TYPE = '测点'
and ANALYSIS_TYPE = '按天'
limit 1
......@@ -1782,7 +1782,7 @@ TIMESTAMPDIFF( MINUTE, #{startTime} , #{endTime})/10 >= @s-1
from pv_health_index_latest_data
where
INDEX_ADDRESS = #{indexAddress}
and GATEWAY_ID = #{gatewayId}
AND (GATEWAY_ID = #{gatewayId} or GATEWAY_ID = #{syzGatewayId})
and ANALYSIS_OBJ_TYPE = '测点'
and ANALYSIS_TYPE = '按天'
limit 1
......
......@@ -373,7 +373,7 @@
and a.warningname = #{warningName}
</if>
<if test="stationId != '' and stationId != null">
and a.gateway_id = #{stationId}
and (a.gateway_id = #{stationId} or a.gateway_id=#{syzGatewayId})
</if>
<if test="startDate != '' and startDate != null">
and a.recDate >= concat(#{startDate}, ' 00:00:00')
......@@ -438,7 +438,7 @@
and a.warningname = #{warningName}
</if>
<if test="stationId != '' and stationId != null">
and a.gateway_id = #{stationId}
and (a.gateway_id = #{stationId} or a.gateway_id=#{syzGatewayId})
</if>
<if test="startDate != '' and startDate != null">
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