Commit 4be6f792 authored by duanruiming's avatar duanruiming

Merge remote-tracking branch 'origin/master'

parents e5e16eac 4cb329da
package net.wanji.opt.entity; package net.wanji.opt.entity;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -53,4 +54,13 @@ public class EventAlarmInfo { ...@@ -53,4 +54,13 @@ public class EventAlarmInfo {
@ApiModelProperty(value = "路口状态 0正常 1失衡 2拥堵 3溢出 5空放") @ApiModelProperty(value = "路口状态 0正常 1失衡 2拥堵 3溢出 5空放")
private Integer status; private Integer status;
@ApiModelProperty(value = "事件发生方向",hidden = true)
private String dir;
@ApiModelProperty(value = "事件发生转向",hidden = true)
private String turn;
@ApiModelProperty(value = "事件发生方向描述")
private String dirDesc;
} }
...@@ -119,14 +119,16 @@ ...@@ -119,14 +119,16 @@
<!-- 查询路口未结束的报警状态 --> <!-- 查询路口未结束的报警状态 -->
<select id="findNotFinishAlarmInfo" parameterType="String" resultMap="eventAlarm"> <select id="findNotFinishAlarmInfo" parameterType="String" resultMap="eventAlarm">
select select
DISTINCT DISTINCT a.type as event_type,
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, 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.id as cross_id,
c.name as cross_name , c.name as cross_name ,
b.label as current_algo, b.label as current_algo,
SUBSTRING(c.location FROM 7 FOR 20) as wkt, SUBSTRING(c.location FROM 7 FOR 20) as wkt,
ifnull(a.alarm_status,-1) alarm_status, ifnull(a.alarm_status,-1) alarm_status,
a.opt_status a.opt_status,
dir,
if(turn='null',null,turn) turn
from t_base_cross_info c 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 * 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 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
......
...@@ -22,4 +22,7 @@ public interface GreenwaveHistMapper extends BaseMapper<GreenwaveHistPO> { ...@@ -22,4 +22,7 @@ public interface GreenwaveHistMapper extends BaseMapper<GreenwaveHistPO> {
List<GreenwaveHistPO> selectByIdAndTimeSection(Integer greenwaveId, String startTimeStr, String endTimeStr); List<GreenwaveHistPO> selectByIdAndTimeSection(Integer greenwaveId, String startTimeStr, String endTimeStr);
int insertBatch(@Param("list") List<GreenwaveHistPO> list); int insertBatch(@Param("list") List<GreenwaveHistPO> list);
List<GreenwaveHistPO> selectByIdAndType(@Param("greenwaveId") Integer greenwaveId,@Param("statusList") List<Integer> statusList);
} }
...@@ -107,4 +107,16 @@ ...@@ -107,4 +107,16 @@
gmt_modified = values(gmt_modified) gmt_modified = values(gmt_modified)
</insert> </insert>
<select id="selectByIdAndType" resultType="net.wanji.databus.dao.entity.GreenwaveHistPO">
select
<include refid="Base_Column_List"/>
from t_greenwave_hist
where green_id = #{greenwaveId}
and status in
<foreach collection="statusList" item="status" separator="," open="(" close=")">
#{status}
</foreach>
and start_time &gt;= DATE_FORMAT(now(), '%Y-%m-%d 00:00:00')
order by start_time asc
</select>
</mapper> </mapper>
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