Commit 716b430a authored by 黄伟铭's avatar 黄伟铭

修正干线状态SQL

parent be46acc0
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
end as status_cn end as status_cn
from from
t_event_info a t_event_info a
where a.green_id = 1 where a.green_id = #{greenID}
and a.type in (705,706) and a.type in (705,706)
<if test="time == '' "> <if test="time == '' ">
and a.end_time is null and a.end_time is null
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<select id="getTrunkLineRealTimeAlarm" parameterType="map" resultMap="tlRealTimeAlarmsResultMap"> <select id="getTrunkLineRealTimeAlarm" parameterType="map" resultMap="tlRealTimeAlarmsResultMap">
select a.type , a.start_time as startTime , SUBSTR(a.dir, 2, length(a.dir)-2) as dir select a.type , a.start_time as startTime , SUBSTR(a.dir, 2, length(a.dir)-2) as dir
from t_event_info a from t_event_info a
where a.start_time = (select MAX(start_time) from t_event_info where cross_id = #{greenID} where a.start_time = (select MAX(start_time) from t_event_info where green_id = #{greenID}
and start_time <![CDATA[ <= ]]> DATE_FORMAT(#{time}, '%Y-%m-%d %H:%i:%s') and start_time >= DATE_FORMAT(DATE_SUB(#{time},INTERVAL 5 MINUTE), '%Y-%m-%d %H:%i:%s') and start_time <![CDATA[ <= ]]> DATE_FORMAT(#{time}, '%Y-%m-%d %H:%i:%s') and start_time >= DATE_FORMAT(DATE_SUB(#{time},INTERVAL 5 MINUTE), '%Y-%m-%d %H:%i:%s')
and dt = DATE_FORMAT(#{time}, '%Y%m%d') ) and dt = DATE_FORMAT(#{time}, '%Y%m%d') )
and a.type in (705, 706) and a.type in (705, 706)
......
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