‘liusuyi’
2024-01-16 8926d27639d8cb9826941b482926f774bd10dc92
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
<?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.alarmpoints.well.mapper.ArdWellGuideCameraMapper">
 
    <resultMap type="ArdWellGuideCamera" id="ArdWellGuideCameraResult">
        <result property="id"    column="id"    />
        <result property="cameraId"    column="camera_id"    />
        <result property="p1"    column="p1"    />
        <result property="t1"    column="t1"    />
        <result property="z1"    column="z1"    />
        <result property="p2"    column="p2"    />
        <result property="t2"    column="t2"    />
        <result property="z2"    column="z2"    />
        <result property="wellId"    column="well_id"    />
    </resultMap>
 
    <sql id="selectArdWellGuideCameraVo">
        select id, camera_id, p1, t1, z1, p2, t2, z2, well_id from ard_well_guide_camera
    </sql>
 
    <select id="selectArdWellGuideCameraList" parameterType="ArdWellGuideCamera" resultMap="ArdWellGuideCameraResult">
        <include refid="selectArdWellGuideCameraVo"/>
        <where>
            <if test="cameraId != null  and cameraId != ''"> and camera_id = #{cameraId}</if>
            <if test="p1 != null "> and p1 = #{p1}</if>
            <if test="t1 != null "> and t1 = #{t1}</if>
            <if test="z1 != null "> and z1 = #{z1}</if>
            <if test="p2 != null "> and p2 = #{p2}</if>
            <if test="t2 != null "> and t2 = #{t2}</if>
            <if test="z2 != null "> and z2 = #{z2}</if>
            <if test="wellId != null  and wellId != ''"> and well_id = #{wellId}</if>
        </where>
    </select>
 
    <select id="selectArdWellGuideCameraById" parameterType="String" resultMap="ArdWellGuideCameraResult">
        <include refid="selectArdWellGuideCameraVo"/>
        where id = #{id}
    </select>
 
    <insert id="insertArdWellGuideCamera" parameterType="ArdWellGuideCamera">
        insert into ard_well_guide_camera
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="cameraId != null">camera_id,</if>
            <if test="p1 != null">p1,</if>
            <if test="t1 != null">t1,</if>
            <if test="z1 != null">z1,</if>
            <if test="p2 != null">p2,</if>
            <if test="t2 != null">t2,</if>
            <if test="z2 != null">z2,</if>
            <if test="wellId != null">well_id,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="cameraId != null">#{cameraId},</if>
            <if test="p1 != null">#{p1},</if>
            <if test="t1 != null">#{t1},</if>
            <if test="z1 != null">#{z1},</if>
            <if test="p2 != null">#{p2},</if>
            <if test="t2 != null">#{t2},</if>
            <if test="z2 != null">#{z2},</if>
            <if test="wellId != null">#{wellId},</if>
        </trim>
    </insert>
 
    <update id="updateArdWellGuideCamera" parameterType="ArdWellGuideCamera">
        update ard_well_guide_camera
        <trim prefix="SET" suffixOverrides=",">
            <if test="cameraId != null">camera_id = #{cameraId},</if>
            <if test="p1 != null">p1 = #{p1},</if>
            <if test="t1 != null">t1 = #{t1},</if>
            <if test="z1 != null">z1 = #{z1},</if>
            <if test="p2 != null">p2 = #{p2},</if>
            <if test="t2 != null">t2 = #{t2},</if>
            <if test="z2 != null">z2 = #{z2},</if>
            <if test="wellId != null">well_id = #{wellId},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteArdWellGuideCameraById" parameterType="String">
        delete from ard_well_guide_camera where id = #{id}
    </delete>
 
    <delete id="deleteArdWellGuideCameraByIds" parameterType="String">
        delete from ard_well_guide_camera where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>