zhangjian
2023-05-29 9763c7a6ed43a60c099d49cc149c86652fbb3cfa
ard-work/src/main/resources/mapper/device/ArdCamerasMapper.xml
@@ -33,8 +33,30 @@
    </resultMap>
    <sql id="selectArdCamerasVo">
        select c.id, c.name, c.ip, c.port,c.rtsp_port, c.username, c.password, c.gdtype, c.channel, c.longitude, c.latitude, c.altitude, c.user_id, c.dept_id,
        c.cam_heading, c.cam_pitch, c.cam_roll, c.cam_near, c.cam_far, c.cam_aspectratio, c.cam_depth, c.cam_fov,c.operator_id,c.operator_expired
        select c.id,
               c.name,
               c.ip,
               c.port,
               c.rtsp_port,
               c.username,
               c.password,
               c.gdtype,
               c.channel,
               c.longitude,
               c.latitude,
               c.altitude,
               c.user_id,
               c.dept_id,
               c.cam_heading,
               c.cam_pitch,
               c.cam_roll,
               c.cam_near,
               c.cam_far,
               c.cam_aspectratio,
               c.cam_depth,
               c.cam_fov,
               c.operator_id,
               c.operator_expired
        from ard_cameras c
        left join sys_dept d on d.dept_id=c.dept_id
        left join sys_user u on u.user_id=c.user_id
@@ -56,7 +78,9 @@
            <if test="latitude != null "> and c.latitude = #{latitude}</if>
            <if test="altitude != null "> and c.altitude = #{altitude}</if>
            <if test="userId != null  and userId != ''"> and c.user_id = #{userId}</if>
            <if test="deptId != null ">  and (c.dept_id = #{deptId} OR c.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE cast(#{deptId} as varchar) = any(string_to_array(ancestors,',')) ))</if>
            <if test="deptId != null ">and (c.dept_id = #{deptId} OR c.dept_id IN ( SELECT t.dept_id FROM sys_dept t
                WHERE cast(#{deptId} as varchar) = any(string_to_array(ancestors,',')) ))
            </if>
            <if test="camHeading != null "> and c.cam_heading = #{camHeading}</if>
            <if test="camPitch != null "> and c.cam_pitch = #{camPitch}</if>
            <if test="camRoll != null "> and c.cam_roll = #{camRoll}</if>
@@ -86,7 +110,9 @@
            <if test="latitude != null "> and c.latitude = #{latitude}</if>
            <if test="altitude != null "> and c.altitude = #{altitude}</if>
            <if test="userId != null  and userId != ''"> and c.user_id = #{userId}</if>
            <if test="deptId != null ">  and (c.dept_id = #{deptId} OR c.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE cast(#{deptId} as varchar) = any(string_to_array(ancestors,',')) ))</if>
            <if test="deptId != null ">and (c.dept_id = #{deptId} OR c.dept_id IN ( SELECT t.dept_id FROM sys_dept t
                WHERE cast(#{deptId} as varchar) = any(string_to_array(ancestors,',')) ))
            </if>
            <if test="camHeading != null "> and c.cam_heading = #{camHeading}</if>
            <if test="camPitch != null "> and c.cam_pitch = #{camPitch}</if>
            <if test="camRoll != null "> and c.cam_roll = #{camRoll}</if>
@@ -201,7 +227,9 @@
    </update>
    <delete id="deleteArdCamerasById" parameterType="String">
        delete from ard_cameras where id = #{id}
        delete
        from ard_cameras
        where id = #{id}
    </delete>
    <delete id="deleteArdCamerasByIds" parameterType="String">
@@ -210,4 +238,13 @@
            #{id}
        </foreach>
    </delete>
    <select id="findOptions" parameterType="String" resultMap="ArdCamerasResult">
        <include refid="selectArdCamerasVo"/>
        <where>
            <if test="id != null  and id != ''">and c.id = #{id}</if>
            <if test="name != null  and name != ''">and c.name like '%'||#{name}||'%'</if>
        </where>
    </select>
</mapper>