167 lines
9.9 KiB
XML
167 lines
9.9 KiB
XML
|
|
<?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.yanzhu.manage.mapper.DevAiProjectDataMapper">
|
||
|
|
|
||
|
|
<resultMap type="DevAiProjectData" id="DevAiProjectDataResult">
|
||
|
|
<result property="id" column="id" />
|
||
|
|
<result property="comId" column="com_id" />
|
||
|
|
<result property="comName" column="com_name" />
|
||
|
|
<result property="projectId" column="project_id" />
|
||
|
|
<result property="projectName" column="project_name" />
|
||
|
|
<result property="deviceId" column="device_id" />
|
||
|
|
<result property="deviceName" column="device_name" />
|
||
|
|
<result property="serialNumber" column="serial_number" />
|
||
|
|
<result property="ipcSerialNum" column="IPC_serial_num" />
|
||
|
|
<result property="imageUrl" column="image_url" />
|
||
|
|
<result property="channelId" column="channel_id" />
|
||
|
|
<result property="channelName" column="channel_name" />
|
||
|
|
<result property="alarmType" column="alarm_type" />
|
||
|
|
<result property="alarmId" column="alarm_id" />
|
||
|
|
<result property="leftTopX" column="left_top_x" />
|
||
|
|
<result property="leftTopY" column="left_top_y" />
|
||
|
|
<result property="rightBtmX" column="right_btm_x" />
|
||
|
|
<result property="rightBtmY" column="right_btm_y" />
|
||
|
|
<result property="personNum" column="person_num" />
|
||
|
|
<result property="inNum" column="in_num" />
|
||
|
|
<result property="outNum" column="out_num" />
|
||
|
|
<result property="plateNo" column="plate_no" />
|
||
|
|
<result property="valueType" column="value_type" />
|
||
|
|
<result property="alarmVideourl" column="alarm_videoURL" />
|
||
|
|
<result property="alarmVideoName" column="alarm_video_name" />
|
||
|
|
<result property="compareResult" column="compare_result" />
|
||
|
|
<result property="createTime" column="create_time" />
|
||
|
|
<result property="isDel" column="is_del" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectDevAiProjectDataVo">
|
||
|
|
select dapd.id, dapd.com_id, sd.dept_name as com_name, dapd.project_id, pi.project_name, dapd.device_id, dapd.device_name, dapd.serial_number, dapd.IPC_serial_num, dapd.image_url, dapd.channel_id, dapd.channel_name, dapd.alarm_type, dapd.alarm_id, dapd.left_top_x, dapd.left_top_y, dapd.right_btm_x, dapd.right_btm_y, dapd.person_num, dapd.in_num, dapd.out_num, dapd.plate_no, dapd.value_type, dapd.alarm_videoURL, dapd.alarm_video_name, dapd.compare_result, dapd.create_time, dapd.is_del from dev_ai_project_data dapd
|
||
|
|
left join pro_project_info pi on pi.id = dapd.project_id
|
||
|
|
left join sys_dept sd on sd.dept_id = dapd.com_id
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectDevAiProjectDataList" parameterType="DevAiProjectData" resultMap="DevAiProjectDataResult">
|
||
|
|
<include refid="selectDevAiProjectDataVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="comId != null "> and dapd.com_id = #{comId}</if>
|
||
|
|
<if test="projectId != null "> and dapd.project_id = #{projectId}</if>
|
||
|
|
<if test="activeComId != null "> and dapd.com_id = #{activeComId}</if>
|
||
|
|
<if test="activeProjectId != null "> and dapd.project_id = #{activeProjectId}</if>
|
||
|
|
<if test="deviceId != null "> and dapd.device_id = #{deviceId}</if>
|
||
|
|
<if test="deviceName != null and deviceName != ''"> and (dapd.device_name like concat('%', #{deviceName}, '%') or dapd.serial_number like concat('%', #{deviceName}, '%'))</if>
|
||
|
|
<if test="channelName != null and channelName != ''"> and dapd.channel_name like concat('%', #{channelName}, '%')</if>
|
||
|
|
<if test="alarmType != null "> and dapd.alarm_type = #{alarmType}</if>
|
||
|
|
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and dapd.create_time between #{params.beginTime} and #{params.endTime}</if>
|
||
|
|
<if test="isDel != null and isDel != ''"> and dapd.is_del = #{isDel}</if>
|
||
|
|
and dapd.is_del != 2
|
||
|
|
</where>
|
||
|
|
order by dapd.id desc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectDevAiProjectDataById" parameterType="Long" resultMap="DevAiProjectDataResult">
|
||
|
|
<include refid="selectDevAiProjectDataVo"/>
|
||
|
|
where dapd.id = #{id}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertDevAiProjectData" parameterType="DevAiProjectData" useGeneratedKeys="true" keyProperty="id">
|
||
|
|
insert into dev_ai_project_data
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="comId != null">com_id,</if>
|
||
|
|
<if test="projectId != null">project_id,</if>
|
||
|
|
<if test="deviceId != null">device_id,</if>
|
||
|
|
<if test="deviceName != null">device_name,</if>
|
||
|
|
<if test="serialNumber != null">serial_number,</if>
|
||
|
|
<if test="ipcSerialNum != null">IPC_serial_num,</if>
|
||
|
|
<if test="imageUrl != null">image_url,</if>
|
||
|
|
<if test="channelId != null">channel_id,</if>
|
||
|
|
<if test="channelName != null">channel_name,</if>
|
||
|
|
<if test="alarmType != null">alarm_type,</if>
|
||
|
|
<if test="alarmId != null">alarm_id,</if>
|
||
|
|
<if test="leftTopX != null">left_top_x,</if>
|
||
|
|
<if test="leftTopY != null">left_top_y,</if>
|
||
|
|
<if test="rightBtmX != null">right_btm_x,</if>
|
||
|
|
<if test="rightBtmY != null">right_btm_y,</if>
|
||
|
|
<if test="personNum != null">person_num,</if>
|
||
|
|
<if test="inNum != null">in_num,</if>
|
||
|
|
<if test="outNum != null">out_num,</if>
|
||
|
|
<if test="plateNo != null">plate_no,</if>
|
||
|
|
<if test="valueType != null">value_type,</if>
|
||
|
|
<if test="alarmVideourl != null">alarm_videoURL,</if>
|
||
|
|
<if test="alarmVideoName != null">alarm_video_name,</if>
|
||
|
|
<if test="compareResult != null">compare_result,</if>
|
||
|
|
<if test="createTime != null">create_time,</if>
|
||
|
|
<if test="isDel != null">is_del,</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="comId != null">#{comId},</if>
|
||
|
|
<if test="projectId != null">#{projectId},</if>
|
||
|
|
<if test="deviceId != null">#{deviceId},</if>
|
||
|
|
<if test="deviceName != null">#{deviceName},</if>
|
||
|
|
<if test="serialNumber != null">#{serialNumber},</if>
|
||
|
|
<if test="ipcSerialNum != null">#{ipcSerialNum},</if>
|
||
|
|
<if test="imageUrl != null">#{imageUrl},</if>
|
||
|
|
<if test="channelId != null">#{channelId},</if>
|
||
|
|
<if test="channelName != null">#{channelName},</if>
|
||
|
|
<if test="alarmType != null">#{alarmType},</if>
|
||
|
|
<if test="alarmId != null">#{alarmId},</if>
|
||
|
|
<if test="leftTopX != null">#{leftTopX},</if>
|
||
|
|
<if test="leftTopY != null">#{leftTopY},</if>
|
||
|
|
<if test="rightBtmX != null">#{rightBtmX},</if>
|
||
|
|
<if test="rightBtmY != null">#{rightBtmY},</if>
|
||
|
|
<if test="personNum != null">#{personNum},</if>
|
||
|
|
<if test="inNum != null">#{inNum},</if>
|
||
|
|
<if test="outNum != null">#{outNum},</if>
|
||
|
|
<if test="plateNo != null">#{plateNo},</if>
|
||
|
|
<if test="valueType != null">#{valueType},</if>
|
||
|
|
<if test="alarmVideourl != null">#{alarmVideourl},</if>
|
||
|
|
<if test="alarmVideoName != null">#{alarmVideoName},</if>
|
||
|
|
<if test="compareResult != null">#{compareResult},</if>
|
||
|
|
<if test="createTime != null">#{createTime},</if>
|
||
|
|
<if test="isDel != null">#{isDel},</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateDevAiProjectData" parameterType="DevAiProjectData">
|
||
|
|
update dev_ai_project_data
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="comId != null">com_id = #{comId},</if>
|
||
|
|
<if test="projectId != null">project_id = #{projectId},</if>
|
||
|
|
<if test="deviceId != null">device_id = #{deviceId},</if>
|
||
|
|
<if test="deviceName != null">device_name = #{deviceName},</if>
|
||
|
|
<if test="serialNumber != null">serial_number = #{serialNumber},</if>
|
||
|
|
<if test="ipcSerialNum != null">IPC_serial_num = #{ipcSerialNum},</if>
|
||
|
|
<if test="imageUrl != null">image_url = #{imageUrl},</if>
|
||
|
|
<if test="channelId != null">channel_id = #{channelId},</if>
|
||
|
|
<if test="channelName != null">channel_name = #{channelName},</if>
|
||
|
|
<if test="alarmType != null">alarm_type = #{alarmType},</if>
|
||
|
|
<if test="alarmId != null">alarm_id = #{alarmId},</if>
|
||
|
|
<if test="leftTopX != null">left_top_x = #{leftTopX},</if>
|
||
|
|
<if test="leftTopY != null">left_top_y = #{leftTopY},</if>
|
||
|
|
<if test="rightBtmX != null">right_btm_x = #{rightBtmX},</if>
|
||
|
|
<if test="rightBtmY != null">right_btm_y = #{rightBtmY},</if>
|
||
|
|
<if test="personNum != null">person_num = #{personNum},</if>
|
||
|
|
<if test="inNum != null">in_num = #{inNum},</if>
|
||
|
|
<if test="outNum != null">out_num = #{outNum},</if>
|
||
|
|
<if test="plateNo != null">plate_no = #{plateNo},</if>
|
||
|
|
<if test="valueType != null">value_type = #{valueType},</if>
|
||
|
|
<if test="alarmVideourl != null">alarm_videoURL = #{alarmVideourl},</if>
|
||
|
|
<if test="alarmVideoName != null">alarm_video_name = #{alarmVideoName},</if>
|
||
|
|
<if test="compareResult != null">compare_result = #{compareResult},</if>
|
||
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||
|
|
<if test="isDel != null">is_del = #{isDel},</if>
|
||
|
|
</trim>
|
||
|
|
where id = #{id}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<update id="deleteDevAiProjectDataById" parameterType="Long">
|
||
|
|
update dev_ai_project_data set is_del = 2 where id = #{id}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<update id="deleteDevAiProjectDataByIds" parameterType="String">
|
||
|
|
update dev_ai_project_data set is_del = 2 where id in
|
||
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
|
#{id}
|
||
|
|
</foreach>
|
||
|
|
</update>
|
||
|
|
</mapper>
|