wlzboy
2025-09-22 fe95f471666d93e7822a4886c1c69dafbd6b2a1e
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
<?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.system.mapper.VehicleEvaluationQrcodeMapper">
    
    <resultMap type="VehicleEvaluationQrcode" id="VehicleEvaluationQrcodeResult">
        <result property="qrcodeId"    column="qrcode_id"    />
        <result property="vehicleNo"    column="vehicle_no"    />
        <result property="qrcodeUrl"    column="qrcode_url"    />
        <result property="qrcodeContent"    column="qrcode_content"    />
        <result property="qrcodeImage"    column="qrcode_image"    />
        <result property="status"    column="status"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />
    </resultMap>
 
    <sql id="selectVehicleEvaluationQrcodeVo">
        select qrcode_id, vehicle_no, qrcode_url, qrcode_content, qrcode_image, status, create_by, create_time, update_by, update_time, remark from vehicle_evaluation_qrcode
    </sql>
 
    <select id="selectVehicleEvaluationQrcodeList" parameterType="VehicleEvaluationQrcode" resultMap="VehicleEvaluationQrcodeResult">
        <include refid="selectVehicleEvaluationQrcodeVo"/>
        <where>  
            <if test="vehicleNo != null  and vehicleNo != ''"> and vehicle_no like concat('%', #{vehicleNo}, '%')</if>
            <if test="qrcodeUrl != null  and qrcodeUrl != ''"> and qrcode_url like concat('%', #{qrcodeUrl}, '%')</if>
            <if test="qrcodeContent != null  and qrcodeContent != ''"> and qrcode_content like concat('%', #{qrcodeContent}, '%')</if>
            <if test="status != null  and status != ''"> and status = #{status}</if>
        </where>
        order by create_time desc
    </select>
    
    <select id="selectVehicleEvaluationQrcodeByQrcodeId" parameterType="Long" resultMap="VehicleEvaluationQrcodeResult">
        <include refid="selectVehicleEvaluationQrcodeVo"/>
        where qrcode_id = #{qrcodeId}
    </select>
 
    <select id="selectVehicleEvaluationQrcodeByVehicleNo" parameterType="String" resultMap="VehicleEvaluationQrcodeResult">
        <include refid="selectVehicleEvaluationQrcodeVo"/>
        where vehicle_no = #{vehicleNo}
    </select>
        
    <insert id="insertVehicleEvaluationQrcode" parameterType="VehicleEvaluationQrcode" useGeneratedKeys="true" keyProperty="qrcodeId">
        insert into vehicle_evaluation_qrcode
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="vehicleNo != null and vehicleNo != ''">vehicle_no,</if>
            <if test="qrcodeUrl != null and qrcodeUrl != ''">qrcode_url,</if>
            <if test="qrcodeContent != null and qrcodeContent != ''">qrcode_content,</if>
            <if test="qrcodeImage != null">qrcode_image,</if>
            <if test="status != null">status,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="remark != null">remark,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="vehicleNo != null and vehicleNo != ''">#{vehicleNo},</if>
            <if test="qrcodeUrl != null and qrcodeUrl != ''">#{qrcodeUrl},</if>
            <if test="qrcodeContent != null and qrcodeContent != ''">#{qrcodeContent},</if>
            <if test="qrcodeImage != null">#{qrcodeImage},</if>
            <if test="status != null">#{status},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="remark != null">#{remark},</if>
         </trim>
    </insert>
 
    <update id="updateVehicleEvaluationQrcode" parameterType="VehicleEvaluationQrcode">
        update vehicle_evaluation_qrcode
        <trim prefix="SET" suffixOverrides=",">
            <if test="vehicleNo != null and vehicleNo != ''">vehicle_no = #{vehicleNo},</if>
            <if test="qrcodeUrl != null and qrcodeUrl != ''">qrcode_url = #{qrcodeUrl},</if>
            <if test="qrcodeContent != null and qrcodeContent != ''">qrcode_content = #{qrcodeContent},</if>
            <if test="qrcodeImage != null">qrcode_image = #{qrcodeImage},</if>
            <if test="status != null">status = #{status},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="remark != null">remark = #{remark},</if>
        </trim>
        where qrcode_id = #{qrcodeId}
    </update>
 
    <delete id="deleteVehicleEvaluationQrcodeByQrcodeId" parameterType="Long">
        delete from vehicle_evaluation_qrcode where qrcode_id = #{qrcodeId}
    </delete>
 
    <delete id="deleteVehicleEvaluationQrcodeByVehicleNo" parameterType="String">
        delete from vehicle_evaluation_qrcode where vehicle_no = #{vehicleNo}
    </delete>
 
    <delete id="deleteVehicleEvaluationQrcodeByQrcodeIds" parameterType="String">
        delete from vehicle_evaluation_qrcode where qrcode_id in 
        <foreach item="qrcodeId" collection="array" open="(" separator="," close=")">
            #{qrcodeId}
        </foreach>
    </delete>
</mapper>