YZProjectCloud/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProVideoMonitorMapper.xml

143 lines
7.9 KiB
XML
Raw Normal View History

2024-12-28 09:52:23 +08:00
<?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.ProVideoMonitorMapper">
<resultMap type="ProVideoMonitor" id="ProVideoMonitorResult">
<result property="id" column="id" />
<result property="comId" column="com_id" />
<result property="projectId" column="project_id" />
<result property="monitorName" column="monitor_name" />
<result property="monitorType" column="monitor_type" />
<result property="url" column="url" />
<result property="appkey" column="appkey" />
<result property="secret" column="secret" />
<result property="manufacturer" column="manufacturer" />
<result property="keyPoint" column="key_point" />
<result property="remark" column="remark" />
<result property="state" column="state" />
<result property="isDel" column="is_del" />
2025-12-26 17:55:14 +08:00
<result property="workAreaId" column="work_area_id" />
2024-12-28 09:52:23 +08:00
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="upadteTime" column="upadte_time" />
<result property="compName" column="comp_name"/>
<result property="projectName" column="project_name"/>
2025-12-26 17:55:14 +08:00
<result property="workAreaName" column="work_area_name"/>
<result property="workAreaAncestors" column="work_area_ancestors"/>
2024-12-28 09:52:23 +08:00
</resultMap>
<sql id="selectProVideoMonitorVo">
select pv.id, pv.com_id, pv.project_id, pv.monitor_name, pv.monitor_type, pv.url, pv.appkey, pv.secret,
2025-12-26 17:55:14 +08:00
pv.manufacturer, pv.key_point, pv.remark, pv.state, pv.is_del, pv.work_area_id, pv.create_by, pv.create_time,
pv.update_by, pv.upadte_time,dp.`dept_name` comp_name,pi.`project_name`, wa.`title` work_area_name, wa.ancestors work_area_ancestors
2024-12-28 09:52:23 +08:00
from pro_video_monitor pv
LEFT JOIN sys_dept dp ON pv.com_id=dp.dept_id
LEFT JOIN pro_project_info pi ON pv.project_id=pi.id
2025-12-26 17:55:14 +08:00
LEFT JOIN sys_work_area wa ON pv.work_area_id=wa.id
2024-12-28 09:52:23 +08:00
</sql>
<select id="selectProVideoMonitorList" parameterType="ProVideoMonitor" resultMap="ProVideoMonitorResult">
<include refid="selectProVideoMonitorVo"/>
<where>
<if test="comId != null "> and pv.com_id = #{comId}</if>
<if test="projectId != null "> and pv.project_id = #{projectId}</if>
2025-12-26 17:55:14 +08:00
<if test="workAreaId != null "> and pv.work_area_id = #{workAreaId} </if>
<if test="workAreaAncestors != null "> and (pv.work_area_id = #{workAreaAncestors} or FIND_IN_SET(#{workAreaAncestors}, wa.ancestors) > 0)</if>
2024-12-28 09:52:23 +08:00
<if test="monitorName != null and monitorName != ''"> and pv.monitor_name like concat('%', #{monitorName}, '%')</if>
<if test="monitorType != null and monitorType != ''"> and pv.monitor_type = #{monitorType}</if>
<if test="url != null and url != ''"> and pv.url = #{url}</if>
<if test="appkey != null and appkey != ''"> and pv.appkey = #{appkey}</if>
<if test="secret != null and secret != ''"> and pv.secret = #{secret}</if>
<if test="manufacturer != null and manufacturer != ''"> and pv.manufacturer = #{manufacturer}</if>
<if test="keyPoint != null "> and pv.key_point = #{keyPoint}</if>
<if test="state != null "> and pv.state = #{state}</if>
<if test="isDel != null "> and pv.is_del = #{isDel}</if>
<if test="upadteTime != null "> and pv.upadte_time = #{upadteTime}</if>
</where>
</select>
<select id="selectProVideoMonitorById" parameterType="Long" resultMap="ProVideoMonitorResult">
<include refid="selectProVideoMonitorVo"/>
where pv.id = #{id}
</select>
<insert id="insertProVideoMonitor" parameterType="ProVideoMonitor" useGeneratedKeys="true" keyProperty="id">
insert into pro_video_monitor
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="comId != null">com_id,</if>
<if test="projectId != null">project_id,</if>
<if test="monitorName != null">monitor_name,</if>
<if test="monitorType != null">monitor_type,</if>
<if test="url != null">url,</if>
<if test="appkey != null">appkey,</if>
<if test="secret != null">secret,</if>
<if test="manufacturer != null">manufacturer,</if>
<if test="keyPoint != null">key_point,</if>
<if test="remark != null">remark,</if>
<if test="state != null">state,</if>
<if test="isDel != null">is_del,</if>
2025-12-26 17:55:14 +08:00
<if test="workAreaId != null">work_area_id,</if>
2024-12-28 09:52:23 +08:00
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="upadteTime != null">upadte_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="comId != null">#{comId},</if>
<if test="projectId != null">#{projectId},</if>
<if test="monitorName != null">#{monitorName},</if>
<if test="monitorType != null">#{monitorType},</if>
<if test="url != null">#{url},</if>
<if test="appkey != null">#{appkey},</if>
<if test="secret != null">#{secret},</if>
<if test="manufacturer != null">#{manufacturer},</if>
<if test="keyPoint != null">#{keyPoint},</if>
<if test="remark != null">#{remark},</if>
<if test="state != null">#{state},</if>
<if test="isDel != null">#{isDel},</if>
2025-12-26 17:55:14 +08:00
<if test="workAreaId != null">#{workAreaId},</if>
2024-12-28 09:52:23 +08:00
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="upadteTime != null">#{upadteTime},</if>
</trim>
</insert>
<update id="updateProVideoMonitor" parameterType="ProVideoMonitor">
update pro_video_monitor
<trim prefix="SET" suffixOverrides=",">
<if test="comId != null">com_id = #{comId},</if>
<if test="projectId != null">project_id = #{projectId},</if>
<if test="monitorName != null">monitor_name = #{monitorName},</if>
<if test="monitorType != null">monitor_type = #{monitorType},</if>
<if test="url != null">url = #{url},</if>
<if test="appkey != null">appkey = #{appkey},</if>
<if test="secret != null">secret = #{secret},</if>
<if test="manufacturer != null">manufacturer = #{manufacturer},</if>
<if test="keyPoint != null">key_point = #{keyPoint},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="state != null">state = #{state},</if>
<if test="isDel != null">is_del = #{isDel},</if>
2025-12-26 17:55:14 +08:00
<if test="workAreaId != null">work_area_id = #{workAreaId},</if>
2024-12-28 09:52:23 +08:00
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="upadteTime != null">upadte_time = #{upadteTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteProVideoMonitorById" parameterType="Long">
delete from pro_video_monitor where id = #{id}
</delete>
<delete id="deleteProVideoMonitorByIds" parameterType="String">
delete from pro_video_monitor where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>