Commit 008ae1c3 authored by hezhuozhi's avatar hezhuozhi

修复风电和光伏设备数量重复问题

parent d6fd2670
......@@ -51,21 +51,21 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
@Select("<script>"+
"SELECT station, health_level as healthlevel,( CASE HEALTH_LEVEL WHEN '危险' THEN 4 WHEN '警告' THEN 3 WHEN '注意' THEN 2 ELSE 1 END ) AS sort, count( 1 ) AS `value` FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= TODAY()-9h" +
"SELECT station, health_level as healthlevel,( CASE HEALTH_LEVEL WHEN '危险' THEN 4 WHEN '警告' THEN 3 WHEN '注意' THEN 2 ELSE 1 END ) AS sort, count( 1 ) AS `value` FROM (select distinct station,health_level,equipment_name from analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= TODAY()-9h" +
"<if test='area!= null'> AND area = #{area} </if> " +
"<if test='station!= null'>AND station = #{station} </if>" +
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>" +
" GROUP BY station,health_level order by sort"+
" )GROUP BY station,health_level order by sort"+
"</script>")
List<Map<String,Object>> selectEquipStatusByStation(@Param("area")String area,@Param("analysisObjType")String analysisObjType,@Param("station")String station, @Param("gatewayIds") List<String> gatewayIds);
List<Map<String, Object>> getHealthInfoByArea();
@Select("<script>"+
"SELECT station, health_level as healthlevel,( CASE HEALTH_LEVEL WHEN '危险' THEN 4 WHEN '警告' THEN 3 WHEN '注意' THEN 2 ELSE 1 END ) AS sort, count( 1 ) AS `value` FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= TODAY()-8h" +
"SELECT station, health_level as healthlevel,( CASE HEALTH_LEVEL WHEN '危险' THEN 4 WHEN '警告' THEN 3 WHEN '注意' THEN 2 ELSE 1 END ) AS sort, count( 1 ) AS `value` FROM (select distinct station,health_level,equipment_name from analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= TODAY()-8h" +
"<if test='station!= null'>AND station = #{station} </if>" +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
" GROUP BY station,health_level,equipment_name order by sort"+
" )GROUP BY station,health_level,equipment_name order by sort"+
"</script>")
List<Map<String,Object>> selectEquipStatusByEquipment(@Param("analysisObjType")String analysisObjType,@Param("station")String station,@Param("equipmentName")String equipmentName);
......
......@@ -59,22 +59,22 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
int selectDataTotal(@Param("station")String station,@Param("analysisType")String analysisType,@Param("indexAddress")String indexAddress,@Param("healthLevel")String healthLevel,@Param("area")String area,@Param("analysisObjType")String analysisObjType, @Param("subarray")String subarray, @Param("pointName")String pointName,@Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop, @Param("equipmentName")String equipmentName,@Param("orgCode") String orgCode);
@Select("<script>"+
"SELECT station, health_level as healthlevel,( CASE HEALTH_LEVEL WHEN '危险' THEN 4 WHEN '警告' THEN 3 WHEN '注意' THEN 2 ELSE 1 END ) AS sort, count( 1 ) AS `value` FROM analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= TODAY()-9h" +
"SELECT station, health_level as healthlevel,( CASE HEALTH_LEVEL WHEN '危险' THEN 4 WHEN '警告' THEN 3 WHEN '注意' THEN 2 ELSE 1 END ) AS sort, count( 1 ) AS `value` FROM (select distinct station,health_level,equipment_name from analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= TODAY()-9h" +
"<if test='area!= null'> AND area = #{area} </if> " +
"<if test='station!= null'>AND station = #{station} </if>" +
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>" +
" GROUP BY station,health_level order by sort"+
" ) GROUP BY station,health_level order by sort"+
"</script>")
List<Map<String,Object>> selectEquipStatusByStationPv(@Param("area")String area, @Param("analysisObjType")String analysisObjType, @Param("station")String station, @Param("gatewayIds") List<String> gatewayIds);
@Select("<script>"+
"SELECT station, health_level as healthlevel,( CASE health_level WHEN '危险' THEN 4 WHEN '警告' THEN 3 WHEN '注意' THEN 2 ELSE 1 END ) AS sort, count( 1 ) AS `value` FROM analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= TODAY()-8h" +
"SELECT station, health_level as healthlevel,( CASE health_level WHEN '危险' THEN 4 WHEN '警告' THEN 3 WHEN '注意' THEN 2 ELSE 1 END ) AS sort, count( 1 ) AS `value` FROM (select distinct station,health_level,equipment_name from analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null AND ts >= TODAY()-8h" +
"<if test='station!= null'>AND station = #{station} </if>" +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"<if test='subarray!= null'>AND subarray = #{subarray} </if>" +
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>" +
" GROUP BY station,health_level,equipment_name order by sort"+
" ) GROUP BY station,health_level,equipment_name order by sort"+
"</script>")
List<Map<String,Object>> selectEquipStatusByEquipment(@Param("analysisObjType")String analysisObjType,@Param("station")String station,@Param("equipmentName")String equipmentName, @Param("subarray") String subarray, @Param("gatewayIds") List<String> gatewayIds);
......
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