Commit fb2aafe4 authored by zhangsen's avatar zhangsen

分析需求API

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