|
|
@@ -4,186 +4,187 @@
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.xunmei.core.access.mapper.CoreMonitoringTaskRegistrationMonitorMapper">
|
|
|
|
|
|
- <resultMap type="com.xunmei.core.access.domain.CoreMonitoringTaskRegistrationMonitor" id="CoreMonitoringTaskRegistrationMonitorResult">
|
|
|
- <result property="id" column="id"/>
|
|
|
- <result property="taskRegistrationId" column="task_registration_id"/>
|
|
|
- <result property="host" column="host"/>
|
|
|
- <result property="videoChannel" column="video_channel"/>
|
|
|
- <result property="createTime" column="create_time"/>
|
|
|
- <result property="createBy" column="create_by"/>
|
|
|
- <result property="updateTime" column="update_time"/>
|
|
|
- <result property="updateBy" column="update_by"/>
|
|
|
- <result property="delFlag" column="del_flag"/>
|
|
|
+ <resultMap type="com.xunmei.core.access.domain.CoreMonitoringTaskRegistrationMonitor"
|
|
|
+ id="CoreMonitoringTaskRegistrationMonitorResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="taskRegistrationId" column="task_registration_id"/>
|
|
|
+ <result property="host" column="host"/>
|
|
|
+ <result property="videoChannel" column="video_channel"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectCoreMonitoringTaskRegistrationMonitorVo">
|
|
|
- select id, task_registration_id, host, video_channel, create_time, create_by, update_time, update_by, del_flag
|
|
|
+ select id,
|
|
|
+ task_registration_id,
|
|
|
+ host,
|
|
|
+ video_channel,
|
|
|
+ create_time,
|
|
|
+ create_by,
|
|
|
+ update_time,
|
|
|
+ update_by,
|
|
|
+ del_flag
|
|
|
from core_monitoring_task_registration_monitor
|
|
|
</sql>
|
|
|
|
|
|
- <select id="selectCoreMonitoringTaskRegistrationMonitorList" parameterType="com.xunmei.core.access.domain.CoreMonitoringTaskRegistrationMonitor"
|
|
|
+ <select id="selectCoreMonitoringTaskRegistrationMonitorList"
|
|
|
+ parameterType="com.xunmei.core.access.domain.CoreMonitoringTaskRegistrationMonitor"
|
|
|
resultMap="CoreMonitoringTaskRegistrationMonitorResult">
|
|
|
<include refid="selectCoreMonitoringTaskRegistrationMonitorVo"/>
|
|
|
<where>
|
|
|
- <if test="taskRegistrationId != null ">
|
|
|
- and task_registration_id = #{taskRegistrationId}
|
|
|
- </if>
|
|
|
- <if test="host != null ">
|
|
|
- and host = #{host}
|
|
|
- </if>
|
|
|
- <if test="videoChannel != null and videoChannel != ''">
|
|
|
- and video_channel = #{videoChannel}
|
|
|
- </if>
|
|
|
+ <if test="taskRegistrationId != null ">
|
|
|
+ and task_registration_id = #{taskRegistrationId}
|
|
|
+ </if>
|
|
|
+ <if test="host != null ">
|
|
|
+ and host = #{host}
|
|
|
+ </if>
|
|
|
+ <if test="videoChannel != null and videoChannel != ''">
|
|
|
+ and video_channel = #{videoChannel}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCoreMonitoringTaskRegistrationMonitorById" parameterType="String"
|
|
|
resultMap="CoreMonitoringTaskRegistrationMonitorResult">
|
|
|
- <include refid="selectCoreMonitoringTaskRegistrationMonitorVo"/>
|
|
|
- where id = #{id}
|
|
|
+ <include refid="selectCoreMonitoringTaskRegistrationMonitorVo"/>
|
|
|
+ where id = #{id}
|
|
|
</select>
|
|
|
<select id="selectTaskName" resultType="com.xunmei.core.access.vo.CoreMonitoringTaskRegistrationVO">
|
|
|
- SELECT
|
|
|
- cmrt.org_id as orgId,
|
|
|
- cmtr.id as id,
|
|
|
- cmrt.task_name as taskName,
|
|
|
- cmrt.status as taskStatus,
|
|
|
- cmtr.task_start_time as taskStartTime,
|
|
|
- cmrt.end_time AS taskEndTime
|
|
|
- FROM
|
|
|
- core_monitoring_retrieval_task cmrt
|
|
|
- LEFT JOIN core_monitoring_task_registration cmtr ON cmtr.task_id = cmrt.id
|
|
|
- WHERE
|
|
|
- cmtr.task_id =#{taskId}
|
|
|
+ SELECT cmrt.org_id as orgId,
|
|
|
+ cmtr.id as id,
|
|
|
+ cmrt.task_name as taskName,
|
|
|
+ cmrt.status as taskStatus,
|
|
|
+ cmtr.task_start_time as taskStartTime,
|
|
|
+ cmrt.end_time AS taskEndTime
|
|
|
+ FROM core_monitoring_retrieval_task cmrt
|
|
|
+ LEFT JOIN core_monitoring_task_registration cmtr ON cmtr.task_id = cmrt.id
|
|
|
+ WHERE cmtr.task_id = #{taskId}
|
|
|
</select>
|
|
|
<select id="selectMonitorByTaskRegistrationId"
|
|
|
resultType="com.xunmei.core.access.vo.CoreMonitoringTaskRegistrationMonitorVO">
|
|
|
- SELECT
|
|
|
- cmtrm.id AS id,
|
|
|
- cmtrm.`host` AS `host`,
|
|
|
- cmtrm.video_channel AS videoChannel,
|
|
|
- sd.device_name AS hostName,
|
|
|
- sd1.device_name AS videoChannelName
|
|
|
- FROM
|
|
|
- core_monitoring_task_registration_monitor cmtrm
|
|
|
- LEFT JOIN sys_device sd ON sd.id = cmtrm.video_channel
|
|
|
- LEFT JOIN sys_device sd1 ON sd1.id = sd.host_id
|
|
|
- WHERE
|
|
|
- cmtrm.task_registration_id =#{taskRegistrationId}
|
|
|
+ SELECT cmtrm.id AS id,
|
|
|
+ cmtrm.`host` AS `host`,
|
|
|
+ cmtrm.video_channel AS videoChannel,
|
|
|
+ sd.device_name AS hostName,
|
|
|
+ sd1.device_name AS videoChannelName
|
|
|
+ FROM core_monitoring_task_registration_monitor cmtrm
|
|
|
+ LEFT JOIN sys_device sd ON sd.id = cmtrm.video_channel
|
|
|
+ LEFT JOIN sys_device sd1 ON sd1.id = sd.host_id
|
|
|
+ WHERE cmtrm.task_registration_id = #{taskRegistrationId}
|
|
|
</select>
|
|
|
<select id="selectMonitorById"
|
|
|
resultType="com.xunmei.core.access.vo.CoreMonitoringTaskRegistrationMonitorVO">
|
|
|
- SELECT
|
|
|
- cmtrm.id AS id,
|
|
|
- cmtrm.`host` AS `host`,
|
|
|
- cmtrm.video_channel AS videoChannel,
|
|
|
- sd.device_name AS hostName,
|
|
|
- sd1.device_name AS videoChannelName
|
|
|
- FROM
|
|
|
- core_monitoring_task_registration_monitor cmtrm
|
|
|
- LEFT JOIN sys_device sd ON sd.id = cmtrm.`host`
|
|
|
- LEFT JOIN sys_device sd1 ON sd1.host_id = sd.id
|
|
|
- WHERE
|
|
|
- cmtrm.id = #{id}
|
|
|
+ SELECT cmtrm.id AS id,
|
|
|
+ cmtrm.`host` AS `host`,
|
|
|
+ cmtrm.video_channel AS videoChannel,
|
|
|
+ sd.device_name AS hostName,
|
|
|
+ sd1.device_name AS videoChannelName
|
|
|
+ FROM core_monitoring_task_registration_monitor cmtrm
|
|
|
+ LEFT JOIN sys_device sd ON sd.id = cmtrm.`host`
|
|
|
+ LEFT JOIN sys_device sd1 ON sd1.host_id = sd.id
|
|
|
+ WHERE cmtrm.id = #{id}
|
|
|
</select>
|
|
|
<select id="selectMonitorByInfo"
|
|
|
resultType="com.xunmei.core.access.vo.CoreMonitoringTaskRegistrationMonitorVO">
|
|
|
- SELECT
|
|
|
- b.id AS id,
|
|
|
- b.`host` AS `host`,
|
|
|
- b.video_channel AS videoChannel,
|
|
|
- sd.device_name AS hostName,
|
|
|
- sd1.device_name AS videoChannelName
|
|
|
- FROM
|
|
|
- core_monitoring_task_registration a
|
|
|
- LEFT JOIN core_monitoring_task_registration_monitor b ON a.id = b.task_registration_id
|
|
|
- LEFT JOIN sys_device sd ON sd.id = b.`host`
|
|
|
- LEFT JOIN sys_device sd1 ON sd1.host_id = sd.id
|
|
|
- WHERE
|
|
|
- a.task_id = #{taskId}
|
|
|
+ SELECT b.id AS id,
|
|
|
+ b.`host` AS `host`,
|
|
|
+ b.video_channel AS videoChannel,
|
|
|
+ sd.device_name AS hostName,
|
|
|
+ CONCAT('通道',sd1.channel ) AS videoChannelName
|
|
|
+ FROM core_monitoring_task_registration a
|
|
|
+ LEFT JOIN core_monitoring_task_registration_monitor b ON a.id = b.task_registration_id
|
|
|
+ LEFT JOIN sys_device sd ON sd.id = b.`host`
|
|
|
+ LEFT JOIN sys_device sd1 ON sd1.host_id = sd.id
|
|
|
+ WHERE a.task_id = #{taskId}
|
|
|
AND b.`host` = #{host}
|
|
|
- AND b.video_channel =#{videoChannel}
|
|
|
- AND sd1.id=#{videoChannel}
|
|
|
+ AND b.video_channel = #{videoChannel}
|
|
|
+ AND sd1.id = #{videoChannel}
|
|
|
</select>
|
|
|
|
|
|
- <insert id="insertCoreMonitoringTaskRegistrationMonitor" parameterType="com.xunmei.core.access.domain.CoreMonitoringTaskRegistrationMonitor">
|
|
|
+ <insert id="insertCoreMonitoringTaskRegistrationMonitor"
|
|
|
+ parameterType="com.xunmei.core.access.domain.CoreMonitoringTaskRegistrationMonitor">
|
|
|
insert into core_monitoring_task_registration_monitor
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">id,
|
|
|
- </if>
|
|
|
- <if test="taskRegistrationId != null">task_registration_id,
|
|
|
- </if>
|
|
|
- <if test="host != null">host,
|
|
|
- </if>
|
|
|
- <if test="videoChannel != null">video_channel,
|
|
|
- </if>
|
|
|
- <if test="createTime != null">create_time,
|
|
|
- </if>
|
|
|
- <if test="createBy != null">create_by,
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">update_time,
|
|
|
- </if>
|
|
|
- <if test="updateBy != null">update_by,
|
|
|
- </if>
|
|
|
- <if test="delFlag != null">del_flag,
|
|
|
- </if>
|
|
|
+ <if test="id != null">id,
|
|
|
+ </if>
|
|
|
+ <if test="taskRegistrationId != null">task_registration_id,
|
|
|
+ </if>
|
|
|
+ <if test="host != null">host,
|
|
|
+ </if>
|
|
|
+ <if test="videoChannel != null">video_channel,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">create_time,
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">create_by,
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">update_time,
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">update_by,
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null">del_flag,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">#{id},
|
|
|
- </if>
|
|
|
- <if test="taskRegistrationId != null">#{taskRegistrationId},
|
|
|
- </if>
|
|
|
- <if test="host != null">#{host},
|
|
|
- </if>
|
|
|
- <if test="videoChannel != null">#{videoChannel},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">#{createTime},
|
|
|
- </if>
|
|
|
- <if test="createBy != null">#{createBy},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">#{updateTime},
|
|
|
- </if>
|
|
|
- <if test="updateBy != null">#{updateBy},
|
|
|
- </if>
|
|
|
- <if test="delFlag != null">#{delFlag},
|
|
|
- </if>
|
|
|
+ <if test="id != null">#{id},
|
|
|
+ </if>
|
|
|
+ <if test="taskRegistrationId != null">#{taskRegistrationId},
|
|
|
+ </if>
|
|
|
+ <if test="host != null">#{host},
|
|
|
+ </if>
|
|
|
+ <if test="videoChannel != null">#{videoChannel},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">#{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">#{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">#{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">#{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null">#{delFlag},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
- <update id="updateCoreMonitoringTaskRegistrationMonitor" parameterType="com.xunmei.core.access.domain.CoreMonitoringTaskRegistrationMonitor">
|
|
|
+ <update id="updateCoreMonitoringTaskRegistrationMonitor"
|
|
|
+ parameterType="com.xunmei.core.access.domain.CoreMonitoringTaskRegistrationMonitor">
|
|
|
update core_monitoring_task_registration_monitor
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="taskRegistrationId != null">task_registration_id =
|
|
|
- #{taskRegistrationId},
|
|
|
- </if>
|
|
|
- <if test="host != null">host =
|
|
|
- #{host},
|
|
|
- </if>
|
|
|
- <if test="videoChannel != null">video_channel =
|
|
|
- #{videoChannel},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">create_time =
|
|
|
- #{createTime},
|
|
|
- </if>
|
|
|
- <if test="createBy != null">create_by =
|
|
|
- #{createBy},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">update_time =
|
|
|
- #{updateTime},
|
|
|
- </if>
|
|
|
- <if test="updateBy != null">update_by =
|
|
|
- #{updateBy},
|
|
|
- </if>
|
|
|
- <if test="delFlag != null">del_flag =
|
|
|
- #{delFlag},
|
|
|
- </if>
|
|
|
+ <if test="taskRegistrationId != null">task_registration_id =
|
|
|
+ #{taskRegistrationId},
|
|
|
+ </if>
|
|
|
+ <if test="host != null">host =
|
|
|
+ #{host},
|
|
|
+ </if>
|
|
|
+ <if test="videoChannel != null">video_channel =
|
|
|
+ #{videoChannel},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">create_time =
|
|
|
+ #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">create_by =
|
|
|
+ #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">update_time =
|
|
|
+ #{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">update_by =
|
|
|
+ #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null">del_flag =
|
|
|
+ #{delFlag},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteCoreMonitoringTaskRegistrationMonitorById" parameterType="String">
|
|
|
delete
|
|
|
- from core_monitoring_task_registration_monitor where id = #{id}
|
|
|
+ from core_monitoring_task_registration_monitor
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteCoreMonitoringTaskRegistrationMonitorByIds" parameterType="String">
|