‘liusuyi’
2023-08-24 bc6ac2f55b2ddec81614ebf7722760b4868f76db
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?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.cameracalibration.mapper.ArdCamerasCalibrationMapper">
 
    <resultMap type="ArdCamerasCalibration" id="ArdCamerasCalibrationResult">
        <result property="id"    column="id"    />
        <result property="cameraId"    column="camera_id"    />
        <result property="name"    column="name"    />
        <result property="targetLongitude"    column="target_longitude"    />
        <result property="targetLatitude"    column="target_latitude"    />
        <result property="pan"    column="pan"    />
        <result property="tilt"    column="tilt"    />
        <result property="zoom"    column="zoom"    />
        <result property="panDiff"    column="pan_diff"    />
        <result property="tiltDiff"    column="tilt_diff"    />
    </resultMap>
 
    <sql id="selectArdCamerasCalibrationVo">
        select id, camera_id, name, target_longitude, target_latitude, pan, tilt, zoom, pan_diff, tilt_diff from ard_cameras_calibration
    </sql>
 
    <select id="selectArdCamerasCalibrationList" parameterType="ArdCamerasCalibration" resultMap="ArdCamerasCalibrationResult">
        <include refid="selectArdCamerasCalibrationVo"/>
        <where>
            <if test="cameraId != null  and cameraId != ''"> and camera_id = #{cameraId}</if>
            <if test="name != null  and name != ''"> and name like '%'||#{name}||'%'</if>
            <if test="targetLongitude != null  and targetLongitude != ''"> and target_longitude = #{targetLongitude}</if>
            <if test="targetLatitude != null  and targetLatitude != ''"> and target_latitude = #{targetLatitude}</if>
            <if test="pan != null  and pan != ''"> and pan = #{pan}</if>
            <if test="tilt != null  and tilt != ''"> and tilt = #{tilt}</if>
            <if test="zoom != null  and zoom != ''"> and zoom = #{zoom}</if>
            <if test="panDiff != null  and panDiff != ''"> and pan_diff = #{panDiff}</if>
            <if test="tiltDiff != null  and tiltDiff != ''"> and tilt_diff = #{tiltDiff}</if>
        </where>
    </select>
 
    <select id="selectArdCamerasCalibrationById" parameterType="String" resultMap="ArdCamerasCalibrationResult">
        <include refid="selectArdCamerasCalibrationVo"/>
        where id = #{id}
    </select>
 
    <insert id="insertArdCamerasCalibration" parameterType="ArdCamerasCalibration">
        insert into ard_cameras_calibration
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="cameraId != null">camera_id,</if>
            <if test="name != null">name,</if>
            <if test="targetLongitude != null">target_longitude,</if>
            <if test="targetLatitude != null">target_latitude,</if>
            <if test="pan != null">pan,</if>
            <if test="tilt != null">tilt,</if>
            <if test="zoom != null">zoom,</if>
            <if test="panDiff != null">pan_diff,</if>
            <if test="tiltDiff != null">tilt_diff,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="cameraId != null">#{cameraId},</if>
            <if test="name != null">#{name},</if>
            <if test="targetLongitude != null">#{targetLongitude},</if>
            <if test="targetLatitude != null">#{targetLatitude},</if>
            <if test="pan != null">#{pan},</if>
            <if test="tilt != null">#{tilt},</if>
            <if test="zoom != null">#{zoom},</if>
            <if test="panDiff != null">#{panDiff},</if>
            <if test="tiltDiff != null">#{tiltDiff},</if>
        </trim>
    </insert>
 
    <update id="updateArdCamerasCalibration" parameterType="ArdCamerasCalibration">
        update ard_cameras_calibration
        <trim prefix="SET" suffixOverrides=",">
            <if test="cameraId != null">camera_id = #{cameraId},</if>
            <if test="name != null">name = #{name},</if>
            <if test="targetLongitude != null">target_longitude = #{targetLongitude},</if>
            <if test="targetLatitude != null">target_latitude = #{targetLatitude},</if>
            <if test="pan != null">pan = #{pan},</if>
            <if test="tilt != null">tilt = #{tilt},</if>
            <if test="zoom != null">zoom = #{zoom},</if>
            <if test="panDiff != null">pan_diff = #{panDiff},</if>
            <if test="tiltDiff != null">tilt_diff = #{tiltDiff},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteArdCamerasCalibrationById" parameterType="String">
        delete from ard_cameras_calibration where id = #{id}
    </delete>
 
    <delete id="deleteArdCamerasCalibrationByIds" parameterType="String">
        delete from ard_cameras_calibration where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>