"SELECT distinct `health_index` AS healthIndex,anomaly,rec_date as recDate, `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"+
"SELECT distinct `health_index` AS healthIndex,anomaly,rec_date as recDate, `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> "+
...
@@ -23,17 +22,17 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
...
@@ -23,17 +22,17 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
"SELECT count(1) from ( SELECT distinct `health_index` AS healthIndex,anomaly,rec_date as recDate, `health_index` AS `value`, substr(analysis_time,1,10) as analysisTime, station,equipment_name AS equipmentName,point_name as pointName,\n"+
"SELECT count(1) from ( SELECT distinct `health_index` AS healthIndex,anomaly,rec_date as recDate, `health_index` AS `value`, substr(analysis_time,1,10) as analysisTime, station,equipment_name AS equipmentName,point_name as pointName,\n"+
"( 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"+
"( 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> "+
...
@@ -47,26 +46,46 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
...
@@ -47,26 +46,46 @@ 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 (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"+
"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='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>"+
"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"+
"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='station!= null'>AND station = #{station} </if>"+
"SELECT distinct `health_index` AS healthIndex,anomaly,rec_date as recDate, `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 rec_date <= #{endTimeTop} </if> "+
"<if test='startTimeTop!= null'> and rec_date >= #{startTimeTop} </if> "+
"<if test='area!= null'> AND area = #{area} </if> "+
"<if test='indexAddress!= null'> AND index_address = #{indexAddress} </if> "+
"SELECT `health_index` AS healthIndex, anomaly, `health_index` AS `value`, rec_date AS recDate, analysis_time 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_hour WHERE analysis_obj_type = #{analysisObjType}"+
"SELECT `health_index` AS healthIndex, anomaly, `health_index` AS `value`, rec_date AS recDate, analysis_time 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_hour WHERE analysis_obj_type = #{analysisObjType}"+
"<if test='endTimeTop!= null'> and analysis_time <= #{endTimeTop} </if> "+
"<if test='endTimeTop!= null'> and analysis_time <= #{endTimeTop} </if> "+
"<if test='startTimeTop!= null'> and analysis_time >= #{startTimeTop} </if> "+
"<if test='startTimeTop!= null'> and analysis_time >= #{startTimeTop} </if> "+
...
@@ -23,9 +23,28 @@ public interface FanHealthIndexHourMapper extends BaseMapper<FanHealthIndexHour>
...
@@ -23,9 +23,28 @@ public interface FanHealthIndexHourMapper extends BaseMapper<FanHealthIndexHour>
// "<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>" +
"<if test='orgCode!= null'>AND org_code like '${orgCode}' </if>"+
"<if test='orgCode!= null'>AND org_code like '${orgCode}' </if>"+
"order by health_index "+
"order by health_index "+
"<if test='current != null and size != null'>limit ${current},${size} </if>"+
"<if test='current != null and size != null'>limit ${current},${size} </if>"+
"SELECT distinct `health_index` AS healthIndex,anomaly,rec_date as recDate, `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_hour WHERE analysis_obj_type = #{analysisObjType} and org_code is not null"+
"<if test='endTimeTop!= null'> and rec_date <= #{endTimeTop} </if> "+
"<if test='startTimeTop!= null'> and rec_date >= #{startTimeTop} </if> "+
"<if test='area!= null'> AND area = #{area} </if> "+
"<if test='indexAddress!= null'> AND index_address = #{indexAddress} </if> "+
"SELECT `health_index` AS healthIndex,`health_index` AS `value`, rec_date AS recDate,anomaly, analysis_time AS analysisTime,point_name as pointName, station,equipment_name AS equipmentName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status FROM analysis_data.fan_health_index_moment WHERE analysis_obj_type = #{analysisObjType}"+
"SELECT `health_index` AS healthIndex,`health_index` AS `value`, rec_date AS recDate,anomaly, analysis_time AS analysisTime,point_name as pointName, station,equipment_name AS equipmentName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status FROM analysis_data.fan_health_index_moment WHERE analysis_obj_type = #{analysisObjType}"+
"<if test='endTimeTop!= null'> and analysis_time <= #{endTimeTop} </if> "+
"<if test='endTimeTop!= null'> and analysis_time <= #{endTimeTop} </if> "+
"<if test='startTimeTop!= null'> and analysis_time >= #{startTimeTop} </if> "+
"<if test='startTimeTop!= null'> and analysis_time >= #{startTimeTop} </if> "+
...
@@ -22,9 +22,28 @@ public interface FanHealthIndexMomentMapper extends BaseMapper<FanHealthIndexMom
...
@@ -22,9 +22,28 @@ public interface FanHealthIndexMomentMapper extends BaseMapper<FanHealthIndexMom
"SELECT distinct `health_index` AS healthIndex,anomaly,rec_date as recDate, `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_moment WHERE analysis_obj_type = #{analysisObjType} and org_code is not null"+
"<if test='endTimeTop!= null'> and rec_date <= #{endTimeTop} </if> "+
"<if test='startTimeTop!= null'> and rec_date >= #{startTimeTop} </if> "+
"<if test='area!= null'> AND area = #{area} </if> "+
"<if test='indexAddress!= null'> AND index_address = #{indexAddress} </if> "+
"SELECT distinct `health_index` AS healthIndex,rec_date as recDate, `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} and org_code is not null"+
"<if test='endTimeTop!= null'> and rec_date <= #{endTimeTop} </if> "+
"<if test='startTimeTop!= null'> and rec_date >= #{startTimeTop} </if> "+
"<if test='area!= null '> AND area = #{area} </if> "+
"<if test='indexAddress!= null '> AND index_address = #{indexAddress} </if> "+
"SELECT `health_index` AS healthIndex, `health_index` AS `value`, rec_date AS recDate, anomaly, analysis_time,station,equipment_name AS equipmentName, ( 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, analysis_time,station,equipment_name AS equipmentName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status"+
" FROM analysis_data.pv_health_index_hour WHERE analysis_obj_type = #{analysisObjType}"+
" FROM analysis_data.pv_health_index_hour WHERE analysis_obj_type = #{analysisObjType}"+
"<if test='endTimeTop!= null'> and analysis_time <= #{endTimeTop} </if> "+
"<if test='endTimeTop!= null'> and analysis_time <= #{endTimeTop} </if> "+
...
@@ -23,12 +24,13 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> {
...
@@ -23,12 +24,13 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> {
"SELECT distinct `health_index` AS healthIndex,rec_date as recDate, `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_hour WHERE analysis_obj_type = #{analysisObjType} and org_code is not null"+
"<if test='endTimeTop!= null'> and rec_date <= #{endTimeTop} </if> "+
"<if test='startTimeTop!= null'> and rec_date >= #{startTimeTop} </if> "+
"<if test='area!= null '> AND area = #{area} </if> "+
"<if test='indexAddress!= null '> AND index_address = #{indexAddress} </if> "+
"SELECT `health_index` AS healthIndex,`health_index` AS `value`, rec_date AS recDate, anomaly, analysis_time,station,equipment_name AS equipmentName, ( 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, analysis_time,station,equipment_name AS equipmentName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status"+
" FROM analysis_data.pv_health_index_moment WHERE analysis_obj_type = #{analysisObjType}"+
" FROM analysis_data.pv_health_index_moment WHERE analysis_obj_type = #{analysisObjType}"+
"<if test='endTimeTop!= null'> and analysis_time <= #{endTimeTop} </if> "+
"<if test='endTimeTop!= null'> and analysis_time <= #{endTimeTop} </if> "+
...
@@ -23,13 +24,13 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen
...
@@ -23,13 +24,13 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen
"SELECT distinct `health_index` AS healthIndex,rec_date as recDate, `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_moment WHERE analysis_obj_type = #{analysisObjType} and org_code is not null"+
"<if test='endTimeTop!= null'> and rec_date <= #{endTimeTop} </if> "+
"<if test='startTimeTop!= null'> and rec_date >= #{startTimeTop} </if> "+
"<if test='area!= null '> AND area = #{area} </if> "+
"<if test='indexAddress!= null '> AND index_address = #{indexAddress} </if> "+