|
@@ -6,8 +6,8 @@
|
|
|
|
|
|
<!-- *************************************** resultMap块 开始*********************************************** -->
|
|
|
|
|
|
- <!-- 查询待确认事件 -->
|
|
|
- <resultMap type="EventInfoBO" id="EventInfoResult">
|
|
|
+ <!-- 查询待确认事件列表 -->
|
|
|
+ <resultMap type="EventInfoBO" id="EventInfoUnconfirmedResult">
|
|
|
<result property="eventId" column="event_id"/>
|
|
|
<result property="eventType" column="event_type"/>
|
|
|
<result property="eventTypeName" column="event_type_name"/>
|
|
@@ -34,17 +34,17 @@
|
|
|
select="selectEventAttachListByEventIdToUnconfirmed">
|
|
|
</collection>
|
|
|
</resultMap>
|
|
|
+
|
|
|
<!-- 待确认事件 / 无异常事件列表关联附件sql -->
|
|
|
<select id="selectEventAttachListByEventIdToUnconfirmed" resultType="EventAttach">
|
|
|
SELECT id, log_id logId, event_id eventId, path, source, source_type sourceType, sort
|
|
|
FROM event_attach_unconfirmed
|
|
|
WHERE event_id = #{eventId}
|
|
|
- and source = 'event_log_file_source_1'
|
|
|
- order by sort
|
|
|
+ ORDER BY sort
|
|
|
</select>
|
|
|
|
|
|
<!-- 待确认事件详情 -->
|
|
|
- <resultMap type="EventInfo" id="EventDetailResult">
|
|
|
+ <resultMap type="EventInfo" id="EventDetailUnconfirmedResult">
|
|
|
<result property="eventId" column="event_id"/>
|
|
|
<result property="eventType" column="event_type"/>
|
|
|
<result property="eventTypeName" column="event_type_name"/>
|
|
@@ -69,12 +69,12 @@
|
|
|
property="eventLogList"
|
|
|
ofType="EventLog"
|
|
|
column="event_id"
|
|
|
- select="selectEventLogList">
|
|
|
+ select="selectEventLogListToUnconfirmed">
|
|
|
</collection>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 待确认事件详情日志 -->
|
|
|
- <resultMap type="EventLog" id="EventAttachResult">
|
|
|
+ <resultMap type="EventLog" id="selectEventLogListToUnconfirmed">
|
|
|
<id property="id" column="id"/>
|
|
|
<result property="content" column="content"/>
|
|
|
<!-- 嵌套ATTACH集合 -->
|
|
@@ -82,20 +82,20 @@
|
|
|
property="attachList"
|
|
|
ofType="EventAttach"
|
|
|
column="id"
|
|
|
- select="selectEventAttachListByLogId">
|
|
|
+ select="selectEventAttachListByLogIdToUnconfirmed">
|
|
|
</collection>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 待确认事件详情日志 -->
|
|
|
- <select id="selectEventLogList" resultMap="EventAttachResult">
|
|
|
+ <select id="selectEventLogListToUnconfirmed" resultMap="EventDetailUnconfirmedResult">
|
|
|
SELECT *
|
|
|
FROM event_log
|
|
|
WHERE event_id = #{eventId}
|
|
|
- order by create_time
|
|
|
+ ORDER BY create_time
|
|
|
</select>
|
|
|
|
|
|
<!-- 待确认事件日志关联附件 -->
|
|
|
- <select id="selectEventAttachListByLogId" resultType="EventAttach">
|
|
|
+ <select id="selectEventAttachListByLogIdToUnconfirmed" resultType="EventAttach">
|
|
|
SELECT log_id logId,
|
|
|
event_id eventId,
|
|
|
path,
|
|
@@ -104,7 +104,7 @@
|
|
|
sort
|
|
|
FROM event_attach_unconfirmed
|
|
|
WHERE log_id = #{id}
|
|
|
- order by sort
|
|
|
+ ORDER BY sort
|
|
|
</select>
|
|
|
|
|
|
<!-- 确认事件列表 / 无异常事件列表 -->
|
|
@@ -135,13 +135,13 @@
|
|
|
select="selectEventAttachListByEventIdToProcess">
|
|
|
</collection>
|
|
|
</resultMap>
|
|
|
+
|
|
|
<!-- 确认事件列表关联附件sql -->
|
|
|
<select id="selectEventAttachListByEventIdToProcess" resultType="EventAttach">
|
|
|
SELECT id, log_id logId, event_id eventId, path, source, source_type sourceType, sort
|
|
|
FROM event_attach_process
|
|
|
WHERE event_id = #{eventId}
|
|
|
- and source = 'event_log_file_source_99'
|
|
|
- order by sort
|
|
|
+ ORDER BY sort
|
|
|
</select>
|
|
|
|
|
|
<!-- 确认事件详情 -->
|
|
@@ -192,7 +192,7 @@
|
|
|
SELECT *
|
|
|
FROM event_log
|
|
|
WHERE event_id = #{eventId}
|
|
|
- order by create_time
|
|
|
+ ORDER BY create_time
|
|
|
</select>
|
|
|
|
|
|
<!-- 确认事件日志关联附件 -->
|
|
@@ -205,7 +205,7 @@
|
|
|
sort
|
|
|
FROM event_attach_process
|
|
|
WHERE log_id = #{id}
|
|
|
- order by sort
|
|
|
+ ORDER BY sort
|
|
|
</select>
|
|
|
|
|
|
<!-- *************************************** resultMap块 开始*********************************************** -->
|
|
@@ -232,7 +232,7 @@
|
|
|
a.update_by,
|
|
|
a.update_time
|
|
|
FROM event_unconfirmed a
|
|
|
- LEFT JOIN event_type b ON a.event_type = b.id
|
|
|
+ LEFT JOIN event_type b ON a.event_type = b.id
|
|
|
</sql>
|
|
|
|
|
|
<sql id="selectEventProcessInfoVo">
|
|
@@ -256,7 +256,7 @@
|
|
|
a.update_by,
|
|
|
a.update_time
|
|
|
FROM event_process a
|
|
|
- LEFT JOIN event_type b ON a.event_type = b.id
|
|
|
+ LEFT JOIN event_type b ON a.event_type = b.id
|
|
|
</sql>
|
|
|
|
|
|
<sql id="selectUsualEventInfoVo">
|
|
@@ -280,37 +280,37 @@
|
|
|
a.update_by,
|
|
|
a.update_time
|
|
|
FROM event_usual a
|
|
|
- LEFT JOIN event_type b ON a.event_type = b.id
|
|
|
+ LEFT JOIN event_type b ON a.event_type = b.id
|
|
|
</sql>
|
|
|
|
|
|
<sql id="selectEventListWhere">
|
|
|
<if test="eventId!= null and eventId!= ''">
|
|
|
- and a.event_id = #{eventId}
|
|
|
+ AND a.event_id = #{eventId}
|
|
|
</if>
|
|
|
<if test="eventType!= null and eventType!= ''">
|
|
|
- and a.event_type = #{eventType}
|
|
|
+ AND a.event_type = #{eventType}
|
|
|
</if>
|
|
|
<if test="eventName!= null and eventName!= ''">
|
|
|
- and a.event_name LIKE CONCAT('%', #{eventName}, '%')
|
|
|
+ AND a.event_name LIKE CONCAT('%', #{eventName}, '%')
|
|
|
</if>
|
|
|
<if test="reportTimeStart != null and reportTimeEnd != null">
|
|
|
- and a.report_time between
|
|
|
+ AND a.report_time BETWEEN
|
|
|
concat(#{reportTimeStart}, ' 00:00:00')
|
|
|
- and
|
|
|
+ AND
|
|
|
concat(#{reportTimeEnd}, ' 23:59:59')
|
|
|
</if>
|
|
|
<if test="reportSource!= null and reportSource!= ''">
|
|
|
- and a.report_source = #{reportSource}
|
|
|
+ AND a.report_source = #{reportSource}
|
|
|
</if>
|
|
|
<if test="eventStatus!= null and eventStatus!= ''">
|
|
|
- and a.event_status = #{eventStatus}
|
|
|
+ AND a.event_status = #{eventStatus}
|
|
|
</if>
|
|
|
</sql>
|
|
|
<!-- *************************************** sql块 结束*********************************************** -->
|
|
|
|
|
|
<!-- **************************************** 业务块 开始 *********************************************** -->
|
|
|
<insert id="insertEventInfo" parameterType="EventInfo">
|
|
|
- insert into ${tableName}
|
|
|
+ INSERT INTO ${tableName}
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="eventId != null">event_id,</if>
|
|
|
<if test="eventType != null">event_type,</if>
|
|
@@ -351,19 +351,19 @@
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
- <select id="selectUnConfirmedList" parameterType="EventInfo" resultMap="EventInfoResult">
|
|
|
+ <select id="selectUnConfirmedList" parameterType="EventInfo" resultMap="EventInfoUnconfirmedResult">
|
|
|
<include refid="selectUnconfirmedEventInfoVo"/>
|
|
|
- LEFT JOIN event_dept ed on a.event_id = ed.event_id
|
|
|
- LEFT JOIN ${database_system}.sys_dept d on ed.dept_id = d.dept_id
|
|
|
+ LEFT JOIN event_dept ed ON a.event_id = ed.event_id
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON ed.dept_id = d.dept_id
|
|
|
<where>
|
|
|
<include refid="selectEventListWhere"/>
|
|
|
${params.dataScope}
|
|
|
</where>
|
|
|
- order by a.create_time desc
|
|
|
+ ORDER BY a.create_time DESC
|
|
|
</select>
|
|
|
|
|
|
- <select id="getUnconfirmedEventDetail" resultMap="EventDetailResult">
|
|
|
- SELECT * FROM event_unconfirmed
|
|
|
+ <select id="getUnconfirmedEventDetail" resultMap="EventDetailUnconfirmedResult">
|
|
|
+ SELECT * FROM event_unconfirmed a
|
|
|
<where>
|
|
|
<include refid="selectEventListWhere"/>
|
|
|
</where>
|
|
@@ -371,17 +371,17 @@
|
|
|
|
|
|
<select id="selectEventProcessList" parameterType="EventInfo" resultMap="EventInfoProcessResult">
|
|
|
<include refid="selectEventProcessInfoVo"/>
|
|
|
- LEFT JOIN event_dept ed on a.event_id = ed.event_id
|
|
|
- LEFT JOIN ${database_system}.sys_dept d on ed.dept_id = d.dept_id
|
|
|
+ LEFT JOIN event_dept ed ON a.event_id = ed.event_id
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON ed.dept_id = d.dept_id
|
|
|
<where>
|
|
|
<include refid="selectEventListWhere"/>
|
|
|
${params.dataScope}
|
|
|
</where>
|
|
|
- order by a.create_time desc
|
|
|
+ ORDER BY a.create_time DESC
|
|
|
</select>
|
|
|
|
|
|
<select id="getProcessEventDetail" resultMap="EventDetailProcessResult">
|
|
|
- SELECT * FROM event_process
|
|
|
+ SELECT * FROM event_process a
|
|
|
<where>
|
|
|
<include refid="selectEventListWhere"/>
|
|
|
</where>
|
|
@@ -389,17 +389,17 @@
|
|
|
|
|
|
<select id="selectUsualList" parameterType="EventInfo" resultMap="EventInfoProcessResult">
|
|
|
<include refid="selectUsualEventInfoVo"/>
|
|
|
- LEFT JOIN event_dept ed on a.event_id = ed.event_id
|
|
|
- LEFT JOIN ${database_system}.sys_dept d on ed.dept_id = d.dept_id
|
|
|
+ LEFT JOIN event_dept ed ON a.event_id = ed.event_id
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON ed.dept_id = d.dept_id
|
|
|
<where>
|
|
|
<include refid="selectEventListWhere"/>
|
|
|
${params.dataScope}
|
|
|
</where>
|
|
|
- order by a.create_time desc
|
|
|
+ ORDER BY a.create_time DESC
|
|
|
</select>
|
|
|
|
|
|
<select id="getUsualEventDetail" resultMap="EventDetailProcessResult">
|
|
|
- SELECT * FROM event_usual
|
|
|
+ SELECT * FROM event_usual a
|
|
|
<where>
|
|
|
<include refid="selectEventListWhere"/>
|
|
|
</where>
|
|
@@ -407,7 +407,7 @@
|
|
|
|
|
|
|
|
|
<insert id="insertEventProcess" parameterType="EventInfo">
|
|
|
- insert into event_process
|
|
|
+ INSERT INTO event_process
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="eventId != null">event_id,</if>
|
|
|
<if test="eventType != null">event_type,</if>
|
|
@@ -449,7 +449,7 @@
|
|
|
</insert>
|
|
|
|
|
|
<insert id="insertEventUsual" parameterType="EventInfo">
|
|
|
- insert into event_usual
|
|
|
+ INSERT INTO event_usual
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="eventId != null">event_id,</if>
|
|
|
<if test="eventType != null">event_type,</if>
|
|
@@ -497,7 +497,7 @@
|
|
|
</delete>
|
|
|
|
|
|
<update id="updateEventProcess" parameterType="EventInfo">
|
|
|
- update event_process
|
|
|
+ UPDATE event_process
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
<if test="eventType != null and eventType != ''">event_type = #{eventType},</if>
|
|
|
<if test="eventName != null and eventName != ''">event_name = #{eventName},</if>
|
|
@@ -512,7 +512,7 @@
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
</trim>
|
|
|
- where event_id = #{eventId}
|
|
|
+ WHERE event_id = #{eventId}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteEventProcess" parameterType="EventInfo">
|
|
@@ -520,8 +520,8 @@
|
|
|
WHERE event_id = #{eventId}
|
|
|
</delete>
|
|
|
|
|
|
- <select id="selectProcessAttachFromUnconfirmed" resultMap="EventInfoResult">
|
|
|
- select event_id from event_compensation
|
|
|
+ <select id="selectProcessAttachFromUnconfirmed" resultMap="EventInfoUnconfirmedResult">
|
|
|
+ SELECT event_id FROM event_compensation
|
|
|
</select>
|
|
|
<!-- **************************************** 业务块 结束 *********************************************** -->
|
|
|
|