<?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.ruoyi.device.camera.mapper.ArdCameraUserPostionMapper">
|
|
<resultMap type="ArdCameras" id="ArdCamerasResult">
|
<result property="id" column="id"/>
|
<result property="name" column="name"/>
|
<result property="ip" column="ip"/>
|
<result property="port" column="port"/>
|
<result property="rtspPort" column="rtsp_port"/>
|
<result property="username" column="username"/>
|
<result property="password" column="password"/>
|
<result property="gdtype" column="gdtype"/>
|
<result property="factory" column="factory"/>
|
<result property="chanNum" column="channel"/>
|
<result property="longitude" column="longitude"/>
|
<result property="latitude" column="latitude"/>
|
<result property="altitude" column="altitude"/>
|
<result property="userId" column="user_id"/>
|
<result property="deptId" column="dept_id"/>
|
<result property="camHeading" column="cam_heading"/>
|
<result property="camPitch" column="cam_pitch"/>
|
<result property="camRoll" column="cam_roll"/>
|
<result property="camNear" column="cam_near"/>
|
<result property="camFar" column="cam_far"/>
|
<result property="camAspectratio" column="cam_aspectratio"/>
|
<result property="camDepth" column="cam_depth"/>
|
<result property="camFov" column="cam_fov"/>
|
<result property="loginId" column="login_id"/>
|
<result property="operatorId" column="operator_id"/>
|
<result property="operatorExpired" column="operator_expired"/>
|
<result property="camMaxVisibleDistance" column="cam_max_visible_distance"/>
|
<result property="camAlarmGuideEnable" column="cam_alarm_guide_enable"/>
|
<result property="state" column="state"/>
|
<result property="towerId" column="tower_id"/>
|
<collection property="channelList" ofType="ArdChannel">
|
<result property="id" column="c_id"/>
|
<result property="name" column="c_name"/>
|
<result property="chanNo" column="c_chan_no"/>
|
<result property="deviceId" column="c_device_id"/>
|
</collection>
|
</resultMap>
|
<resultMap type="ArdCameraUserPostion" id="ArdCameraUserPostionResult">
|
<result property="id" column="id" />
|
<result property="cameraId" column="camera_id" />
|
<result property="chanNo" column="chan_no" />
|
<result property="userId" column="user_id" />
|
<result property="position" column="position" />
|
</resultMap>
|
|
<sql id="selectArdCameraUserPostionVo">
|
select id, camera_id, chan_no, user_id, position from ard_camera_user_postion
|
</sql>
|
<select id="selectArdCameraUserPostionList" parameterType="ArdCameraUserPostion" resultMap="ArdCameraUserPostionResult">
|
<include refid="selectArdCameraUserPostionVo"/>
|
<where>
|
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
|
<if test="position != null and position != ''"> and position = #{position}</if>
|
</where>
|
</select>
|
<select id="selectArdCameraUserPostionByPosition" parameterType="ArdCameraUserPostion" resultMap="ArdCamerasResult">
|
SELECT c.id,
|
c.name,
|
c.ip,
|
c.port,
|
c.rtsp_port,
|
c.username,
|
c.password,
|
c.gdtype,
|
c.factory,
|
c.channel,
|
c.longitude,
|
c.latitude,
|
c.altitude,
|
c.user_id,
|
c.dept_id,
|
c.login_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,
|
c.cam_max_visible_distance,
|
c.cam_alarm_guide_enable,
|
c.state,
|
c.tower_id,
|
aaa.id as c_id,
|
aaa.device_id as c_device_id,
|
aaa.name as c_name,
|
aaa.chan_no as c_chan_no
|
FROM ard_camera_user_postion p
|
LEFT JOIN ard_cameras c ON c.id = p.camera_id
|
LEFT JOIN ard_channel aaa on c.id = aaa.device_id
|
where p.user_id = #{userId} and p.position = #{position}
|
</select>
|
|
<select id="selectArdCameraUserPostionById" parameterType="String" resultMap="ArdCameraUserPostionResult">
|
<include refid="selectArdCameraUserPostionVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertArdCameraUserPostion" parameterType="ArdCameraUserPostion">
|
insert into ard_camera_user_postion
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="cameraId != null">camera_id,</if>
|
<if test="chanNo != null">chan_no,</if>
|
<if test="userId != null">user_id,</if>
|
<if test="position != null">position,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="cameraId != null">#{cameraId},</if>
|
<if test="chanNo != null">#{chanNo},</if>
|
<if test="userId != null">#{userId},</if>
|
<if test="position != null">#{position},</if>
|
</trim>
|
</insert>
|
|
<update id="updateArdCameraUserPostion" parameterType="ArdCameraUserPostion">
|
update ard_camera_user_postion
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="cameraId != null">camera_id = #{cameraId},</if>
|
<if test="chanNo != null">chan_no = #{chanNo},</if>
|
<if test="userId != null">user_id = #{userId},</if>
|
<if test="position != null">position = #{position},</if>
|
</trim>
|
where position = #{position} and user_id = #{userId}
|
</update>
|
|
<delete id="deleteArdCameraUserPostionById" parameterType="String">
|
delete from ard_camera_user_postion where id = #{id}
|
</delete>
|
|
<delete id="deleteArdCameraUserPostionByIds" parameterType="String">
|
delete from ard_camera_user_postion where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|