Commit 1f1ba4de authored by zhangsen's avatar zhangsen

bug修改

parent 8a065971
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<select id="getHealthScoreInfo" resultType="java.math.BigDecimal"> <select id="getHealthScoreInfo" resultType="java.math.BigDecimal">
SELECT SELECT
round(avg( a.avgHealthIndex ), 2) AS healthIndex CEILING(avg( a.avgHealthIndex )) AS healthIndex
FROM FROM
( (
SELECT SELECT
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<select id="getHealthScoreInfoByStation" resultType="java.math.BigDecimal"> <select id="getHealthScoreInfoByStation" resultType="java.math.BigDecimal">
SELECT SELECT
round(IFNULL( HEALTH_INDEX , 100 ), 2) AS healthIndex CEILING(IFNULL( HEALTH_INDEX , 100 )) AS healthIndex
FROM FROM
${tableName} ${tableName}
<where> <where>
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<select id="getHealthListInfo" resultType="java.util.Map"> <select id="getHealthListInfo" resultType="java.util.Map">
SELECT SELECT
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex, CEILING(IFNULL( AVG( HEALTH_INDEX ), 100 )) AS avgHealthIndex,
DATE_ADD( a.date, INTERVAL - 1 DAY ) as date DATE_ADD( a.date, INTERVAL - 1 DAY ) as date
FROM FROM
( (
...@@ -141,7 +141,8 @@ ...@@ -141,7 +141,8 @@
count(1) as num count(1) as num
FROM FROM
${tableName} a ${tableName} a
where a.DISPOSOTION_STATE == '未处置' where (a.DISPOSOTION_STATE = '未处置')
or (a.DISPOSOTION_STATE = '已处置' and a.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) )
group by ARAE, group by ARAE,
WARNING_NAME WARNING_NAME
</select> </select>
...@@ -190,11 +191,16 @@ ...@@ -190,11 +191,16 @@
STATION AS station, STATION AS station,
WARNING_NAME AS warningName, WARNING_NAME AS warningName,
count( 1 ) AS num, count( 1 ) AS num,
( SELECT count( 1 ) FROM idx_biz_fan_warning_record wr WHERE wr.DISPOSOTION_STATE = '未处置' AND wr.STATION = STATION ) AS allNum ( SELECT count( 1 ) FROM idx_biz_fan_warning_record wr WHERE
((wr.DISPOSOTION_STATE = '未处置')
or (wr.DISPOSOTION_STATE = '已处置' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
AND wr.STATION = STATION
) AS allNum
FROM FROM
idx_biz_fan_warning_record idx_biz_fan_warning_record
WHERE WHERE
DISPOSOTION_STATE = '未处置' ((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
GROUP BY GROUP BY
STATION, STATION,
WARNING_NAME UNION ALL WARNING_NAME UNION ALL
...@@ -202,11 +208,16 @@ ...@@ -202,11 +208,16 @@
STATION AS station, STATION AS station,
WARNING_NAME AS warningName, WARNING_NAME AS warningName,
count( 1 ) AS num, count( 1 ) AS num,
( SELECT count( 1 ) FROM idx_biz_pv_warning_record wr WHERE wr.DISPOSOTION_STATE = '未处置' AND wr.STATION = STATION ) AS allNum ( SELECT count( 1 ) FROM idx_biz_pv_warning_record wr WHERE
((wr.DISPOSOTION_STATE = '未处置')
or (wr.DISPOSOTION_STATE = '已处置' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
AND wr.STATION = STATION
) AS allNum
FROM FROM
idx_biz_pv_warning_record idx_biz_pv_warning_record
WHERE WHERE
DISPOSOTION_STATE = '未处置' ((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
GROUP BY GROUP BY
STATION, STATION,
WARNING_NAME WARNING_NAME
...@@ -271,8 +282,10 @@ ...@@ -271,8 +282,10 @@
FROM FROM
idx_biz_fan_warning_record idx_biz_fan_warning_record
<where> <where>
((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
GATEWAY_ID = #{stationCode} and GATEWAY_ID = #{stationCode}
</if> </if>
</where> </where>
UNION ALL UNION ALL
...@@ -281,8 +294,10 @@ ...@@ -281,8 +294,10 @@
FROM FROM
idx_biz_pv_warning_record idx_biz_pv_warning_record
<where> <where>
((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
GATEWAY_ID = #{stationCode} and GATEWAY_ID = #{stationCode}
</if> </if>
</where> </where>
) a ) a
...@@ -307,7 +322,8 @@ ...@@ -307,7 +322,8 @@
FROM FROM
${tableName} a ${tableName} a
<where> <where>
a.DISPOSOTION_STATE = '未处置' ((a.DISPOSOTION_STATE = '未处置')
or (a.DISPOSOTION_STATE = '已处置' and a.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
and a.ARAE like concat('%', #{areaCode}, '%') and a.ARAE like concat('%', #{areaCode}, '%')
</if> </if>
...@@ -330,7 +346,9 @@ ...@@ -330,7 +346,9 @@
count( 1 ) AS num, count( 1 ) AS num,
( SELECT count( 1 ) FROM idx_biz_pv_warning_record ( SELECT count( 1 ) FROM idx_biz_pv_warning_record
<where> <where>
DISPOSOTION_STATE = '未处置' AND wr.POINT_NAME = POINT_NAME ((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
AND wr.POINT_NAME = POINT_NAME
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
and ARAE like concat('%', #{areaCode}, '%') and ARAE like concat('%', #{areaCode}, '%')
</if> </if>
...@@ -340,7 +358,8 @@ ...@@ -340,7 +358,8 @@
FROM FROM
idx_biz_pv_warning_record wr idx_biz_pv_warning_record wr
<where> <where>
wr.DISPOSOTION_STATE = '未处置' ((wr.DISPOSOTION_STATE = '未处置')
or (wr.DISPOSOTION_STATE = '已处置' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
and wr.ARAE like concat('%', #{areaCode}, '%') and wr.ARAE like concat('%', #{areaCode}, '%')
</if> </if>
...@@ -354,7 +373,9 @@ ...@@ -354,7 +373,9 @@
count( 1 ) AS num, count( 1 ) AS num,
( SELECT count( 1 ) FROM idx_biz_fan_warning_record ( SELECT count( 1 ) FROM idx_biz_fan_warning_record
<where> <where>
DISPOSOTION_STATE = '未处置' AND wr.POINT_NAME = POINT_NAME ((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
AND wr.POINT_NAME = POINT_NAME
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
and ARAE like concat('%', #{areaCode}, '%') and ARAE like concat('%', #{areaCode}, '%')
</if> </if>
...@@ -364,7 +385,8 @@ ...@@ -364,7 +385,8 @@
FROM FROM
idx_biz_fan_warning_record wr idx_biz_fan_warning_record wr
<where> <where>
wr.DISPOSOTION_STATE = '未处置' ((wr.DISPOSOTION_STATE = '未处置')
or (wr.DISPOSOTION_STATE = '已处置' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
and wr.ARAE like concat('%', #{areaCode}, '%') and wr.ARAE like concat('%', #{areaCode}, '%')
</if> </if>
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
idx_biz_fan_warning_record idx_biz_fan_warning_record
) a ) a
<where> <where>
((a.disposotionState = '未处置') or (a.disposotionState = '已处置' AND DATE_FORMAT( a.disposotionDate, '%Y-%m-%d' ) = CURRENT_DATE)) ((a.disposotionState = '未处置') or (a.disposotionState = '已处置' AND a.disposotionDate > DATE_ADD( now(), INTERVAL - 3 DAY )))
<if test="arae != '' and arae != null"> <if test="arae != '' and arae != null">
AND a.arae like concat('%', #{arae}, '%') AND a.arae like concat('%', #{arae}, '%')
</if> </if>
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
idx_biz_fan_warning_record idx_biz_fan_warning_record
) a ) a
<where> <where>
((a.disposotionState = '未处置') or (a.disposotionState = '已处置' AND DATE_FORMAT( a.disposotionDate, '%Y-%m-%d' ) = CURRENT_DATE)) ((a.disposotionState = '未处置') or (a.disposotionState = '已处置' AND a.disposotionDate > DATE_ADD( now(), INTERVAL - 3 DAY )))
<if test="arae != '' and arae != null"> <if test="arae != '' and arae != null">
AND a.arae like concat('%', #{arae}, '%') AND a.arae like concat('%', #{arae}, '%')
</if> </if>
......
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