zhangnaisong
2024-07-01 618e184784d2e39a31affc40173e15ccb978bc24
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
<?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.sy.mapper.ArdTankWallLockMapper">
    
    <resultMap type="ArdTankWallLock" id="ArdTankWallLockResult">
        <result property="processType"    column="process_type"    />
        <result property="id"    column="id"    />
        <result property="wallId"    column="wall_id"    />
        <result property="lockId"    column="lock_id"    />
    </resultMap>
 
    <sql id="selectArdTankWallLockVo">
        select process_type, id, wall_id, lock_id from ard_tank_wall_lock
    </sql>
 
    <select id="selectArdTankWallLockList" parameterType="ArdTankWallLock" resultMap="ArdTankWallLockResult">
        <include refid="selectArdTankWallLockVo"/>
        <where>  
            <if test="processType != null  and processType != ''"> and process_type = #{processType}</if>
            <if test="wallId != null  and wallId != ''"> and wall_id = #{wallId}</if>
            <if test="lockId != null  and lockId != ''"> and lock_id = #{lockId}</if>
        </where>
    </select>
    
    <select id="selectArdTankWallLockByProcessType" parameterType="String" resultMap="ArdTankWallLockResult">
        <include refid="selectArdTankWallLockVo"/>
        where process_type = #{processType}
    </select>
        
    <insert id="insertArdTankWallLock" parameterType="ArdTankWallLock">
        insert into ard_tank_wall_lock
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="processType != null">process_type,</if>
            <if test="id != null">id,</if>
            <if test="wallId != null">wall_id,</if>
            <if test="lockId != null">lock_id,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="processType != null">#{processType},</if>
            <if test="id != null">#{id},</if>
            <if test="wallId != null">#{wallId},</if>
            <if test="lockId != null">#{lockId},</if>
         </trim>
    </insert>
 
    <update id="updateArdTankWallLock" parameterType="ArdTankWallLock">
        update ard_tank_wall_lock
        <trim prefix="SET" suffixOverrides=",">
            <if test="id != null">id = #{id},</if>
            <if test="wallId != null">wall_id = #{wallId},</if>
            <if test="lockId != null">lock_id = #{lockId},</if>
        </trim>
        where process_type = #{processType}
    </update>
 
    <delete id="deleteArdTankWallLockByProcessType" parameterType="String">
        delete from ard_tank_wall_lock where process_type = #{processType}
    </delete>
 
    <delete id="deleteArdTankWallLockByProcessTypes" parameterType="String">
        delete from ard_tank_wall_lock where process_type in 
        <foreach item="processType" collection="array" open="(" separator="," close=")">
            #{processType}
        </foreach>
    </delete>
 
    <delete id="deleteArdTankWallLockByLockId" parameterType="java.lang.String">
        delete from ard_tank_wall_lock where lock_id = #{lockId}
    </delete>
</mapper>