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
<?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.mapper.AutomobileEnterpriseMapper">
<resultMap type="com.ruoyi.domain.AutomobileEnterprise" id="AutomobileEnterpriseResult">
<result property="id" column="id"/>
<result property="enterpriseName" column="enterprise_name"/>
<result property="address" column="address"/>
<result property="postcode" column="postcode"/>
<result property="enterpriseContact" column="enterprise_contact"/>
<result property="contactNumber" column="contact_number"/>
<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="deleted" column="deleted"/>
</resultMap>
<sql id="selectAutomobileEnterpriseVo">
select id,
enterprise_name,
address,
postcode,
enterprise_contact,
contact_number,
create_by,
create_time,
update_by,
update_time,
deleted
from t_automobile_enterprise
</sql>
<select id="selectAutomobileEnterpriseList" parameterType="com.ruoyi.domain.AutomobileEnterprise"
resultMap="AutomobileEnterpriseResult">
<include refid="selectAutomobileEnterpriseVo"/>
<where>
deleted = 0
<if test="enterpriseName != null and enterpriseName != ''">and enterprise_name like concat('%',
#{enterpriseName}, '%')
</if>
<if test="address != null and address != ''">and address like concat('%', #{address}, '%')</if>
<if test="postcode != null and postcode != ''">and postcode like concat('%', #{postcode}, '%')</if>
<if test="enterpriseContact != null and enterpriseContact != ''">
and enterprise_contact like concat('%', #{enterpriseContact}, '%')
</if>
<if test="contactNumber != null and contactNumber != ''">and contact_number like concat('%', #{contactNumber}, '%')</if>
</where>
</select>
<select id="selectAutomobileEnterpriseById" parameterType="Long" resultMap="AutomobileEnterpriseResult">
<include refid="selectAutomobileEnterpriseVo"/>
where id = #{id}
</select>
<insert id="insertAutomobileEnterprise" parameterType="com.ruoyi.domain.AutomobileEnterprise">
insert into t_automobile_enterprise
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="enterpriseName != null">enterprise_name,</if>
<if test="address != null">address,</if>
<if test="postcode != null">postcode,</if>
<if test="enterpriseContact != null">enterprise_contact,</if>
<if test="contactNumber != null">contact_number,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="enterpriseName != null">#{enterpriseName},</if>
<if test="address != null">#{address},</if>
<if test="postcode != null">#{postcode},</if>
<if test="enterpriseContact != null">#{enterpriseContact},</if>
<if test="contactNumber != null">#{contactNumber},</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>
</trim>
</insert>
<update id="updateAutomobileEnterprise" parameterType="com.ruoyi.domain.AutomobileEnterprise">
update t_automobile_enterprise
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if>
<if test="address != null">address = #{address},</if>
<if test="postcode != null">postcode = #{postcode},</if>
<if test="enterpriseContact != null">enterprise_contact = #{enterpriseContact},</if>
<if test="contactNumber != null">contact_number = #{contactNumber},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
</mapper>