Commit 1e423742 authored by tangwei's avatar tangwei

解决冲突

parents 9c5305f3 04e10a09
......@@ -127,14 +127,18 @@ public class TDBigScreenAnalyseController extends BaseController {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getFanGatewayId();
}
if (StrUtil.isNotEmpty(areaCode)) {
areaCode = "%" + areaCode + "%";
}
HashMap<String, Object> resultMap = new HashMap<>();
List<Map<String, String>> dateInfoBy15 = idxBizFanHealthIndexMapper.getDateInfoBy15();
List<String> valueList = new ArrayList<>();
String finalStationCode = stationCode;
List<String> dateList = new ArrayList<>();
String finalAreaCode = areaCode;
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");
String date = item.get("date");
Date date1 = DateUtils.dateAddDays(DateUtil.parse(date, DateUtils.DATE_PATTERN), -1);
......@@ -277,6 +281,8 @@ public class TDBigScreenAnalyseController extends BaseController {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
stationId = stationBasic.getFanGatewayId();
}
if (arae != null ) {
arae = "%"+arae +"%"; }
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<FanWarningRecord> idxBizFanWarningRecordIPage = fanWaringRecordMapper.getEquipWarningInfoByPage(arae, station, stationType, (current - 1) * size, size, warningName, stationId, startDate, endDate);
......@@ -291,19 +297,23 @@ public class TDBigScreenAnalyseController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "各场站设备预警情况(条) ", notes = "各场站设备预警情况(条) ")
@GetMapping(value = "/getAllEquipAlarmInfoByStation")
public ResponseModel<Map<String, Object>> getAllEquipAlarmInfoByStation() {
public ResponseModel<Map<String, Object>> getAllEquipAlarmInfoByStation(String area) {
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> zyMap = new HashMap<>();
HashMap<String, Integer> jgMap = new HashMap<>();
LinkedHashSet<String> list = new LinkedHashSet<>();
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()));
} else if ("注意".equals(item.get("warningName"))) {
} else if ("注意".equals(item.get("warningname"))) {
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()));
}
list.add(item.get("station").toString());
......@@ -415,6 +425,11 @@ public class TDBigScreenAnalyseController extends BaseController {
stationType = "光伏";
}
}
if (areaCode != null){
areaCode = "%"+areaCode+"%";
}
allEquipAlarmInfo = fanWaringRecordMapper.getAllEquipAlarmInfoAnalysisByArea(areaCode,stationType);
List<Integer> wxList = new ArrayList<>();
List<Integer> zyList = new ArrayList<>();
......
......@@ -46,4 +46,5 @@ public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> {
List<Map<String, Object>> getAllEquipAlarmInfoAnalysisByArea(String araeCode, String stationType);
List<Map<String, Object>> getAllEquipAlarmInfoByStation(String area);
}
......@@ -343,7 +343,7 @@
<where>
rec_date = concat(#{date}, ' 00:00:00')
<if test="areaCode != null and areaCode != ''">
AND area = concat(#{areaCode}, '区域')
AND area like #{areaCode}
AND analysis_obj_type = '片区'
</if>
<if test="stationCode != null and stationCode != ''">
......@@ -364,7 +364,7 @@
<where>
rec_date = concat(#{date}, ' 00:00:00')
<if test="areaCode != null and areaCode != ''">
AND area = concat(#{areaCode}, '区域')
AND area like #{areaCode}
AND analysis_obj_type = '片区'
</if>
<if test="stationCode != null and stationCode != ''">
......
......@@ -294,7 +294,7 @@
<where>
( (a.disposotionstate = '未处置') or (a.disposotionstate = '已处置' and a.ts >( now()- 3d - 8h )))
<if test="arae != '' and arae != null">
and a.arae = concat(#{area}, '区域')
and a.arae like #{arae}
</if>
<if test="station != '' and station != null">
and a.station = #{station}
......@@ -359,7 +359,7 @@
( a.disposotionState = '未处置'
or (a.disposotionState = '已处置' and a.ts > ( now() - 3D - 8h )))
<if test="arae != '' and arae != null">
and a.arae = concat(#{area}, '区域')
and a.arae like #{arae}
</if>
<if test="station != '' and station != null">
and a.station = #{station}
......@@ -492,9 +492,40 @@
and b.stationType = #{stationType}
</if>
<if test="araeCode != '' and araeCode != null">
and b.arae = #{araeCode}
and b.arae like #{araeCode}
</if>
</where>
order by b.`sort` ASC
</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>
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