Commit 6c83d6c5 authored by zhangsen's avatar zhangsen

bug修改

parent 0850b797
...@@ -299,4 +299,31 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -299,4 +299,31 @@ public class IdxBizFanHealthIndexController extends BaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "查询光伏场站所有设备状态统计", notes = "查询光伏场站所有设备状态统计")
@GetMapping (value = "/getPvEquipStatusByStation")
public ResponseModel<List<Map<String,Object>>> getPvEquipStatusByStation(String STATION) {
Map<String, Object> map = idxBizFanHealthIndexServiceImpl.getPvEquipStatusByStation(STATION);
List<Map<String,Object>> maps = new ArrayList<>();
Map<String,Object> anquan = new HashMap<>();
anquan.put("name","安全");
anquan.put("value",map.get("安全"));
maps.add(anquan);
Map<String,Object> zhuyi = new HashMap<>();
zhuyi.put("name","注意");
zhuyi.put("value",map.get("注意"));
maps.add(zhuyi);
Map<String,Object> jinggao = new HashMap<>();
jinggao.put("name","警告");
jinggao.put("value",map.get("警告"));
maps.add(jinggao);
Map<String,Object> weixian = new HashMap<>();
weixian.put("name","危险");
weixian.put("value",map.get("危险"));
maps.add(weixian);
return ResponseHelper.buildResponse(maps);
}
} }
...@@ -121,4 +121,5 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn ...@@ -121,4 +121,5 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List<IdxBizFanWarningRecord> warningData(String STATION, String SUBARRAY, String EQUIPMENTNAME); List<IdxBizFanWarningRecord> warningData(String STATION, String SUBARRAY, String EQUIPMENTNAME);
Integer pointNum(String STATION, String SUBARRAY, String EQUIPMENTNAME); Integer pointNum(String STATION, String SUBARRAY, String EQUIPMENTNAME);
Map<String, Object> getPvEquipStatusByStation(String station);
} }
...@@ -190,6 +190,10 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth ...@@ -190,6 +190,10 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
return this.getBaseMapper().getFanEquipStatusByStation(STATION); return this.getBaseMapper().getFanEquipStatusByStation(STATION);
} }
public Map<String,Object> getPvEquipStatusByStation(String STATION){
return this.getBaseMapper().getPvEquipStatusByStation(STATION);
}
public int queryForLeftTableListByPointCount(String STATION, String HEALTHLEVEL, String EQUIPMENTNAME,String POINTNAME){ public int queryForLeftTableListByPointCount(String STATION, String HEALTHLEVEL, String EQUIPMENTNAME,String POINTNAME){
return this.getBaseMapper().queryForLeftTableListByPointCount(STATION,HEALTHLEVEL,EQUIPMENTNAME,POINTNAME); return this.getBaseMapper().queryForLeftTableListByPointCount(STATION,HEALTHLEVEL,EQUIPMENTNAME,POINTNAME);
......
...@@ -1200,4 +1200,31 @@ ...@@ -1200,4 +1200,31 @@
) a ) a
</select> </select>
<select id="getPvEquipStatusByStation" resultType="java.util.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_pv_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
</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