Commit 98f8907c authored by 黄伟铭's avatar 黄伟铭

修改干线事件接口,新增持续时间字段

parent 9ed713e9
......@@ -8,4 +8,5 @@ public class CrossRealTimeAlarmEntity {
private String startTime;
private String dir;
private String eventSerialNumber;
private String duration;
}
......@@ -11,6 +11,7 @@
<result property="type" column="type"></result>
<result property="startTime" column="startTime"></result>
<result property="dir" column="dir"></result>
<result property="duration" column="duration"></result>
</resultMap>
<select id="getTrunkLineProblemDescribe" parameterType="String" resultMap="tlProblemDescribe">
......@@ -38,7 +39,7 @@
</select>
<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 , a.duration
from t_event_info a
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')
......@@ -48,7 +49,7 @@
</select>
<select id="getTrunkLineRealTimeAlarmPlan" parameterType="map" resultMap="tlRealTimeAlarmsResultMap">
select DISTINCT '' as type,a.control_time as startTime ,'' as dir from t_strategy_green_opt_hist a
select DISTINCT '' as type,a.control_time as startTime ,'' as dir, '' as duration from t_strategy_green_opt_hist a
where a.control_time = (select MAX(control_time) from t_strategy_green_opt_hist where green_id = #{greenID}
and control_time >= DATE_FORMAT(DATE_sub(#{time},INTERVAL control_duration SECOND),'%Y-%m-%d %H:%i:%s') and control_time <![CDATA[ <= ]]> DATE_FORMAT(#{time}, '%Y-%m-%d %H:%i:%s')
and response_code = 200 )
......@@ -56,7 +57,7 @@
</select>
<select id="getTrunkLineRealTimeAlarmPlan1" parameterType="map" resultMap="tlRealTimeAlarmsResultMap">
select DISTINCT '' as type,a.control_time as startTime ,'' as dir from t_strategy_green_opt_hist a
select DISTINCT '' as type,a.control_time as startTime ,'' as dir, '' as duration from t_strategy_green_opt_hist a
where a.control_time = (select MIN(control_time) from t_strategy_green_opt_hist where green_id = #{greenID}
and control_time <![CDATA[ <= ]]> DATE_FORMAT(DATE_ADD(#{time},INTERVAL 5 MINUTE),'%Y-%m-%d %H:%i:%s') and control_time >= DATE_FORMAT(#{time}, '%Y-%m-%d %H:%i:%s')
and response_code = 200 )
......
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