Commit fb2aafe4 authored by zhangsen's avatar zhangsen

分析需求API

parent ec3b3c7b
...@@ -172,9 +172,16 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -172,9 +172,16 @@ public class BigScreenAnalyseController extends BaseController {
@RequestParam(value = "stationType", required = false) String stationType, @RequestParam(value = "stationType", required = false) String stationType,
@RequestParam(value = "current", required = false) Integer current, @RequestParam(value = "current", required = false) Integer current,
@RequestParam(value = "size", required = false) Integer size, @RequestParam(value = "size", required = false) Integer size,
@RequestParam(value = "warningName", required = false) String warningName) { @RequestParam(value = "warningName", required = false) String warningName,
Integer count = idxBizFanWarningRecordMapper.getEquipWarningInfoByPageCount(arae, station, stationType, warningName); @RequestParam(value = "stationId", required = false) String stationId) {
List<IdxBizFanWarningRecord> idxBizFanWarningRecordIPage = idxBizFanWarningRecordMapper.getEquipWarningInfoByPage(arae, station, stationType, (current - 1) * size, size, warningName);
if (StrUtil.isNotEmpty(stationId)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
stationId = stationBasic.getFanGatewayId();
}
Integer count = idxBizFanWarningRecordMapper.getEquipWarningInfoByPageCount(arae, station, stationType, warningName, stationId);
List<IdxBizFanWarningRecord> idxBizFanWarningRecordIPage = idxBizFanWarningRecordMapper.getEquipWarningInfoByPage(arae, station, stationType, (current - 1) * size, size, warningName, stationId);
Page<IdxBizFanWarningRecord> idxBizFanWarningRecordPage = new Page<>(current, size); Page<IdxBizFanWarningRecord> idxBizFanWarningRecordPage = new Page<>(current, size);
idxBizFanWarningRecordPage.setRecords(idxBizFanWarningRecordIPage); idxBizFanWarningRecordPage.setRecords(idxBizFanWarningRecordIPage);
idxBizFanWarningRecordPage.setTotal(count); idxBizFanWarningRecordPage.setTotal(count);
...@@ -240,10 +247,10 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -240,10 +247,10 @@ public class BigScreenAnalyseController extends BaseController {
List<StationBasic> stationBasics = stationBasicMapper.selectList(new LambdaQueryWrapper<StationBasic>().eq(StationBasic::getAreaName, areaCode)); List<StationBasic> stationBasics = stationBasicMapper.selectList(new LambdaQueryWrapper<StationBasic>().like(StationBasic::getAreaName, areaCode));
List<String> list = stationBasics.stream().map(StationBasic::getStationName).collect(Collectors.toList()); List<String> list = stationBasics.stream().map(StationBasic::getStationName).collect(Collectors.toList());
List<Object> seriesData = new ArrayList<>(); List<Object> seriesData = new ArrayList<>();
list.forEach(item -> seriesData.add(collect.getOrDefault(item, new BigDecimal("0")))); list.forEach(item -> seriesData.add(collect.getOrDefault(item, new BigDecimal("100"))));
resultMap.put("axisData", list); resultMap.put("axisData", list);
resultMap.put("seriesData", seriesData); resultMap.put("seriesData", seriesData);
return ResponseHelper.buildResponse(resultMap); return ResponseHelper.buildResponse(resultMap);
...@@ -257,7 +264,7 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -257,7 +264,7 @@ public class BigScreenAnalyseController extends BaseController {
public ResponseModel<Map<String, Object>> assessIndexRadarMap(@RequestParam(required = false, value = "stationCode") String stationCode) { public ResponseModel<Map<String, Object>> assessIndexRadarMap(@RequestParam(required = false, value = "stationCode") String stationCode) {
if (StrUtil.isNotEmpty(stationCode)) { if (StrUtil.isNotEmpty(stationCode)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode); StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getStationName(); stationCode = stationBasic.getBoosterGatewayId();
} }
List<Map<String, Object>> list = idxBizFanHealthIndexMapper.equipWarningRadarMap(stationCode); List<Map<String, Object>> list = idxBizFanHealthIndexMapper.equipWarningRadarMap(stationCode);
HashMap<String, Object> resultMap = new HashMap<>(); HashMap<String, Object> resultMap = new HashMap<>();
......
...@@ -19,10 +19,12 @@ public interface IdxBizFanWarningRecordMapper extends BaseMapper<IdxBizFanWarnin ...@@ -19,10 +19,12 @@ public interface IdxBizFanWarningRecordMapper extends BaseMapper<IdxBizFanWarnin
@Param("stationType") String stationType, @Param("stationType") String stationType,
@Param("current") Integer current, @Param("current") Integer current,
@Param("size") Integer size, @Param("size") Integer size,
@Param("warningName") String warningName); @Param("warningName") String warningName,
@Param("stationId") String stationId);
Integer getEquipWarningInfoByPageCount(@Param("arae") String arae, Integer getEquipWarningInfoByPageCount(@Param("arae") String arae,
@Param("station") String station, @Param("station") String station,
@Param("stationType") String stationType, @Param("stationType") String stationType,
@Param("warningName") String warningName); @Param("warningName") String warningName,
@Param("stationId") String stationId);
} }
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
idx_biz_fan_warning_record idx_biz_fan_warning_record
<where> <where>
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
station = #{stationCode} GATEWAY_ID = #{stationCode}
</if> </if>
</where> </where>
UNION ALL UNION ALL
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
idx_biz_pv_warning_record idx_biz_pv_warning_record
<where> <where>
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
station = #{stationCode} GATEWAY_ID = #{stationCode}
</if> </if>
</where> </where>
) a ) a
......
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
WARNING_NAME AS warningName, WARNING_NAME AS warningName,
DISPOSOTION_STATE AS disposotionState, DISPOSOTION_STATE AS disposotionState,
ARAE AS arae, ARAE AS arae,
'pv' AS stationType 'pv' AS stationType,
GATEWAY_ID
FROM FROM
idx_biz_pv_warning_record UNION ALL idx_biz_pv_warning_record UNION ALL
SELECT SELECT
...@@ -27,13 +28,14 @@ ...@@ -27,13 +28,14 @@
WARNING_NAME AS warningName, WARNING_NAME AS warningName,
DISPOSOTION_STATE AS disposotionState, DISPOSOTION_STATE AS disposotionState,
ARAE AS arae, ARAE AS arae,
'fan' AS stationType 'fan' AS stationType,
GATEWAY_ID
FROM FROM
idx_biz_fan_warning_record idx_biz_fan_warning_record
) a ) a
<where> <where>
<if test="arae != '' and arae != null"> <if test="arae != '' and arae != null">
AND a.arae = #{arae} AND a.arae like concat('%', #{arae}, '%')
</if> </if>
<if test="station != '' and station != null"> <if test="station != '' and station != null">
AND a.station = #{station} AND a.station = #{station}
...@@ -42,7 +44,10 @@ ...@@ -42,7 +44,10 @@
AND a.stationType = #{stationType} AND a.stationType = #{stationType}
</if> </if>
<if test="warningName != '' and warningName != null"> <if test="warningName != '' and warningName != null">
AND a.WARNING_NAME = #{warningName} AND a.warningName = #{warningName}
</if>
<if test="stationId != '' and stationId != null">
AND a.GATEWAY_ID = #{stationId}
</if> </if>
</where> </where>
limit #{current}, #{size} limit #{current}, #{size}
...@@ -61,7 +66,8 @@ ...@@ -61,7 +66,8 @@
WARNING_NAME AS warningName, WARNING_NAME AS warningName,
DISPOSOTION_STATE AS disposotionState, DISPOSOTION_STATE AS disposotionState,
ARAE AS arae, ARAE AS arae,
'pv' AS stationType 'pv' AS stationType,
GATEWAY_ID
FROM FROM
idx_biz_pv_warning_record UNION ALL idx_biz_pv_warning_record UNION ALL
SELECT SELECT
...@@ -72,13 +78,14 @@ ...@@ -72,13 +78,14 @@
WARNING_NAME AS warningName, WARNING_NAME AS warningName,
DISPOSOTION_STATE AS disposotionState, DISPOSOTION_STATE AS disposotionState,
ARAE AS arae, ARAE AS arae,
'fan' AS stationType 'fan' AS stationType,
GATEWAY_ID
FROM FROM
idx_biz_fan_warning_record idx_biz_fan_warning_record
) a ) a
<where> <where>
<if test="arae != '' and arae != null"> <if test="arae != '' and arae != null">
AND a.arae like concat('%', #{areaCode}, '%') AND a.arae like concat('%', #{arae}, '%')
</if> </if>
<if test="station != '' and station != null"> <if test="station != '' and station != null">
AND a.station = #{station} AND a.station = #{station}
...@@ -87,7 +94,10 @@ ...@@ -87,7 +94,10 @@
AND a.stationType = #{stationType} AND a.stationType = #{stationType}
</if> </if>
<if test="warningName != '' and warningName != null"> <if test="warningName != '' and warningName != null">
AND a.WARNING_NAME = #{warningName} AND a.warningName = #{warningName}
</if>
<if test="stationId != '' and stationId != null">
AND a.GATEWAY_ID = #{stationId}
</if> </if>
</where> </where>
</select> </select>
......
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