|
@@ -0,0 +1,93 @@
|
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
+<!DOCTYPE mapper
|
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
+<mapper namespace="com.sooka.sponest.event.download.mapper.CentereventTDownloadsMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="CentereventTDownloads" id="CentereventTDownloadsResult">
|
|
|
|
+ <result property="id" column="id"/>
|
|
|
|
+ <result property="eventCode" column="event_code"/>
|
|
|
|
+ <result property="eventName" column="event_name"/>
|
|
|
|
+ <result property="path" column="path"/>
|
|
|
|
+ <result property="flag" column="flag"/>
|
|
|
|
+ <result property="reason" column="reason"/>
|
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
|
+ <result property="createName" column="create_name"/>
|
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
|
+ <result property="updateName" column="update_name"/>
|
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
|
+ <result property="attachPath" column="attachPath"/>
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <select id="getbeforedateDownload" parameterType="map" resultMap="PlayBackPropertiesResult">
|
|
|
|
+ SELECT l.event_code eventCode, a.event_name eventName, l.id logId, a.create_by cameraId, DATE_SUB(a.report_time,
|
|
|
|
+ INTERVAL 2 MINUTE) startTime, DATE_ADD(a.report_time, INTERVAL 1 MINUTE) endTime
|
|
|
|
+ FROM centerevent_t_fire_log l
|
|
|
|
+ LEFT JOIN centerevent_t_eventcatalogue a ON a.event_code = l.event_code
|
|
|
|
+ <where>
|
|
|
|
+ <if test="id != null and id != ''">
|
|
|
|
+ AND a.id = #{id}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="taskValue != null and taskValue != ''">
|
|
|
|
+ AND DATEDIFF( l.create_time, now( ) ) = -1
|
|
|
|
+ </if>
|
|
|
|
+ <if test="monthValueStart != null and monthValueStart != ''">
|
|
|
|
+ AND DATE_FORMAT(l.create_time,'%Y-%m-%d') = #{monthValueStart}
|
|
|
|
+ </if>
|
|
|
|
+ AND l.log_content LIKE '%确认该事件%' AND l.event_code NOT IN (
|
|
|
|
+ SELECT event_code FROM centerevent_t_downloads
|
|
|
|
+ <where>
|
|
|
|
+ flag IN ( 200, 202 )
|
|
|
|
+ <if test="id != null and id != ''">
|
|
|
|
+ AND event_code = #{id}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="taskValue != null and taskValue != ''">
|
|
|
|
+ AND DATEDIFF( create_time, now( ) ) = 0
|
|
|
|
+ </if>
|
|
|
|
+ <if test="monthValueStart != null and monthValueStart != ''">
|
|
|
|
+ AND DATE_FORMAT(create_time,'%Y-%m-%d') >= #{monthValueStart}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="monthValueEnd != null and monthValueEnd != ''">
|
|
|
|
+ AND DATE_FORMAT(create_time,'%Y-%m-%d') <= #{monthValueEnd}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ ) AND report_source = 'reporting_source_1'
|
|
|
|
+ AND a.event_status_value NOT IN ( 'forest_event_status_3', 'forest_event_status_4' )
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insertCentereventTDownloads" parameterType="CentereventTDownloads">
|
|
|
|
+ insert into centerevent_t_downloads
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null">id,</if>
|
|
|
|
+ <if test="eventCode != null">event_code,</if>
|
|
|
|
+ <if test="eventName != null">event_name,</if>
|
|
|
|
+ <if test="path != null">path,</if>
|
|
|
|
+ <if test="flag != null">flag,</if>
|
|
|
|
+ <if test="reason != null">reason,</if>
|
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
|
+ <if test="createName != null">create_name,</if>
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
|
+ <if test="updateName != null">update_name,</if>
|
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
|
+ <if test="logId != null">log_id,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
|
+ <if test="eventCode != null">#{eventCode},</if>
|
|
|
|
+ <if test="eventName != null">#{eventName},</if>
|
|
|
|
+ <if test="path != null">#{path},</if>
|
|
|
|
+ <if test="flag != null">#{flag},</if>
|
|
|
|
+ <if test="reason != null">#{reason},</if>
|
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
|
+ <if test="createName != null">#{createName},</if>
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
|
+ <if test="updateName != null">#{updateName},</if>
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
+ <if test="logId != null">#{logId},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+</mapper>
|