zhangnaisong
2024-07-30 4c133c297ff25eddd1a30a4bce032affb334969a
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
99
100
101
102
103
104
105
106
107
108
<?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.ArdTankLockProcessLogMapper">
    
    <resultMap type="ArdTankLockProcessLog" id="ArdTankLockProcessLogResult">
        <result property="id"    column="id"    />
        <result property="lockId"    column="lock_id"    />
        <result property="lockNum"    column="lock_num"    />
        <result property="carId"    column="car_id"    />
        <result property="carPlate"    column="car_plate"    />
        <result property="userId"    column="user_id"    />
        <result property="userName"    column="user_name"    />
        <result property="process"    column="process"    />
        <result property="processReason"    column="process_reason"    />
        <result property="longitude"    column="longitude"    />
        <result property="latitude"    column="latitude"    />
        <result property="processTime"    column="process_time"    />
    </resultMap>
 
    <sql id="selectArdTankLockProcessLogVo">
        select id, lock_id, lock_num, car_id, car_plate, user_id, user_name, process, process_reason, longitude, latitude, process_time from ard_tank_lock_process_log
    </sql>
 
    <select id="selectArdTankLockProcessLogList" parameterType="ArdTankLockProcessLog" resultMap="ArdTankLockProcessLogResult">
        <include refid="selectArdTankLockProcessLogVo"/>
        <where>  
            <if test="lockId != null  and lockId != ''"> and lock_id = #{lockId}</if>
            <if test="lockNum != null  and lockNum != ''"> and lock_num = #{lockNum}</if>
            <if test="carId != null  and carId != ''"> and car_id = #{carId}</if>
            <if test="carPlate != null  and carPlate != ''"> and car_plate = #{carPlate}</if>
            <if test="userId != null  and userId != ''"> and user_id = #{userId}</if>
            <if test="userName != null  and userName != ''"> and user_name like '%'||#{userName}||'%'</if>
            <if test="process != null  and process != ''"> and process = #{process}</if>
            <if test="processReason != null  and processReason != ''"> and process_reason = #{processReason}</if>
            <if test="longitude != null  and longitude != ''"> and longitude = #{longitude}</if>
            <if test="latitude != null  and latitude != ''"> and latitude = #{latitude}</if>
            <if test="processTime != null  and processTime != ''"> and process_time = #{processTime}</if>
        </where>
    </select>
    
    <select id="selectArdTankLockProcessLogById" parameterType="String" resultMap="ArdTankLockProcessLogResult">
        <include refid="selectArdTankLockProcessLogVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertArdTankLockProcessLog" parameterType="ArdTankLockProcessLog">
        insert into ard_tank_lock_process_log
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="lockId != null">lock_id,</if>
            <if test="lockNum != null">lock_num,</if>
            <if test="carId != null">car_id,</if>
            <if test="carPlate != null">car_plate,</if>
            <if test="userId != null">user_id,</if>
            <if test="userName != null">user_name,</if>
            <if test="process != null">process,</if>
            <if test="processReason != null">process_reason,</if>
            <if test="longitude != null">longitude,</if>
            <if test="latitude != null">latitude,</if>
            <if test="processTime != null">process_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="lockId != null">#{lockId},</if>
            <if test="lockNum != null">#{lockNum},</if>
            <if test="carId != null">#{carId},</if>
            <if test="carPlate != null">#{carPlate},</if>
            <if test="userId != null">#{userId},</if>
            <if test="userName != null">#{userName},</if>
            <if test="process != null">#{process},</if>
            <if test="processReason != null">#{processReason},</if>
            <if test="longitude != null">#{longitude},</if>
            <if test="latitude != null">#{latitude},</if>
            <if test="processTime != null">#{processTime},</if>
         </trim>
    </insert>
 
    <update id="updateArdTankLockProcessLog" parameterType="ArdTankLockProcessLog">
        update ard_tank_lock_process_log
        <trim prefix="SET" suffixOverrides=",">
            <if test="lockId != null">lock_id = #{lockId},</if>
            <if test="lockNum != null">lock_num = #{lockNum},</if>
            <if test="carId != null">car_id = #{carId},</if>
            <if test="carPlate != null">car_plate = #{carPlate},</if>
            <if test="userId != null">user_id = #{userId},</if>
            <if test="userName != null">user_name = #{userName},</if>
            <if test="process != null">process = #{process},</if>
            <if test="processReason != null">process_reason = #{processReason},</if>
            <if test="longitude != null">longitude = #{longitude},</if>
            <if test="latitude != null">latitude = #{latitude},</if>
            <if test="processTime != null">process_time = #{processTime},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteArdTankLockProcessLogById" parameterType="String">
        delete from ard_tank_lock_process_log where id = #{id}
    </delete>
 
    <delete id="deleteArdTankLockProcessLogByIds" parameterType="String">
        delete from ard_tank_lock_process_log where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>