Commit c052b9b1 authored by chenzhao's avatar chenzhao

场站层统计图接口 预警监测风电

parent 4a429fc3
......@@ -272,4 +272,21 @@ public class IdxBizFanHealthIndexController extends BaseController {
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "查询场站下设备状态统计", notes = "查询场站下设备状态统计")
@GetMapping (value = "/getFanEquipStatusByStation")
public ResponseModel<List<Map<String,Object>>> getFanEquipStatusByStation(String STATION) {
Map<String, Object> map = idxBizFanHealthIndexServiceImpl.getFanEquipStatusByStation(STATION);
List<Map<String,Object>> maps = new ArrayList<>();
for (String s : map.keySet()) {
Map<String,Object> result = new HashMap<>();
result.put("name",s);
result.put("value",map.get(s));
maps.add(result);
}
return ResponseHelper.buildResponse(maps);
}
}
......@@ -112,6 +112,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List<Map<String,Object>> queryForLeftTableListByPoint(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME,String POINTNAME,Integer current,Integer size);
List<Map<String,Object>> selectPointByANALYSISTYPE(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME,String POINTNAME,String startTime,String endTime);
Map<String,Object> getFanEquipStatusByStation(String STATION);
int queryForLeftTableListByPointCount(String STATION, String HEALTHLEVEL,String EQUIPMENTNAME,String POINTNAME);
......
......@@ -186,6 +186,10 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
};
public Map<String,Object> getFanEquipStatusByStation(String STATION){
return this.getBaseMapper().getFanEquipStatusByStation(STATION);
}
public int queryForLeftTableListByPointCount(String STATION, String HEALTHLEVEL, String EQUIPMENTNAME,String POINTNAME){
return this.getBaseMapper().queryForLeftTableListByPointCount(STATION,HEALTHLEVEL,EQUIPMENTNAME,POINTNAME);
......
......@@ -1172,5 +1172,33 @@
</select>
<select id="getFanEquipStatusByStation" resultType="map">
SELECT
max( CASE WHEN a.HEALTH_LEVEL = '安全' THEN num ELSE 0 END ) AS 安全,
max( CASE WHEN a.HEALTH_LEVEL = '注意' THEN num ELSE 0 END ) AS 注意,
max( CASE WHEN a.HEALTH_LEVEL = '警告' THEN num ELSE 0 END ) AS 警告,
max( CASE WHEN a.HEALTH_LEVEL = '危险' THEN num ELSE 0 END ) AS 危险
FROM
(
SELECT
STATION,
HEALTH_LEVEL,
count( 1 ) AS num
FROM
idx_biz_fan_health_index
WHERE
ANALYSIS_TYPE = '按天'
AND ANALYSIS_OBJ_TYPE = '设备'
AND REC_DATE >= CURRENT_DATE ( )
<if test="STATION != null and STATION != ''">
AND STATION = #{STATION}
</if>
GROUP BY
STATION,
HEALTH_LEVEL
) a <where>
</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