Commit 1e423742 authored by tangwei's avatar tangwei

解决冲突

parents 9c5305f3 04e10a09
...@@ -127,14 +127,18 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -127,14 +127,18 @@ public class TDBigScreenAnalyseController extends BaseController {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode); StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getFanGatewayId(); stationCode = stationBasic.getFanGatewayId();
} }
if (StrUtil.isNotEmpty(areaCode)) {
areaCode = "%" + areaCode + "%";
}
HashMap<String, Object> resultMap = new HashMap<>(); HashMap<String, Object> resultMap = new HashMap<>();
List<Map<String, String>> dateInfoBy15 = idxBizFanHealthIndexMapper.getDateInfoBy15(); List<Map<String, String>> dateInfoBy15 = idxBizFanHealthIndexMapper.getDateInfoBy15();
List<String> valueList = new ArrayList<>(); List<String> valueList = new ArrayList<>();
String finalStationCode = stationCode; String finalStationCode = stationCode;
List<String> dateList = new ArrayList<>(); List<String> dateList = new ArrayList<>();
String finalAreaCode = areaCode;
dateInfoBy15.forEach(item -> { dateInfoBy15.forEach(item -> {
String healthListInfo = fanHealthIndexMapper.getInfoByDate(areaCode, finalStationCode, item.get("date")); String healthListInfo = fanHealthIndexMapper.getInfoByDate(finalAreaCode, finalStationCode, item.get("date"));
valueList.add(CharSequenceUtil.isNotEmpty(healthListInfo) ? healthListInfo.replace(".0", "") : "100"); valueList.add(CharSequenceUtil.isNotEmpty(healthListInfo) ? healthListInfo.replace(".0", "") : "100");
String date = item.get("date"); String date = item.get("date");
Date date1 = DateUtils.dateAddDays(DateUtil.parse(date, DateUtils.DATE_PATTERN), -1); Date date1 = DateUtils.dateAddDays(DateUtil.parse(date, DateUtils.DATE_PATTERN), -1);
...@@ -277,6 +281,8 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -277,6 +281,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 +297,23 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -291,19 +297,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 +425,11 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -415,6 +425,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);
} }
...@@ -343,7 +343,7 @@ ...@@ -343,7 +343,7 @@
<where> <where>
rec_date = concat(#{date}, ' 00:00:00') rec_date = concat(#{date}, ' 00:00:00')
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
AND area = concat(#{areaCode}, '区域') AND area like #{areaCode}
AND analysis_obj_type = '片区' AND analysis_obj_type = '片区'
</if> </if>
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
...@@ -364,7 +364,7 @@ ...@@ -364,7 +364,7 @@
<where> <where>
rec_date = concat(#{date}, ' 00:00:00') rec_date = concat(#{date}, ' 00:00:00')
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
AND area = concat(#{areaCode}, '区域') AND area like #{areaCode}
AND analysis_obj_type = '片区' AND analysis_obj_type = '片区'
</if> </if>
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
......
...@@ -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