Commit 46b39d15 authored by hezhuozhi's avatar hezhuozhi

大屏升压站数据

parent b77e7fbd
......@@ -145,8 +145,8 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getFanGatewayId();
if ("FDZ".equals(stationBasic.getStationType())) {
wrapper.eq(FanHealthIndex::getAnalysisObjType, "场站");
wrapper.eq(FanHealthIndex::getGatewayId, stationCode);
wrapper.eq(FanHealthIndex::getAnalysisObjType, "场站").and(
qw->qw.eq(FanHealthIndex::getGatewayId, stationBasic.getFanGatewayId()).or().eq(FanHealthIndex::getGatewayId, stationBasic.getBoosterGatewayId()));
FanHealthIndex fanHealthIndex = fanHealthIndexMapper.selectOne(wrapper);
// 预防空指针
if (Objects.isNull(fanHealthIndex)) {
......@@ -157,8 +157,8 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
}
} else {
LambdaQueryWrapper<PvHealthIndex> pvwrapper = new LambdaQueryWrapper<PvHealthIndex>();
pvwrapper.eq(PvHealthIndex::getAnalysisObjType, "场站");
pvwrapper.eq(PvHealthIndex::getGatewayId, stationCode);
pvwrapper.eq(PvHealthIndex::getAnalysisObjType, "场站").and(
qw->qw.eq(PvHealthIndex::getGatewayId, stationBasic.getFanGatewayId()).or().eq(PvHealthIndex::getGatewayId, stationBasic.getBoosterGatewayId()));
pvwrapper.orderByDesc(PvHealthIndex::getTs);
pvwrapper.last("limit 1");
PvHealthIndex pvHealthIndex = pvHealthIndexMapper.selectOne(pvwrapper);
......@@ -283,11 +283,13 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
@RequestParam(required = false) Date startTime, @RequestParam(required = false) Date endTime) {
String finalStationCode = null;
String zyzfinalStationCode = null;
String finalAreaCode = null;
String stationType = null;
if (StrUtil.isNotEmpty(stationCode)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
finalStationCode = stationBasic.getFanGatewayId();
zyzfinalStationCode=stationBasic.getBoosterGatewayId();
stationType = stationBasic.getStationType();
} else if (StrUtil.isNotEmpty(station)) {
// 由于命名不统一
......@@ -296,6 +298,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
.eq(StationBasic::getStationName, station.substring(0, station.length() - 1) + '站'));
finalStationCode = stationBasic.getFanGatewayId();
stationType = stationBasic.getStationType();
zyzfinalStationCode=stationBasic.getBoosterGatewayId();
}
if (StrUtil.isNotEmpty(areaCode)) {
finalAreaCode = "%" + areaCode + "%";
......@@ -316,8 +319,10 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
if (CharSequenceUtil.isNotEmpty(finalStationCode)) {
if ("FDZ".equals(stationType)) {
wrapper.eq(FanHealthIndex::getAnalysisObjType, "场站");
wrapper.eq(FanHealthIndex::getGatewayId, finalStationCode);
final String fanGatewayId=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);
valueList = fanHealthIndexList.stream()
.map(t -> String
......@@ -326,9 +331,11 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
dateList = fanHealthIndexList.stream().map(t -> t.getRecDate()).collect(Collectors.toList());
} else {
final String fanGatewayId=finalStationCode;
final String syzGatewayId=zyzfinalStationCode;
LambdaQueryWrapper<PvHealthIndex> pvwrapper = new LambdaQueryWrapper<PvHealthIndex>();
pvwrapper.eq(PvHealthIndex::getAnalysisObjType, "场站");
pvwrapper.eq(PvHealthIndex::getGatewayId, finalStationCode);
pvwrapper.eq(PvHealthIndex::getAnalysisObjType, "场站").and(
qw->qw.eq(PvHealthIndex::getGatewayId, fanGatewayId).or().eq(PvHealthIndex::getGatewayId, syzGatewayId));
pvwrapper.orderByDesc(PvHealthIndex::getTs);
pvwrapper.last("limit 15");
List<PvHealthIndex> pvHealthIndexList = pvHealthIndexMapper.selectList(pvwrapper);
......@@ -584,16 +591,17 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
@RequestParam(value = "stationId", required = false) String stationId,
@RequestParam(value = "startDate", required = false) String startDate,
@RequestParam(value = "endDate", required = false) String endDate) {
String syzGatewayId="";
if (StrUtil.isNotEmpty(stationId)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
stationId = stationBasic.getFanGatewayId();
syzGatewayId=stationBasic.getBoosterGatewayId();
}
if (arae != null) {
arae = "%" + arae + "%";
}
Integer count = fanWaringRecordMapper.getEquipWarningInfoByPageCount(arae, station, stationType, warningName,
stationId, startDate, endDate);
stationId, startDate, endDate,syzGatewayId);
// 前端存在分页bug 此处限制分页后筛选导致页面超出问题
if (count > 0 && current > (count / 10 + 1)) {
current = 1;
......@@ -603,7 +611,7 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
// stationType, (current - 1) * size, size, warningName, stationId, startDate,
// endDate);
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);
idxBizFanWarningRecordPage.setRecords(idxBizFanWarningRecordIPage);
......@@ -1639,8 +1647,8 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
LambdaQueryWrapper<FanHealthIndex> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(FanHealthIndex::getIndexAddress, indexAddress);
lambdaQueryWrapper.eq(FanHealthIndex::getGatewayId, stationBasic.getFanGatewayId());
lambdaQueryWrapper.eq(FanHealthIndex::getIndexAddress, indexAddress).and(
qw->qw.eq(FanHealthIndex::getGatewayId, stationBasic.getFanGatewayId()).or().eq(FanHealthIndex::getGatewayId, stationBasic.getBoosterGatewayId()));
lambdaQueryWrapper.eq(FanHealthIndex::getAnalysisObjType, "测点");
lambdaQueryWrapper.orderByDesc(FanHealthIndex::getTs);
......@@ -1677,8 +1685,8 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
LambdaQueryWrapper<PvHealthIndex> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(PvHealthIndex::getIndexAddress, indexAddress);
lambdaQueryWrapper.eq(PvHealthIndex::getGatewayId, stationBasic.getFanGatewayId());
lambdaQueryWrapper.eq(PvHealthIndex::getIndexAddress, indexAddress).and(
qw->qw.eq(PvHealthIndex::getGatewayId, stationBasic.getFanGatewayId()).or().eq(PvHealthIndex::getGatewayId, stationBasic.getBoosterGatewayId()));
lambdaQueryWrapper.eq(PvHealthIndex::getAnalysisObjType, "测点");
lambdaQueryWrapper.orderByDesc(PvHealthIndex::getTs);
lambdaQueryWrapper.eq(PvHealthIndex::getAnalysisType, "按10分钟");
......
......@@ -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);
......
......@@ -509,7 +509,7 @@ 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} or GATEWAY_ID = #{syzGatewayId})
</if>
......
......@@ -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