Commit 3457cfb9 authored by zhangsen's avatar zhangsen

td相关 - 预警光伏和风电页面开发

parent e12b3f51
...@@ -14,9 +14,13 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper ...@@ -14,9 +14,13 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthLevelMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthLevelMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord;
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.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
...@@ -45,6 +49,12 @@ public class TdInfoQueryController { ...@@ -45,6 +49,12 @@ public class TdInfoQueryController {
private PvHealthIndexMapper pvHealthIndexMapper; private PvHealthIndexMapper pvHealthIndexMapper;
@Autowired @Autowired
private FanWaringRecordMapper fanWaringRecordMapper;
@Autowired
private PvWaringRecordMapper pvWaringRecordMapper;
@Autowired
IdxBizFanHealthLevelMapper idxBizFanHealthLevelMapper; IdxBizFanHealthLevelMapper idxBizFanHealthLevelMapper;
@Autowired @Autowired
...@@ -123,230 +133,73 @@ public class TdInfoQueryController { ...@@ -123,230 +133,73 @@ public class TdInfoQueryController {
return ResponseHelper.buildResponse(resultPage); return ResponseHelper.buildResponse(resultPage);
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "全景诊断回溯") @PostMapping(value = "/getFanWarningRecordInfo")
@GetMapping("/getFullViewRecall") @ApiOperation(httpMethod = "POST", value = "分页查询健康指数信息 - 风电", notes = "分页查询健康指数信息 - 风电")
public ResponseModel<List<FullViewRecallInfoDTO>> getFullViewRecall(@RequestParam(required = false, value = "analysisType") String analysisType) { public ResponseModel<Page<FanWarningRecord>> getFanWarningRecordInfo(@RequestBody FanHealthIndexDto dto) throws ParseException {
List<Map<String, Object>> stationIndexInfo = idxBizFanHealthIndexMapper.getStationIndexInfoByParam(analysisType); if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) {
Map<String, Double> stationHealthIndexMap = stationIndexInfo.stream().collect(Collectors.toMap(t -> t.get("station").toString(), t -> Double.parseDouble(t.get("healthIndex").toString()))); String startDate = dto.getStartDate();
Date date = DateUtils.dateParse(startDate, DATE_TIME_PATTERN);
String startDateString = DateUtils.dateFormat(DateUtils.dateAddHours(date, -8), DATE_TIME_PATTERN);
List<Map<String, Object>> equipmentIndexInfo = idxBizFanHealthIndexMapper.getEquipmentIndexInfoByParam(analysisType); dto.setStartDate(startDateString);
Map<String, Double> equipmentIndexInfoMap = equipmentIndexInfo.stream().collect(Collectors.toMap(t -> t.get("equipmentName").toString(), t -> Double.parseDouble(t.get("healthIndex").toString()))); }
if (CharSequenceUtil.isNotEmpty(dto.getEndDate())) {
String endDate = dto.getEndDate();
List<Map<String, Object>> subSystemIndexInfo = idxBizFanHealthIndexMapper.getSubSystemIndexInfoByParam(analysisType); Date endDateDate = DateUtils.dateParse(endDate, DATE_TIME_PATTERN);
Map<String, Double> subSystemIndexInfoMap = subSystemIndexInfo.stream().collect(Collectors.toMap(t -> t.get("subSystem").toString(), t -> Double.parseDouble(t.get("healthIndex").toString()))); String endDateString = DateUtils.dateFormat(DateUtils.dateAddHours(endDateDate, -8), DATE_TIME_PATTERN);
dto.setEndDate(endDateString);
}
List<Map<String, Object>> pointNameIndexInfo = idxBizFanHealthIndexMapper.getPointNameIndexInfoByParam(analysisType); Page<FanWarningRecord> resultPage = new Page<>(dto.getCurrent(), dto.getSize());
Map<String, Double> pointNameIndexInfoMap = pointNameIndexInfo.stream().collect(Collectors.toMap(t -> t.get("gatewayIndexAddress").toString(), t -> Double.parseDouble(t.get("healthIndex").toString()))); dto.setCurrent((dto.getCurrent() - 1) * dto.getSize());
List<Map<String, String>> orderWeight = dto.getSorts().stream().sorted(Comparator.comparing(t -> Integer.parseInt(t.get("orderWeight")))).collect(Collectors.toList());
List<String> orderByList = new ArrayList<>();
List<IdxBizFanHealthLevel> healthLevelInfoList = idxBizFanHealthIndexMapper.getHealthLevelInfoList(); for (Map<String, String> map : orderWeight) {
String replace = map.get("order").replace("end", "");
List<FullViewRecallDataDTO> list = idxBizFanHealthIndexMapper.getFullViewRecall(); String columnOrder = map.get("columnKey") + " " + replace;
Map<String, Map<String, Map<String, Map<String, Map<String, List<FullViewRecallDataDTO>>>>>> resultMap = list.stream() orderByList.add(columnOrder);
.collect(Collectors.groupingBy(FullViewRecallDataDTO::getArea,
Collectors.groupingBy(FullViewRecallDataDTO::getStation,
Collectors.groupingBy(FullViewRecallDataDTO::getEquipmentName,
Collectors.groupingBy(FullViewRecallDataDTO::getSubSystem,
Collectors.groupingBy(FullViewRecallDataDTO::getPointName))))));
int areaInt = 1;
int pointNameInt = 1;
int stationInt = 1;
int equipmentInt = 1;
int subSystemInt = 1;
Double healthScoreInfo = idxBizFanHealthIndexMapper.getHealthScoreInfoByParam(null, null, analysisType).doubleValue();
LambdaQueryWrapper<IdxBizFanHealthLevel> query = new LambdaQueryWrapper<>();
query.isNull(IdxBizFanHealthLevel::getStatus);
query.eq(IdxBizFanHealthLevel::getAnalysisObjType, "全域");
query.lt(IdxBizFanHealthLevel::getGroupLowerLimit, healthScoreInfo);
query.ge(IdxBizFanHealthLevel::getGroupUpperLimit, healthScoreInfo);
IdxBizFanHealthLevel idxBizFanHealthLevel = idxBizFanHealthLevelMapper.selectOne(query);
FullViewRecallInfoDTO allMapDto = new FullViewRecallInfoDTO();
allMapDto.setKey("0");
allMapDto.setName("全域设备健康状态指数");
allMapDto.setScoreRange("");
allMapDto.setStatus(idxBizFanHealthLevel.getHealthLevel());
allMapDto.setScore(healthScoreInfo);
allMapDto.setIsRoot(true);
allMapDto.setCategory("category");
allMapDto.setChildren(new ArrayList<>());
allMapDto.setParentKey("0");
for (Map.Entry<String, Map<String, Map<String, Map<String, Map<String, List<FullViewRecallDataDTO>>>>>> areaMap : resultMap.entrySet()) {
Double areaLowScore = null;
Double areaHighScore = null;
Double areaHealthScoreInfo = idxBizFanHealthIndexMapper.getHealthScoreInfoByParam(areaMap.getKey(), null, analysisType).doubleValue();
LambdaQueryWrapper<IdxBizFanHealthLevel> areaQuery = new LambdaQueryWrapper<>();
areaQuery.isNull(IdxBizFanHealthLevel::getStatus);
areaQuery.eq(IdxBizFanHealthLevel::getAnalysisObjType, "片区");
areaQuery.lt(IdxBizFanHealthLevel::getGroupLowerLimit, areaHealthScoreInfo);
areaQuery.ge(IdxBizFanHealthLevel::getGroupUpperLimit, areaHealthScoreInfo);
IdxBizFanHealthLevel areaIdxBizFanHealthLevel = idxBizFanHealthLevelMapper.selectOne(areaQuery);
FullViewRecallInfoDTO areaMapDto = new FullViewRecallInfoDTO();
areaMapDto.setKey("0-" + areaInt);
areaMapDto.setName(areaMap.getKey());
areaMapDto.setStatus(areaIdxBizFanHealthLevel.getHealthLevel());
areaMapDto.setScore(areaHealthScoreInfo);
areaMapDto.setParentKey(allMapDto.getKey());
allMapDto.getChildren().add(areaMapDto);
areaInt++;
List<FullViewRecallInfoDTO> areaMapList = new ArrayList<>();
for (Map.Entry<String, Map<String, Map<String, Map<String, List<FullViewRecallDataDTO>>>>> stationMap : areaMap.getValue().entrySet()) {
Double stationLowScore = null;
Double stationHighScore = null;
if (areaLowScore == null && areaHighScore == null) {
areaLowScore = stationHealthIndexMap.getOrDefault(stationMap.getKey(), 100.0);
areaHighScore = stationHealthIndexMap.getOrDefault(stationMap.getKey(), 100.0);
} else {
if (stationHealthIndexMap.getOrDefault(stationMap.getKey(), 100.0) < areaLowScore) {
areaLowScore = stationHealthIndexMap.getOrDefault(stationMap.getKey(), 100.0);
}
if (stationHealthIndexMap.getOrDefault(stationMap.getKey(), 100.0) > areaHighScore) {
areaHighScore = stationHealthIndexMap.getOrDefault(stationMap.getKey(), 100.0);
}
}
FullViewRecallInfoDTO stationDto = new FullViewRecallInfoDTO();
stationDto.setKey(areaMapDto.getKey() + "-" + stationInt);
stationDto.setName(stationMap.getKey());
stationDto.setStatus("");
stationDto.setScore(stationHealthIndexMap.getOrDefault(stationMap.getKey(), 100.0));
LambdaQueryWrapper<IdxBizFanHealthLevel> stationQuery = new LambdaQueryWrapper<>();
stationQuery.like(IdxBizFanHealthLevel::getStatus, stationMap.getKey());
stationQuery.eq(IdxBizFanHealthLevel::getAnalysisObjType, "场站");
stationQuery.lt(IdxBizFanHealthLevel::getGroupLowerLimit, stationDto.getScore());
stationQuery.ge(IdxBizFanHealthLevel::getGroupUpperLimit, stationDto.getScore());
IdxBizFanHealthLevel stationLevel = idxBizFanHealthLevelMapper.selectOne(stationQuery);
stationDto.setStatus(ObjectUtils.isNotEmpty(stationLevel) ? stationLevel.getHealthLevel() : "");
if (ObjectUtils.isEmpty(stationLevel)) {
LambdaQueryWrapper<IdxBizPvHealthLevel> stationPvQuery = new LambdaQueryWrapper<>();
stationPvQuery.like(IdxBizPvHealthLevel::getStatus, stationMap.getKey());
stationPvQuery.eq(IdxBizPvHealthLevel::getAnalysisObjType, "场站");
stationPvQuery.lt(IdxBizPvHealthLevel::getGroupLowerLimit, stationDto.getScore());
stationPvQuery.ge(IdxBizPvHealthLevel::getGroupUpperLimit, stationDto.getScore());
IdxBizPvHealthLevel stationPvLevel = idxBizPvHealthLevelMapper.selectOne(stationPvQuery);
if (ObjectUtils.isNotEmpty(stationPvLevel)) {
stationDto.setStatus(stationPvLevel.getHealthLevel());
}
}
stationDto.setParentKey(areaMapDto.getKey());
areaMapDto.getChildren().add(stationDto);
stationInt++;
for (Map.Entry<String, Map<String, Map<String, List<FullViewRecallDataDTO>>>> equipmentMap : stationMap.getValue().entrySet()) {
if (stationLowScore == null && stationHighScore == null) {
stationLowScore = equipmentIndexInfoMap.getOrDefault(equipmentMap.getKey(), 100.0);
stationHighScore = equipmentIndexInfoMap.getOrDefault(equipmentMap.getKey(), 100.0);
} else {
if (equipmentIndexInfoMap.getOrDefault(equipmentMap.getKey(), 100.0) < stationLowScore) {
stationLowScore = equipmentIndexInfoMap.getOrDefault(equipmentMap.getKey(), 100.0);
}
if (equipmentIndexInfoMap.getOrDefault(equipmentMap.getKey(), 100.0) > stationHighScore) {
stationHighScore = equipmentIndexInfoMap.getOrDefault(equipmentMap.getKey(), 100.0);
}
}
FullViewRecallInfoDTO equipmentMapDto = new FullViewRecallInfoDTO();
equipmentMapDto.setKey(stationDto.getKey() + "-" + equipmentInt);
equipmentMapDto.setName(equipmentMap.getKey());
equipmentMapDto.setScoreRange("");
IdxBizFanHealthLevel levelInfo = getHealthLevelByScore(healthLevelInfoList, stationMap.getKey(), "设备", equipmentIndexInfoMap.getOrDefault(equipmentMap.getKey(), 100.0));
equipmentMapDto.setStatus(levelInfo.getHealthLevel());
equipmentMapDto.setScore(equipmentIndexInfoMap.getOrDefault(equipmentMap.getKey(), 100.0));
equipmentMapDto.setParentKey(stationDto.getKey());
stationDto.getChildren().add(equipmentMapDto);
equipmentInt++;
for (Map.Entry<String, Map<String, List<FullViewRecallDataDTO>>> subSystemMap : equipmentMap.getValue().entrySet()) {
FullViewRecallInfoDTO subSystemMapDto = new FullViewRecallInfoDTO();
subSystemMapDto.setKey(equipmentMapDto.getKey() + "-" + subSystemInt);
subSystemMapDto.setName(subSystemMap.getKey());
subSystemMapDto.setScoreRange("");
// subSystemMapDto.setStatus(null);
IdxBizFanHealthLevel levelInfoZxt = getHealthLevelByScore(healthLevelInfoList, stationMap.getKey(), "子系统", subSystemIndexInfoMap.getOrDefault(subSystemMap.getKey(), 100.0));
subSystemMapDto.setStatus(levelInfoZxt.getHealthLevel());
subSystemMapDto.setScore(subSystemIndexInfoMap.getOrDefault(subSystemMap.getKey(), 100.0));
subSystemMapDto.setParentKey(equipmentMapDto.getKey());
equipmentMapDto.getChildren().add(subSystemMapDto);
subSystemInt++;
for (Map.Entry<String, List<FullViewRecallDataDTO>> pointNameMap : subSystemMap.getValue().entrySet()) {
FullViewRecallInfoDTO pointNameMapDto = new FullViewRecallInfoDTO();
pointNameMapDto.setKey(subSystemMapDto.getKey() + "-" + pointNameInt);
pointNameMapDto.setName(pointNameMap.getKey());
FullViewRecallDataDTO fullViewRecallDataDTO = pointNameMap.getValue().get(0);
pointNameMapDto.setScoreRange("");
IdxBizFanHealthLevel levelInfoBL = getHealthLevelByScore(healthLevelInfoList, stationMap.getKey(), "测点", pointNameIndexInfoMap.getOrDefault(fullViewRecallDataDTO.getStation() + "_" + fullViewRecallDataDTO.getIndexAddress(), 100.0));
pointNameMapDto.setStatus(levelInfoBL.getHealthLevel());
pointNameMapDto.setScore(pointNameIndexInfoMap.getOrDefault(fullViewRecallDataDTO.getStation() + "_" + fullViewRecallDataDTO.getIndexAddress(), 100.0));
pointNameMapDto.setParentKey(subSystemMapDto.getKey());
subSystemMapDto.getChildren().add(pointNameMapDto);
pointNameInt++;
}
}
}
stationDto.setScoreRange("(最高:" + stationLowScore + "分, 最低:" + stationHighScore + "分)");
}
areaMapDto.setScoreRange("(最高:" + areaLowScore + "分, 最低:" + areaHighScore + "分)");
} }
List<FullViewRecallInfoDTO> resultList = new ArrayList<>(); String join = String.join(",", orderByList);
resultList.add(allMapDto); dto.setOrderColumns(join);
return ResponseHelper.buildResponse(resultList); List<FanWarningRecord> fanWarningRecordsIPage = fanWaringRecordMapper.getInfoByPage(dto);
Integer infoByPageTotal = fanWaringRecordMapper.getInfoByPageTotal(dto);
resultPage.setRecords(fanWarningRecordsIPage);
resultPage.setTotal(infoByPageTotal);
return ResponseHelper.buildResponse(resultPage);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
private IdxBizFanHealthLevel getHealthLevelByScore(List<IdxBizFanHealthLevel> healthLevelInfoList, String station, String type, Double score) { @PostMapping(value = "/getPvWarningRecordInfo")
@ApiOperation(httpMethod = "POST", value = "分页查询健康指数信息 - 光伏", notes = "分页查询健康指数信息 - 光伏")
IdxBizFanHealthLevel resultDto = new IdxBizFanHealthLevel(); public ResponseModel<Page<PvWarningRecord>> getPvWarningRecordInfo(@RequestBody FanHealthIndexDto dto) throws ParseException {
if (CharSequenceUtil.isNotEmpty(dto.getStartDate())) {
String stationType = "风电站"; String startDate = dto.getStartDate();
List<IdxBizFanHealthLevel> collect = healthLevelInfoList.stream().filter(item -> item.getAnalysisObjType().contains(station)).collect(Collectors.toList()); Date date = DateUtils.dateParse(startDate, DATE_TIME_PATTERN);
for (IdxBizFanHealthLevel item : collect) { String startDateString = DateUtils.dateFormat(DateUtils.dateAddHours(date, -8), DATE_TIME_PATTERN);
if (item.getAnalysisObjType().contains("子阵")) { dto.setStartDate(startDateString);
stationType = "光伏站";
break;
}
} }
for (IdxBizFanHealthLevel item : collect) { if (CharSequenceUtil.isNotEmpty(dto.getEndDate())) {
if (type.equals("设备") && stationType.equals("风电站") && item.getAnalysisObjType().contains(type) && score >= item.getGroupLowerLimit() && score <= item.getGroupUpperLimit()) { String endDate = dto.getEndDate();
resultDto = item; Date endDateDate = DateUtils.dateParse(endDate, DATE_TIME_PATTERN);
break; String endDateString = DateUtils.dateFormat(DateUtils.dateAddHours(endDateDate, -8), DATE_TIME_PATTERN);
} dto.setEndDate(endDateString);
if (type.equals("子系统") && stationType.equals("风电站") && item.getAnalysisObjType().contains(type) && score >= item.getGroupLowerLimit() && score <= item.getGroupUpperLimit()) {
resultDto = item;
break;
}
if (type.equals("测点") && item.getAnalysisObjType().contains(type) && score >= item.getGroupLowerLimit() && score <= item.getGroupUpperLimit()) {
resultDto = item;
break;
}
if (type.equals("设备") && stationType.equals("光伏站") && item.getAnalysisObjType().contains("子阵") && score >= item.getGroupLowerLimit() && score <= item.getGroupUpperLimit()) {
resultDto = item;
break;
}
if (type.equals("子系统") && stationType.equals("光伏站") && item.getAnalysisObjType().contains("设备") && score >= item.getGroupLowerLimit() && score <= item.getGroupUpperLimit()) {
resultDto = item;
break;
}
} }
return resultDto;
Page<PvWarningRecord> resultPage = new Page<>(dto.getCurrent(), dto.getSize());
dto.setCurrent((dto.getCurrent() - 1) * dto.getSize());
List<Map<String, String>> orderWeight = dto.getSorts().stream().sorted(Comparator.comparing(t -> Integer.parseInt(t.get("orderWeight")))).collect(Collectors.toList());
List<String> orderByList = new ArrayList<>();
for (Map<String, String> map : orderWeight) {
String replace = map.get("order").replace("end", "");
String columnOrder = map.get("columnKey") + " " + replace;
orderByList.add(columnOrder);
}
String join = String.join(",", orderByList);
dto.setOrderColumns(join);
List<PvWarningRecord> pvWarningRecords = pvWaringRecordMapper.getInfoByPage(dto);
Integer infoByPageTotal = pvWaringRecordMapper.getInfoByPageTotal(dto);
resultPage.setRecords(pvWarningRecords);
resultPage.setTotal(infoByPageTotal);
return ResponseHelper.buildResponse(resultPage);
} }
} }
...@@ -37,4 +37,8 @@ public class FanHealthIndexDto implements Serializable { ...@@ -37,4 +37,8 @@ public class FanHealthIndexDto implements Serializable {
private Integer current; private Integer current;
private Integer size; private Integer size;
private String orderColumns; private String orderColumns;
private String warningName;
private String warningStatus;
private String disposotionState;
private String subarray;
} }
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.dto.FanHealthIndexDto;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -25,4 +26,8 @@ public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> { ...@@ -25,4 +26,8 @@ public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> {
int saveBatchWarningRecords(@Param("list") List<FanWarningRecord> list); int saveBatchWarningRecords(@Param("list") List<FanWarningRecord> list);
List<FanWarningRecord> getInfoByPage(@Param("dto") FanHealthIndexDto dto);
Integer getInfoByPageTotal(@Param("dto") FanHealthIndexDto dto);
} }
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.dto.FanHealthIndexDto;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord;
import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord; import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -19,4 +20,9 @@ public interface PvWaringRecordMapper extends BaseMapper<PvWarningRecord> { ...@@ -19,4 +20,9 @@ public interface PvWaringRecordMapper extends BaseMapper<PvWarningRecord> {
List<PvWarningRecord> selectWarningPoint(String STATION, String EQUIPMENTNAME, String SUBARRAY); List<PvWarningRecord> selectWarningPoint(String STATION, String EQUIPMENTNAME, String SUBARRAY);
List<Map<String, Object>> selectEquipWarningTotal(String STATION, String EQUIPMENTNAME, String SUBARRAY); List<Map<String, Object>> selectEquipWarningTotal(String STATION, String EQUIPMENTNAME, String SUBARRAY);
List<PvWarningRecord> getInfoByPage(@Param("dto") FanHealthIndexDto dto);
Integer getInfoByPageTotal(@Param("dto") FanHealthIndexDto dto);
} }
...@@ -177,4 +177,38 @@ ...@@ -177,4 +177,38 @@
`b`.`STATION`, `b`.`STATION`,
`b`.`EQUIPMENT_NAME` `b`.`EQUIPMENT_NAME`
</select> </select>
<select id="getInfoByPage" resultType="com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord">
SELECT * FROM fan_warning_record
<where>
<if test="dto.area!= null and dto.area!= ''"> AND arae = #{dto.area} </if>
<if test="dto.station!= null and dto.station!= ''">AND station = #{dto.station} </if>
<if test="dto.equipmentName!= null and dto.equipmentName!= ''">AND equipment_name = #{dto.equipmentName}</if>
<if test="dto.subSystem!= null and dto.subSystem!= ''">AND sub_system = #{dto.subSystem} </if>
<if test="dto.pointName!= null and dto.pointName!= ''">AND point_name = #{dto.pointName} </if>
<if test="dto.warningName!= null and dto.warningName!= ''">AND warning_name = #{dto.warningName} </if>
<if test="dto.disposotionState!= null and dto.disposotionState!= ''">AND disposotion_state = #{dto.disposotionState} </if>
<if test="dto.endDate!= null and dto.endDate!= '' "> and ts &lt;= #{dto.endDate} </if>
<if test="dto.startDate!= null and dto.startDate!= ''"> and ts &gt;= #{dto.startDate} </if>
</where>
<if test="dto.orderColumns != null and dto.orderColumns != ''">
order by ${dto.orderColumns}
</if>
limit #{dto.current}, #{dto.size}
</select>
<select id="getInfoByPageTotal" resultType="java.lang.Integer">
SELECT count(1) FROM fan_warning_record
<where>
<if test="dto.area!= null and dto.area!= ''"> AND arae = #{dto.area} </if>
<if test="dto.station!= null and dto.station!= ''">AND station = #{dto.station} </if>
<if test="dto.equipmentName!= null and dto.equipmentName!= ''">AND equipment_name = #{dto.equipmentName}</if>
<if test="dto.subSystem!= null and dto.subSystem!= ''">AND sub_system = #{dto.subSystem} </if>
<if test="dto.pointName!= null and dto.pointName!= ''">AND point_name = #{dto.pointName} </if>
<if test="dto.warningName!= null and dto.warningName!= ''">AND warning_name = #{dto.warningName} </if>
<if test="dto.disposotionState!= null and dto.disposotionState!= ''">AND disposotion_state = #{dto.disposotionState} </if>
<if test="dto.endDate!= null and dto.endDate!= '' "> and ts &lt;= #{dto.endDate} </if>
<if test="dto.startDate!= null and dto.startDate!= ''"> and ts &gt;= #{dto.startDate} </if>
</where>
</select>
</mapper> </mapper>
...@@ -193,4 +193,38 @@ ...@@ -193,4 +193,38 @@
`b`.`STATION`, `b`.`STATION`,
`b`.`EQUIPMENT_NAME` `b`.`EQUIPMENT_NAME`
</select> </select>
<select id="getInfoByPage" resultType="com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord">
SELECT * FROM fan_warning_record
<where>
<if test="dto.area!= null and dto.area!= ''"> AND arae = #{dto.area} </if>
<if test="dto.station!= null and dto.station!= ''">AND station = #{dto.station} </if>
<if test="dto.equipmentName!= null and dto.equipmentName!= ''">AND equipment_name = #{dto.equipmentName}</if>
<if test="dto.subarray!= null and dto.subarray!= ''">AND subarray = #{dto.subarray} </if>
<if test="dto.pointName!= null and dto.pointName!= ''">AND point_name = #{dto.pointName} </if>
<if test="dto.warningName!= null and dto.warningName!= ''">AND warning_name = #{dto.warningName} </if>
<if test="dto.disposotionState!= null and dto.disposotionState!= ''">AND disposotion_state = #{dto.disposotionState} </if>
<if test="dto.endDate!= null and dto.endDate!= '' "> and ts &lt;= #{dto.endDate} </if>
<if test="dto.startDate!= null and dto.startDate!= ''"> and ts &gt;= #{dto.startDate} </if>
</where>
<if test="dto.orderColumns != null and dto.orderColumns != ''">
order by ${dto.orderColumns}
</if>
limit #{dto.current}, #{dto.size}
</select>
<select id="getInfoByPageTotal" resultType="java.lang.Integer">
SELECT count(1) FROM fan_warning_record
<where>
<if test="dto.area!= null and dto.area!= ''"> AND arae = #{dto.area} </if>
<if test="dto.station!= null and dto.station!= ''">AND station = #{dto.station} </if>
<if test="dto.equipmentName!= null and dto.equipmentName!= ''">AND equipment_name = #{dto.equipmentName}</if>
<if test="dto.subarray!= null and dto.subarray!= ''">AND subarray = #{dto.subarray} </if>
<if test="dto.pointName!= null and dto.pointName!= ''">AND point_name = #{dto.pointName} </if>
<if test="dto.warningName!= null and dto.warningName!= ''">AND warning_name = #{dto.warningName} </if>
<if test="dto.disposotionState!= null and dto.disposotionState!= ''">AND disposotion_state = #{dto.disposotionState} </if>
<if test="dto.endDate!= null and dto.endDate!= '' "> and ts &lt;= #{dto.endDate} </if>
<if test="dto.startDate!= null and dto.startDate!= ''"> and ts &gt;= #{dto.startDate} </if>
</where>
</select>
</mapper> </mapper>
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