Commit d6d5554b authored by chenzhao's avatar chenzhao

修改代码

parent a4a79c73
...@@ -277,6 +277,8 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -277,6 +277,8 @@ public class TDBigScreenAnalyseController extends BaseController {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
stationId = stationBasic.getFanGatewayId(); stationId = stationBasic.getFanGatewayId();
} }
if (arae != null ) {
arae = "%"+arae +"%"; }
Integer count = fanWaringRecordMapper.getEquipWarningInfoByPageCount(arae, station, stationType, warningName, stationId, startDate, endDate); Integer count = fanWaringRecordMapper.getEquipWarningInfoByPageCount(arae, station, stationType, warningName, stationId, startDate, endDate);
// List<IdxBizFanWarningRecord> idxBizFanWarningRecordIPage = idxBizFanWarningRecordMapper.getEquipWarningInfoByPage(arae, station, stationType, (current - 1) * size, size, warningName, stationId, startDate, endDate); // List<IdxBizFanWarningRecord> idxBizFanWarningRecordIPage = idxBizFanWarningRecordMapper.getEquipWarningInfoByPage(arae, station, 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); List<FanWarningRecord> idxBizFanWarningRecordIPage = fanWaringRecordMapper.getEquipWarningInfoByPage(arae, station, stationType, (current - 1) * size, size, warningName, stationId, startDate, endDate);
...@@ -291,19 +293,23 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -291,19 +293,23 @@ public class TDBigScreenAnalyseController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "各场站设备预警情况(条) ", notes = "各场站设备预警情况(条) ") @ApiOperation(httpMethod = "GET", value = "各场站设备预警情况(条) ", notes = "各场站设备预警情况(条) ")
@GetMapping(value = "/getAllEquipAlarmInfoByStation") @GetMapping(value = "/getAllEquipAlarmInfoByStation")
public ResponseModel<Map<String, Object>> getAllEquipAlarmInfoByStation() { public ResponseModel<Map<String, Object>> getAllEquipAlarmInfoByStation(String area) {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> allEquipAlarmInfo = idxBizFanHealthIndexMapper.getAllEquipAlarmInfoByStation(); // List<Map<String, Object>> allEquipAlarmInfo = idxBizFanHealthIndexMapper.getAllEquipAlarmInfoByStation();
if (StrUtil.isNotEmpty(area) ){
area = "%"+area +"%";
}
List<Map<String, Object>> allEquipAlarmInfo = fanWaringRecordMapper.getAllEquipAlarmInfoByStation(area);
HashMap<String, Integer> wxMap = new HashMap<>(); HashMap<String, Integer> wxMap = new HashMap<>();
HashMap<String, Integer> zyMap = new HashMap<>(); HashMap<String, Integer> zyMap = new HashMap<>();
HashMap<String, Integer> jgMap = new HashMap<>(); HashMap<String, Integer> jgMap = new HashMap<>();
LinkedHashSet<String> list = new LinkedHashSet<>(); LinkedHashSet<String> list = new LinkedHashSet<>();
allEquipAlarmInfo.forEach(item -> { allEquipAlarmInfo.forEach(item -> {
if ("危险".equals(item.get("warningName"))) { if ("危险".equals(item.get("warningname"))) {
wxMap.put(item.get("station").toString(), Integer.parseInt(item.get("num").toString())); wxMap.put(item.get("station").toString(), Integer.parseInt(item.get("num").toString()));
} else if ("注意".equals(item.get("warningName"))) { } else if ("注意".equals(item.get("warningname"))) {
zyMap.put(item.get("station").toString(), Integer.parseInt(item.get("num").toString())); zyMap.put(item.get("station").toString(), Integer.parseInt(item.get("num").toString()));
} else if ("警告".equals(item.get("warningName"))) { } else if ("警告".equals(item.get("warningname"))) {
jgMap.put(item.get("station").toString(), Integer.parseInt(item.get("num").toString())); jgMap.put(item.get("station").toString(), Integer.parseInt(item.get("num").toString()));
} }
list.add(item.get("station").toString()); list.add(item.get("station").toString());
...@@ -415,6 +421,11 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -415,6 +421,11 @@ public class TDBigScreenAnalyseController extends BaseController {
stationType = "光伏"; stationType = "光伏";
} }
} }
if (areaCode != null){
areaCode = "%"+areaCode+"%";
}
allEquipAlarmInfo = fanWaringRecordMapper.getAllEquipAlarmInfoAnalysisByArea(areaCode,stationType); allEquipAlarmInfo = fanWaringRecordMapper.getAllEquipAlarmInfoAnalysisByArea(areaCode,stationType);
List<Integer> wxList = new ArrayList<>(); List<Integer> wxList = new ArrayList<>();
List<Integer> zyList = new ArrayList<>(); List<Integer> zyList = new ArrayList<>();
......
...@@ -46,4 +46,5 @@ public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> { ...@@ -46,4 +46,5 @@ public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> {
List<Map<String, Object>> getAllEquipAlarmInfoAnalysisByArea(String araeCode, String stationType); List<Map<String, Object>> getAllEquipAlarmInfoAnalysisByArea(String araeCode, String stationType);
List<Map<String, Object>> getAllEquipAlarmInfoByStation(String area);
} }
...@@ -294,7 +294,7 @@ ...@@ -294,7 +294,7 @@
<where> <where>
( (a.disposotionstate = '未处置') or (a.disposotionstate = '已处置' and a.ts >( now()- 3d - 8h ))) ( (a.disposotionstate = '未处置') or (a.disposotionstate = '已处置' and a.ts >( now()- 3d - 8h )))
<if test="arae != '' and arae != null"> <if test="arae != '' and arae != null">
and a.arae = concat(#{area}, '区域') and a.arae like #{arae}
</if> </if>
<if test="station != '' and station != null"> <if test="station != '' and station != null">
and a.station = #{station} and a.station = #{station}
...@@ -359,7 +359,7 @@ ...@@ -359,7 +359,7 @@
( a.disposotionState = '未处置' ( a.disposotionState = '未处置'
or (a.disposotionState = '已处置' and a.ts > ( now() - 3D - 8h ))) or (a.disposotionState = '已处置' and a.ts > ( now() - 3D - 8h )))
<if test="arae != '' and arae != null"> <if test="arae != '' and arae != null">
and a.arae = concat(#{area}, '区域') and a.arae like #{arae}
</if> </if>
<if test="station != '' and station != null"> <if test="station != '' and station != null">
and a.station = #{station} and a.station = #{station}
...@@ -492,9 +492,40 @@ ...@@ -492,9 +492,40 @@
and b.stationType = #{stationType} and b.stationType = #{stationType}
</if> </if>
<if test="araeCode != '' and araeCode != null"> <if test="araeCode != '' and araeCode != null">
and b.arae = #{araeCode} and b.arae like #{araeCode}
</if> </if>
</where> </where>
order by b.`sort` ASC order by b.`sort` ASC
</select> </select>
<select id="getAllEquipAlarmInfoByStation" resultType="map">
select * from
( select arae as area,
warning_name as warningname,
count(1) as num,
station
from analysis_data.fan_warning_record a
where (a.disposotion_state = '未处置')
or (a.disposotion_state = '已处置' and a.ts >(now()-3d -8h ))
group by arae,
warning_name,station
union all
select arae as area,
warning_name as warningname,
count(1) as num,
station
from analysis_data.pv_warning_record a
where (a.disposotion_state = '未处置')
or (a.disposotion_state = '已处置' and a.ts >(now()-3d -8h ))
group by arae,
warning_name,station ) b
<where>
<if test="area != null and area != ''">
area like #{area}
</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