@@ -50,9 +50,10 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
...
@@ -50,9 +50,10 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
"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 ts >= TODAY()-8h"+
"<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>"+
"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 ts >= TODAY()-8h"+
"<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>"+