Administrator
2023-08-03 bdc340b2594dccd1349c5a848b3a285d2c489133
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
<?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.app.patrolplan.mapper.ArdAppPatrolpointRecordImgMapper">
    
    <resultMap type="ArdAppPatrolpointRecordImg" id="ArdAppPatrolpointRecordImgResult">
        <result property="id"    column="id"    />
        <result property="appPatrolponitRecordId"    column="app_patrolponit_record_id"    />
        <result property="img"    column="img"    />
    </resultMap>
 
    <sql id="selectArdAppPatrolpointRecordImgVo">
        select id, app_patrolponit_record_id, img from ard_app_patrolpoint_record_img
    </sql>
 
    <select id="selectArdAppPatrolpointRecordImgList" parameterType="ArdAppPatrolpointRecordImg" resultMap="ArdAppPatrolpointRecordImgResult">
        <include refid="selectArdAppPatrolpointRecordImgVo"/>
        <where>  
            <if test="appPatrolponitRecordId != null  and appPatrolponitRecordId != ''"> and app_patrolponit_record_id = #{appPatrolponitRecordId}</if>
            <if test="img != null  and img != ''"> and img = #{img}</if>
        </where>
    </select>
    
    <select id="selectArdAppPatrolpointRecordImgById" parameterType="String" resultMap="ArdAppPatrolpointRecordImgResult">
        <include refid="selectArdAppPatrolpointRecordImgVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertArdAppPatrolpointRecordImg" parameterType="ArdAppPatrolpointRecordImg">
        insert into ard_app_patrolpoint_record_img
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="appPatrolponitRecordId != null">app_patrolponit_record_id,</if>
            <if test="img != null">img,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="appPatrolponitRecordId != null">#{appPatrolponitRecordId},</if>
            <if test="img != null">#{img},</if>
         </trim>
    </insert>
 
    <update id="updateArdAppPatrolpointRecordImg" parameterType="ArdAppPatrolpointRecordImg">
        update ard_app_patrolpoint_record_img
        <trim prefix="SET" suffixOverrides=",">
            <if test="appPatrolponitRecordId != null">app_patrolponit_record_id = #{appPatrolponitRecordId},</if>
            <if test="img != null">img = #{img},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteArdAppPatrolpointRecordImgById" parameterType="String">
        delete from ard_app_patrolpoint_record_img where id = #{id}
    </delete>
 
    <delete id="deleteArdAppPatrolpointRecordImgByIds" parameterType="String">
        delete from ard_app_patrolpoint_record_img where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>