Commit ec7a762a authored by zhoushiguang's avatar zhoushiguang

路口实时状态接口

parent 4403e0af
......@@ -50,7 +50,7 @@ public class EventAlarmInfo {
@ApiModelProperty(value = "持续时间,单位秒")
private Integer duration;
@ApiModelProperty(value = "路口状态 701:空放 702:失衡 703:溢出 -1:正常")
@ApiModelProperty(value = "路口状态 0正常 1失衡 2拥堵 3溢出 5空放")
private Integer status;
}
......@@ -116,13 +116,15 @@
</select>
<!-- 查询路口未结束的报警状态 -->
<select id="findNotFinishAlarmInfo" parameterType="String" resultMap="eventAlarm">
select DISTINCT ifnull(a.type,-1) as status,
c.id as cross_id,
c.name as cross_name ,
b.label as current_algo,
SUBSTRING(c.location FROM 7 FOR 20) as wkt,
ifnull(a.alarm_status,-1) alarm_status,
a.opt_status
select
DISTINCT
case when a.type=701 then 5 when a.type=702 then 1 when a.type=703 then 3 when a.type=707 then 2 else ifnull(a.type,0) end as status,
c.id as cross_id,
c.name as cross_name ,
b.label as current_algo,
SUBSTRING(c.location FROM 7 FOR 20) as wkt,
ifnull(a.alarm_status,-1) alarm_status,
a.opt_status
from t_base_cross_info c
left join (select * from t_event_info where dt = DATE_FORMAT(NOW(),'%Y%m%d') and type in (701,702,703,707) and alarm_status in (0,1,2)) a on a.cross_id = c.id
left join (select a.event_type, a.label from t_config_event_category a where a.category = 4) b on a.type = b.event_type
......
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