|
@ -33,6 +33,8 @@ |
|
|
<result property="eventTitle" column="event_title"/> |
|
|
<result property="eventTitle" column="event_title"/> |
|
|
<result property="occurrenceTime" column="occurrence_time"/> |
|
|
<result property="occurrenceTime" column="occurrence_time"/> |
|
|
<result property="isPerceived" column="is_perceived"/> |
|
|
<result property="isPerceived" column="is_perceived"/> |
|
|
|
|
|
<result property="dimension" column="dimension"/> |
|
|
|
|
|
<result property="longitude" column="longitude"/> |
|
|
</resultMap> |
|
|
</resultMap> |
|
|
|
|
|
|
|
|
<resultMap type="map" id="countMap"> |
|
|
<resultMap type="map" id="countMap"> |
|
@ -77,6 +79,8 @@ |
|
|
<result property="organizationName" column="organization_name"/> |
|
|
<result property="organizationName" column="organization_name"/> |
|
|
<result property="isPerceived" column="is_perceived"/> |
|
|
<result property="isPerceived" column="is_perceived"/> |
|
|
<result property="subclass" column="subclass"/> |
|
|
<result property="subclass" column="subclass"/> |
|
|
|
|
|
<result property="dimension" column="dimension"/> |
|
|
|
|
|
<result property="longitude" column="longitude"/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</resultMap> |
|
|
</resultMap> |
|
@ -142,8 +146,7 @@ |
|
|
select id, dept_id, stake_mark, direction, user_id, start_time, end_time, estimated_end_time, event_level, event_type, event_subclass, event_cause, description, event_state, event_source, event_nature, remark, create_time, update_time, event_source_tips, in_tunnel from dc_event |
|
|
select id, dept_id, stake_mark, direction, user_id, start_time, end_time, estimated_end_time, event_level, event_type, event_subclass, event_cause, description, event_state, event_source, event_nature, remark, create_time, update_time, event_source_tips, in_tunnel from dc_event |
|
|
</sql> --> |
|
|
</sql> --> |
|
|
<sql id="selectDcEventVo"> |
|
|
<sql id="selectDcEventVo"> |
|
|
SELECT |
|
|
SELECT id, |
|
|
id, |
|
|
|
|
|
dc_event.dept_id as dept_id, |
|
|
dc_event.dept_id as dept_id, |
|
|
sys_dept.dept_name, |
|
|
sys_dept.dept_name, |
|
|
stake_mark, |
|
|
stake_mark, |
|
@ -158,6 +161,8 @@ |
|
|
estimated_end_time, |
|
|
estimated_end_time, |
|
|
event_level, |
|
|
event_level, |
|
|
event_type, |
|
|
event_type, |
|
|
|
|
|
longitude, |
|
|
|
|
|
dimension, |
|
|
event_title, |
|
|
event_title, |
|
|
is_perceived, |
|
|
is_perceived, |
|
|
CASE event_type |
|
|
CASE event_type |
|
@ -256,14 +261,15 @@ |
|
|
in_tunnel, |
|
|
in_tunnel, |
|
|
road_id, |
|
|
road_id, |
|
|
lang |
|
|
lang |
|
|
FROM |
|
|
FROM dc_event |
|
|
dc_event |
|
|
|
|
|
LEFT JOIN sys_user on dc_event.user_id = sys_user.user_id |
|
|
LEFT JOIN sys_user on dc_event.user_id = sys_user.user_id |
|
|
LEFT JOIN sys_dept on dc_event.dept_id = sys_dept.dept_id |
|
|
LEFT JOIN sys_dept on dc_event.dept_id = sys_dept.dept_id |
|
|
</sql> |
|
|
</sql> |
|
|
|
|
|
|
|
|
<sql id="selectDcEventVoListAll"> select dc_event.id AS id, |
|
|
<sql id="selectDcEventVoListAll"> select dc_event.id AS id, |
|
|
dc_event.stake_mark, |
|
|
dc_event.stake_mark, |
|
|
|
|
|
dc_event.dimension, |
|
|
|
|
|
dc_event.longitude, |
|
|
dc_event.direction, |
|
|
dc_event.direction, |
|
|
dc_event.is_perceived, |
|
|
dc_event.is_perceived, |
|
|
dc_event.user_id, |
|
|
dc_event.user_id, |
|
@ -314,13 +320,15 @@ |
|
|
dc_vehicles.remark AS dc_vehicles_remark, |
|
|
dc_vehicles.remark AS dc_vehicles_remark, |
|
|
dc_employees.post_id, |
|
|
dc_employees.post_id, |
|
|
dc_employees.NAME, |
|
|
dc_employees.NAME, |
|
|
dc_employees.contact_number FROM dc_event </sql> |
|
|
dc_employees.contact_number |
|
|
|
|
|
FROM dc_event </sql> |
|
|
|
|
|
|
|
|
<select id="selectDcEventList" parameterType="DcEvent" resultMap="DcEventResult"> |
|
|
<select id="selectDcEventList" parameterType="DcEvent" resultMap="DcEventResult"> |
|
|
<include refid="selectDcEventVo"/> |
|
|
<include refid="selectDcEventVo"/> |
|
|
<where> |
|
|
<where> |
|
|
<if test="deptId != null ">and dept_id = #{deptId}</if> |
|
|
<if test="deptId != null ">and dept_id = #{deptId}</if> |
|
|
<if test="stakeMark != null and stakeMark != ''"> and stake_mark BETWEEN #{stakeMark} and #{endStakeMark}</if> |
|
|
<if test="stakeMark != null and stakeMark != ''">and stake_mark BETWEEN #{stakeMark} and #{endStakeMark} |
|
|
|
|
|
</if> |
|
|
<if test="direction != null and direction != ''">and direction = #{direction}</if> |
|
|
<if test="direction != null and direction != ''">and direction = #{direction}</if> |
|
|
<if test="userId != null ">and user_id = #{userId}</if> |
|
|
<if test="userId != null ">and user_id = #{userId}</if> |
|
|
<if test="startTime != null ">and start_time BETWEEN #{startTime} and #{endTime}</if> |
|
|
<if test="startTime != null ">and start_time BETWEEN #{startTime} and #{endTime}</if> |
|
@ -333,7 +341,8 @@ |
|
|
<if test="eventState != null ">and event_state = #{eventState}</if> |
|
|
<if test="eventState != null ">and event_state = #{eventState}</if> |
|
|
<if test="eventSource != null ">and event_source = #{eventSource}</if> |
|
|
<if test="eventSource != null ">and event_source = #{eventSource}</if> |
|
|
<if test="eventNature != null ">and event_nature = #{eventNature}</if> |
|
|
<if test="eventNature != null ">and event_nature = #{eventNature}</if> |
|
|
<if test="eventSourceTips != null and eventSourceTips != ''"> and event_source_tips = #{eventSourceTips}</if> |
|
|
<if test="eventSourceTips != null and eventSourceTips != ''">and event_source_tips = #{eventSourceTips} |
|
|
|
|
|
</if> |
|
|
<if test="inTunnel != null ">and in_tunnel = #{inTunnel}</if> |
|
|
<if test="inTunnel != null ">and in_tunnel = #{inTunnel}</if> |
|
|
<if test="isPerceived != null ">and is_perceived = #{isPerceived}</if> |
|
|
<if test="isPerceived != null ">and is_perceived = #{isPerceived}</if> |
|
|
</where> |
|
|
</where> |
|
@ -369,6 +378,8 @@ |
|
|
WHEN '3' THEN '济南方向' |
|
|
WHEN '3' THEN '济南方向' |
|
|
END AS direction, |
|
|
END AS direction, |
|
|
dc_event.user_id, |
|
|
dc_event.user_id, |
|
|
|
|
|
dc_event.dimension, |
|
|
|
|
|
dc_event.longitude, |
|
|
dc_event.is_perceived, |
|
|
dc_event.is_perceived, |
|
|
dc_event.user_id as user_id, |
|
|
dc_event.user_id as user_id, |
|
|
sys_user.nick_name as nickName, |
|
|
sys_user.nick_name as nickName, |
|
@ -515,6 +526,8 @@ |
|
|
<if test="eventTitle != null">event_title,</if> |
|
|
<if test="eventTitle != null">event_title,</if> |
|
|
<if test="occurrenceTime != null">occurrence_time,</if> |
|
|
<if test="occurrenceTime != null">occurrence_time,</if> |
|
|
<if test="isPerceived != null">is_perceived,</if> |
|
|
<if test="isPerceived != null">is_perceived,</if> |
|
|
|
|
|
<if test="dimension != null">dimension,</if> |
|
|
|
|
|
<if test="longitude != null">longitude,</if> |
|
|
</trim> |
|
|
</trim> |
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
<if test="id != null">#{id},</if> |
|
|
<if test="id != null">#{id},</if> |
|
@ -543,6 +556,8 @@ |
|
|
<if test="eventTitle != null">#{eventTitle},</if> |
|
|
<if test="eventTitle != null">#{eventTitle},</if> |
|
|
<if test="occurrenceTime != null">#{occurrenceTime},</if> |
|
|
<if test="occurrenceTime != null">#{occurrenceTime},</if> |
|
|
<if test="isPerceived != null">#{isPerceived},</if> |
|
|
<if test="isPerceived != null">#{isPerceived},</if> |
|
|
|
|
|
<if test="dimension != null">#{dimension},</if> |
|
|
|
|
|
<if test="longitude != null">#{longitude},</if> |
|
|
</trim> |
|
|
</trim> |
|
|
</insert> |
|
|
</insert> |
|
|
<insert id="batchInsertDcEvent" useGeneratedKeys="true" keyProperty="id"> |
|
|
<insert id="batchInsertDcEvent" useGeneratedKeys="true" keyProperty="id"> |
|
@ -575,6 +590,8 @@ |
|
|
<if test="dcEvent.eventTitle != null">event_title,</if> |
|
|
<if test="dcEvent.eventTitle != null">event_title,</if> |
|
|
<if test="dcEvent.occurrenceTime != null">occurrence_time,</if> |
|
|
<if test="dcEvent.occurrenceTime != null">occurrence_time,</if> |
|
|
<if test="dcEvent.isPerceived != null">is_perceived,</if> |
|
|
<if test="dcEvent.isPerceived != null">is_perceived,</if> |
|
|
|
|
|
<if test="dcEvent.dimension != null">dimension,</if> |
|
|
|
|
|
<if test="dcEvent.longitude != null">longitude,</if> |
|
|
</trim> |
|
|
</trim> |
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
<if test="dcEvent.id != null">#{dcEvent.id},</if> |
|
|
<if test="dcEvent.id != null">#{dcEvent.id},</if> |
|
@ -603,6 +620,8 @@ |
|
|
<if test="dcEvent.eventTitle != null">#{dcEvent.eventTitle},</if> |
|
|
<if test="dcEvent.eventTitle != null">#{dcEvent.eventTitle},</if> |
|
|
<if test="dcEvent.occurrenceTime != null">#{dcEvent.occurrenceTime},</if> |
|
|
<if test="dcEvent.occurrenceTime != null">#{dcEvent.occurrenceTime},</if> |
|
|
<if test="dcEvent.isPerceived != null">#{dcEvent.isPerceived},</if> |
|
|
<if test="dcEvent.isPerceived != null">#{dcEvent.isPerceived},</if> |
|
|
|
|
|
<if test="dcEvent.dimension != null">#{dcEvent.dimension},</if> |
|
|
|
|
|
<if test="dcEvent.longitude != null">#{dcEvent.longitude},</if> |
|
|
</trim> |
|
|
</trim> |
|
|
</foreach> |
|
|
</foreach> |
|
|
</insert> |
|
|
</insert> |
|
@ -635,13 +654,17 @@ |
|
|
<if test="eventTitle != null">event_title = #{eventTitle},</if> |
|
|
<if test="eventTitle != null">event_title = #{eventTitle},</if> |
|
|
<if test="occurrenceTime != null">occurrence_time = #{occurrenceTime},</if> |
|
|
<if test="occurrenceTime != null">occurrence_time = #{occurrenceTime},</if> |
|
|
<if test="isPerceived != null">is_perceived = #{isPerceived},</if> |
|
|
<if test="isPerceived != null">is_perceived = #{isPerceived},</if> |
|
|
|
|
|
<if test="dimension != null">dimension = #{dimension},</if> |
|
|
|
|
|
<if test="longitude != null">longitude = #{longitude},</if> |
|
|
</trim> |
|
|
</trim> |
|
|
where id = #{id} |
|
|
where id = #{id} |
|
|
</update> |
|
|
</update> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteDcEventById" parameterType="String"> |
|
|
<delete id="deleteDcEventById" parameterType="String"> |
|
|
delete from dc_event where id = #{id} |
|
|
delete |
|
|
|
|
|
from dc_event |
|
|
|
|
|
where id = #{id} |
|
|
</delete> |
|
|
</delete> |
|
|
|
|
|
|
|
|
<delete id="deleteDcEventByIds" parameterType="String"> |
|
|
<delete id="deleteDcEventByIds" parameterType="String"> |
|
@ -665,8 +688,7 @@ |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="selectCount" resultMap="countMap" resultType="map"> |
|
|
<select id="selectCount" resultMap="countMap" resultType="map"> |
|
|
SELECT |
|
|
SELECT s.status, |
|
|
s.status, |
|
|
|
|
|
COALESCE(t.count, 0) AS count |
|
|
COALESCE(t.count, 0) AS count |
|
|
FROM ( |
|
|
FROM ( |
|
|
SELECT 0 AS event_state, 'state0Count' AS status UNION ALL |
|
|
SELECT 0 AS event_state, 'state0Count' AS status UNION ALL |
|
@ -678,7 +700,8 @@ |
|
|
SELECT event_state, COUNT (*) AS count |
|
|
SELECT event_state, COUNT (*) AS count |
|
|
FROM dc_event |
|
|
FROM dc_event |
|
|
GROUP BY event_state |
|
|
GROUP BY event_state |
|
|
) t ON s.event_state = t.event_state; |
|
|
) t |
|
|
|
|
|
ON s.event_state = t.event_state; |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|