Commit 942dfb9a authored by chenzhao's avatar chenzhao

修改代码

parent b2eadd7c
...@@ -168,11 +168,11 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -168,11 +168,11 @@ public class TDBigScreenAnalyseController extends BaseController {
HashMap<String, Integer> zyMap = new HashMap<>(); HashMap<String, Integer> zyMap = new HashMap<>();
HashMap<String, Integer> jgMap = new HashMap<>(); HashMap<String, Integer> jgMap = new HashMap<>();
allEquipAlarmInfo.forEach(item -> { allEquipAlarmInfo.forEach(item -> {
if ("危险".equals(item.get("warningName"))) { if ("危险".equals(item.get("warningname"))) {
wxMap.put(item.get("area").toString(), Integer.parseInt(item.get("num").toString())); wxMap.put(item.get("area").toString(), Integer.parseInt(item.get("num").toString()));
} else if ("注意".equals(item.get("warningName"))) { } else if ("注意".equals(item.get("warningname"))) {
zyMap.put(item.get("area").toString(), Integer.parseInt(item.get("num").toString())); zyMap.put(item.get("area").toString(), Integer.parseInt(item.get("num").toString()));
} else if ("警告".equals(item.get("warningName"))) { } else if ("警告".equals(item.get("warningname"))) {
jgMap.put(item.get("area").toString(), Integer.parseInt(item.get("num").toString())); jgMap.put(item.get("area").toString(), Integer.parseInt(item.get("num").toString()));
} }
}); });
...@@ -405,7 +405,7 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -405,7 +405,7 @@ public class TDBigScreenAnalyseController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "片区设备预警统计分析 - 右下角柱状图 ", notes = "片区设备预警统计分析 - 右下角柱状图 ") @ApiOperation(httpMethod = "GET", value = "片区设备预警统计分析 - 右下角柱状图 ", notes = "片区设备预警统计分析 - 右下角柱状图 ")
@GetMapping(value = "/getAllEquipAlarmInfoAnalysis") @GetMapping(value = "/getAllEquipAlarmInfoAnalysis")
public ResponseModel<Map<String, Object>> getAllEquipAlarmInfoAnalysis(@RequestParam(required = false) String stationType, public ResponseModel<Map<String, Object>> getAllEquipAlarmInfoAnalysis(@RequestParam(required = false) String stationType,
@RequestParam(required = false) String araeCode) { @RequestParam(required = false) String areaCode) {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> allEquipAlarmInfo = new ArrayList<>(); List<Map<String, Object>> allEquipAlarmInfo = new ArrayList<>();
if (CharSequenceUtil.isNotEmpty(stationType)) { if (CharSequenceUtil.isNotEmpty(stationType)) {
...@@ -415,7 +415,7 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -415,7 +415,7 @@ public class TDBigScreenAnalyseController extends BaseController {
stationType = "光伏"; stationType = "光伏";
} }
} }
allEquipAlarmInfo = fanWaringRecordMapper.getAllEquipAlarmInfoAnalysisByArea(araeCode,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<>();
List<Integer> jgList = new ArrayList<>(); List<Integer> jgList = new ArrayList<>();
......
...@@ -253,6 +253,7 @@ ...@@ -253,6 +253,7 @@
from from
( (
select select
ts,
rec_date as recDate, rec_date as recDate,
station as station, station as station,
equipment_name as equipmentName, equipment_name as equipmentName,
...@@ -271,6 +272,7 @@ ...@@ -271,6 +272,7 @@
from from
analysis_data.pv_warning_record union all analysis_data.pv_warning_record union all
select select
ts,
rec_date as recDate, rec_date as recDate,
station as station, station as station,
equipment_name as equipmentName, equipment_name as equipmentName,
...@@ -290,7 +292,7 @@ ...@@ -290,7 +292,7 @@
analysis_data.fan_warning_record analysis_data.fan_warning_record
) a ) a
<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 = concat(#{area}, '区域')
</if> </if>
...@@ -326,6 +328,7 @@ ...@@ -326,6 +328,7 @@
( (
select select
rec_date as recDate, rec_date as recDate,
ts,
station as station, station as station,
equipment_name as equipmentName, equipment_name as equipmentName,
content as content, content as content,
...@@ -339,6 +342,7 @@ ...@@ -339,6 +342,7 @@
analysis_data.pv_warning_record union all analysis_data.pv_warning_record union all
select select
rec_date as recFate, rec_date as recFate,
ts,
station as station, station as station,
equipment_name as equipmentName, equipment_name as equipmentName,
content as content, content as content,
...@@ -352,28 +356,31 @@ ...@@ -352,28 +356,31 @@
analysis_data.fan_warning_record analysis_data.fan_warning_record
) a ) a
<where> <where>
a.disposotionState = '未处置' or (a.disposotionState = '已处置' and a.ts > ( now() - 3D - 8h )) ( a.disposotionState = '未处置'
<if test="arae != '' and arae != null"> or (a.disposotionState = '已处置' and a.ts > ( now() - 3D - 8h )))
and a.arae = concat(#{area}, '区域') <if test="arae != '' and arae != null">
</if> and a.arae = concat(#{area}, '区域')
<if test="station != '' and station != null"> </if>
and a.station = #{station} <if test="station != '' and station != null">
</if> and a.station = #{station}
<if test="stationType != '' and stationType != null"> </if>
and a.stationType = #{stationType} <if test="stationType != '' and stationType != null">
</if> and a.stationType = #{stationType}
<if test="warningName != '' and warningName != null"> </if>
and a.warning_name = #{warningName} <if test="warningName != '' and warningName != null">
</if> and a.warning_name = #{warningName}
<if test="stationId != '' and stationId != null"> </if>
and a.gateway_id = #{stationId} <if test="stationId != '' and stationId != null">
</if> and a.gateway_id = #{stationId}
<if test="startDate != '' and startDate != null"> </if>
and a.recDate >= concat(#{startDate}, ' 00:00:00') <if test="startDate != '' and startDate != null">
</if> and a.recDate >= concat(#{startDate}, ' 00:00:00')
<if test="endDate != '' and endDate != null"> </if>
and concat(#{endDate}, ' 23:59:59') >= a.recdate <if test="endDate != '' and endDate != null">
</if> and concat(#{endDate}, ' 23:59:59') >= a.recdate
</if>
</where>) b </where>) b
</select> </select>
...@@ -488,6 +495,6 @@ ...@@ -488,6 +495,6 @@
and b.arae = #{araeCode} and b.arae = #{araeCode}
</if> </if>
</where> </where>
order by b.`sort` desc order by b.`sort` ASC
</select> </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