Commit 663f4254 authored by lilongyang's avatar lilongyang

1、解决冲突

parent 4d37b07c
......@@ -140,94 +140,6 @@
</where>
limit 1
</select>
<select id="getHealthListInfo" resultType="java.util.Map">
SELECT
CEILING(IFNULL( AVG( HEALTH_INDEX ), 100 )) AS avgHealthIndex,
DATE_ADD( a.date, INTERVAL - 1 DAY ) as date
FROM
(
SELECT
DATE_FORMAT( DATE_ADD(( DATE( DATE_ADD( now(), INTERVAL - 15 DAY ))), INTERVAL @s DAY ), '%Y-%m-%d' ) AS date,
@s := @s + 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 1 ) temp
WHERE
DATEDIFF( now(), DATE( DATE_ADD( now(), INTERVAL - 15 DAY )) ) >= @s
) a
LEFT JOIN (
SELECT
HEALTH_INDEX,
DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) AS recDate
FROM
idx_biz_pv_health_index
<where>
ANALYSIS_TYPE = '按天'
<if test="areaCode != null and areaCode != ''">
AND ARAE like concat('%', #{areaCode}, '%')
AND ANALYSIS_OBJ_TYPE = '片区'
</if>
<if test="stationCode != null and stationCode != ''">
AND GATEWAY_ID = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站'
</if>
<if test="(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')">
AND ANALYSIS_OBJ_TYPE = '片区'
</if>
<if test="gatewayIds != null and gatewayIds.size() > 0">
AND GATEWAY_ID IN
<foreach collection="gatewayIds" item="item" open="(" separator="," close=")">
${item}
</foreach>
</if>
</where>
UNION ALL
(
SELECT
HEALTH_INDEX,
DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) AS recDate
FROM
idx_biz_fan_health_index
<where>
ANALYSIS_TYPE = '按天'
<if test="areaCode != null and areaCode != ''">
AND ARAE like concat('%', #{areaCode}, '%')
AND ANALYSIS_OBJ_TYPE = '片区'
</if>
<if test="stationCode != null and stationCode != ''">
AND GATEWAY_ID = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站'
</if>
<if test="(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')">
AND ANALYSIS_OBJ_TYPE = '片区'
</if>
<if test="gatewayIds != null and gatewayIds.size() > 0">
AND GATEWAY_ID IN
<foreach collection="gatewayIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
)
) b ON DATE_FORMAT( b.recDate, '%Y-%m-%d' ) = a.date
GROUP BY
a.date
</select>
<select id="getAllEquipAlarmInfo" resultType="java.util.Map">
SELECT ARAE as area,
WARNING_NAME as warningName,
count(1) as num
FROM ${tableName} a
where (a.DISPOSOTION_STATE = '待确认')
<!-- or (a.DISPOSOTION_STATE = '已确认' and a.DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY ))-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
<if test="stationCode != null and stationCode != ''">
AND GATEWAY_ID = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站'
</if>
</where>
limit 1
</select>
<select id="getHealthScoreInfoByStationByMinute" resultType="java.math.BigDecimal">
SELECT
round(IFNULL( HEALTH_INDEX , 100 ), 1) AS healthIndex
......
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