"SELECT `health_index` AS healthIndex,anomaly, `health_index` AS `value`, substr(analysis_time,1,10) as analysisTime, station,equipment_name AS equipmentName,point_name as pointName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType}"+
"SELECT `health_index` AS healthIndex,anomaly, `health_index` AS `value`, substr(analysis_time,1,10) as analysisTime, station,equipment_name AS equipmentName,point_name as pointName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null"+
"<if test='endTimeTop!= null'> and ts <= #{endTimeTop} </if> "+
"<if test='endTimeTop!= null'> and ts <= #{endTimeTop} </if> "+
"<if test='startTimeTop!= null'> and ts >= #{startTimeTop} </if> "+
"<if test='startTimeTop!= null'> and ts >= #{startTimeTop} </if> "+
"<if test='area!= null'> AND area = #{area} </if> "+
"<if test='area!= null'> AND area = #{area} </if> "+
...
@@ -32,7 +32,7 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
...
@@ -32,7 +32,7 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
@Select("<script>"+
@Select("<script>"+
"SELECT count(1) FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType}"+
"SELECT count(1) FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null"+
"<if test='endTimeTop!= null'> and ts <= #{endTimeTop} </if> "+
"<if test='endTimeTop!= null'> and ts <= #{endTimeTop} </if> "+
"<if test='startTimeTop!= null'> and ts >= #{startTimeTop} </if> "+
"<if test='startTimeTop!= null'> and ts >= #{startTimeTop} </if> "+
"<if test='area!= null'> AND area = #{area} </if> "+
"<if test='area!= null'> AND area = #{area} </if> "+
...
@@ -47,7 +47,7 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
...
@@ -47,7 +47,7 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
@Select("<script>"+
@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 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 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='area!= null'> AND area = #{area} </if> "+
"<if test='station!= null'>AND station = #{station} </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>"+
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>"+
...
@@ -58,7 +58,7 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
...
@@ -58,7 +58,7 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
List<Map<String,Object>>getHealthInfoByArea();
List<Map<String,Object>>getHealthInfoByArea();
@Select("<script>"+
@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 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 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='station!= null'>AND station = #{station} </if>"+
"SELECT `health_index` AS healthIndex,`health_index` AS `value`, rec_date AS recDate, anomaly, substr(analysis_time,1,10) as analysisTime,station,equipment_name AS equipmentName, point_name as pointName, index_address as indexAddress, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status"+
"SELECT `health_index` AS healthIndex,`health_index` AS `value`, rec_date AS recDate, anomaly, substr(analysis_time,1,10) as analysisTime,station,equipment_name AS equipmentName, point_name as pointName, index_address as indexAddress, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status"+
" FROM analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType}"+
" FROM analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null"+
"<if test='endTimeTop!= null'> and ts <= #{endTimeTop} </if> "+
"<if test='endTimeTop!= null'> and ts <= #{endTimeTop} </if> "+
"<if test='startTimeTop!= null'> and ts >= #{startTimeTop} </if> "+
"<if test='startTimeTop!= null'> and ts >= #{startTimeTop} </if> "+
"<if test='area!= null '> AND area = #{area} </if> "+
"<if test='area!= null '> AND area = #{area} </if> "+
...
@@ -42,7 +42,7 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
...
@@ -42,7 +42,7 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
@Select("<script>"+
@Select("<script>"+
"SELECT count(1)"+
"SELECT count(1)"+
" FROM analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType}"+
" FROM analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null"+
"<if test='endTimeTop!= null'> and ts <= #{endTimeTop} </if> "+
"<if test='endTimeTop!= null'> and ts <= #{endTimeTop} </if> "+
"<if test='startTimeTop!= null'> and ts >= #{startTimeTop} </if> "+
"<if test='startTimeTop!= null'> and ts >= #{startTimeTop} </if> "+
"<if test='area!= null '> AND area = #{area} </if> "+
"<if test='area!= null '> AND area = #{area} </if> "+
...
@@ -57,7 +57,7 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
...
@@ -57,7 +57,7 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
"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 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 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='area!= null'> AND area = #{area} </if> "+
"<if test='station!= null'>AND station = #{station} </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>"+
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>"+
...
@@ -67,7 +67,7 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
...
@@ -67,7 +67,7 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
@Select("<script>"+
@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 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 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='station!= null'>AND station = #{station} </if>"+