zhangback
2025-11-18 f656483a233cb1213c85f32c6b4f81d71bd4db4c
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?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.tms.mapper.TmsLoadingServiceProviderMapper">
 
    <resultMap type="com.ruoyi.tms.domain.TmsLoadingServiceProvider" id="TmsLoadingServiceProviderResult">
        <result property="id"    column="id"    />
        <result property="serviceCode"    column="service_code"    />
        <result property="serviceName"    column="service_name"    />
        <result property="serviceShortName"    column="service_short_name"    />
        <result property="serviceType"    column="service_type"    />
        <result property="address"    column="address"    />
        <result property="licenseNumber"    column="license_number"    />
        <result property="businessStatus"    column="business_status"    />
        <result property="contactName"    column="contact_name"    />
        <result property="contactPhone"    column="contact_phone"    />
        <result property="contactEmail"    column="contact_email"    />
        <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="selectTmsLoadingServiceProviderVo">
        select thisTab.id, thisTab.service_code, thisTab.service_name, thisTab.service_short_name, thisTab.service_type, thisTab.address, thisTab.license_number, thisTab.business_status, thisTab.contact_name, thisTab.contact_phone, thisTab.contact_email, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark from tms_loading_service_provider AS thisTab
    </sql>
    <sql id="selectTmsLoadingServiceProviderVoCount">
        select count(0) from tms_loading_service_provider as thisTab
    </sql>
 
    <sql id="whereCondition">
        <if test="serviceCode != null  and serviceCode != ''"> and thisTab.service_code = #{serviceCode}</if>
        <if test="serviceShortName != null  and serviceShortName != ''"> and  thisTab.service_short_name like concat('%', #{serviceShortName}, '%')</if>
        <if test="serviceType != null  and serviceType != ''"> and thisTab.service_type = #{serviceType}</if>
        <if test="businessStatus != null "> and thisTab.business_status = #{businessStatus}</if>
        <if test="contactName != null  and contactName != ''"> and  thisTab.contact_name like concat('%', #{contactName}, '%')</if>
        <if test="status != null "> and thisTab.status = #{status}</if>
    </sql>
 
    <!--查询-->
    <select id="selectTmsLoadingServiceProviderById" parameterType="Integer" resultMap="TmsLoadingServiceProviderResult">
        <include refid="selectTmsLoadingServiceProviderVo"/>
        where id = #{id}
    </select>
 
    <select id="selectTmsLoadingServiceProviderCount" parameterType="com.ruoyi.tms.domain.TmsLoadingServiceProvider" resultType="int">
        <include refid="selectTmsLoadingServiceProviderVoCount"/>
        <where>
            <include refid="whereCondition"/>
        </where>
    </select>
 
    <select id="selectTmsLoadingServiceProviderList" parameterType="com.ruoyi.tms.domain.TmsLoadingServiceProvider" resultMap="TmsLoadingServiceProviderResult">
        <include refid="selectTmsLoadingServiceProviderVo"/>
        <where>
            <include refid="whereCondition"/>
        </where>
        order by thisTab.id desc
    </select>
 
    <!-- 新增 -->
    <insert id="insertTmsLoadingServiceProvider" parameterType="com.ruoyi.tms.domain.TmsLoadingServiceProvider"  useGeneratedKeys="true" keyProperty="id">
        insert into tms_loading_service_provider
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="serviceCode != null and serviceCode != ''">service_code,</if>
            <if test="serviceName != null and serviceName != ''">service_name,</if>
            <if test="serviceShortName != null and serviceShortName != ''">service_short_name,</if>
            <if test="serviceType != null and serviceType != ''">service_type,</if>
            <if test="address != null">address,</if>
            <if test="licenseNumber != null">license_number,</if>
            <if test="businessStatus != null">business_status,</if>
            <if test="contactName != null and contactName != ''">contact_name,</if>
            <if test="contactPhone != null">contact_phone,</if>
            <if test="contactEmail != null">contact_email,</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="serviceCode != null and serviceCode != ''">#{serviceCode},</if>
            <if test="serviceName != null and serviceName != ''">#{serviceName},</if>
            <if test="serviceShortName != null and serviceShortName != ''">#{serviceShortName},</if>
            <if test="serviceType != null and serviceType != ''">#{serviceType},</if>
            <if test="address != null">#{address},</if>
            <if test="licenseNumber != null">#{licenseNumber},</if>
            <if test="businessStatus != null">#{businessStatus},</if>
            <if test="contactName != null and contactName != ''">#{contactName},</if>
            <if test="contactPhone != null">#{contactPhone},</if>
            <if test="contactEmail != null">#{contactEmail},</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>
 
    <insert id="insertTmsLoadingServiceProviderBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into tms_loading_service_provider
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,service_code,service_name,service_short_name,service_type,address,license_number,business_status,contact_name,contact_phone,contact_email,status,create_by,create_time,update_by,update_time,remark,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.serviceCode},#{item.serviceName},#{item.serviceShortName},#{item.serviceType},#{item.address},#{item.licenseNumber},#{item.businessStatus},#{item.contactName},#{item.contactPhone},#{item.contactEmail},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},
            </trim>
        </foreach>
    </insert>
 
    <!-- 修改 -->
    <update id="updateTmsLoadingServiceProvider" parameterType="com.ruoyi.tms.domain.TmsLoadingServiceProvider">
        update tms_loading_service_provider
        <trim prefix="SET" suffixOverrides=",">
            <if test="serviceCode != null and serviceCode != ''">service_code = #{serviceCode},</if>
            <if test="serviceName != null and serviceName != ''">service_name = #{serviceName},</if>
            <if test="serviceShortName != null and serviceShortName != ''">service_short_name = #{serviceShortName},</if>
            <if test="serviceType != null and serviceType != ''">service_type = #{serviceType},</if>
            <if test="address != null">address = #{address},</if>
            <if test="licenseNumber != null">license_number = #{licenseNumber},</if>
            <if test="businessStatus != null">business_status = #{businessStatus},</if>
            <if test="contactName != null and contactName != ''">contact_name = #{contactName},</if>
            <if test="contactPhone != null">contact_phone = #{contactPhone},</if>
            <if test="contactEmail != null">contact_email = #{contactEmail},</if>
            <if test="status != null">status = #{status},</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>
            <if test="remark != null">remark = #{remark},</if>
        </trim>
        where id = #{id}
    </update>
    <!-- 修改 -->
    <update id="updateTmsLoadingServiceProviderBatch" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
            update tms_loading_service_provider
            <trim prefix="SET" suffixOverrides=",">
                <if test="item.serviceCode != null and item.serviceCode != ''">service_code = #{item.serviceCode},</if>
                <if test="item.serviceName != null and item.serviceName != ''">service_name = #{item.serviceName},</if>
                <if test="item.serviceShortName != null and item.serviceShortName != ''">service_short_name = #{item.serviceShortName},</if>
                <if test="item.serviceType != null and item.serviceType != ''">service_type = #{item.serviceType},</if>
                <if test="item.address != null">address = #{item.address},</if>
                <if test="item.licenseNumber != null">license_number = #{item.licenseNumber},</if>
                <if test="item.businessStatus != null">business_status = #{item.businessStatus},</if>
                <if test="item.contactName != null and item.contactName != ''">contact_name = #{item.contactName},</if>
                <if test="item.contactPhone != null">contact_phone = #{item.contactPhone},</if>
                <if test="item.contactEmail != null">contact_email = #{item.contactEmail},</if>
                <if test="item.status != null">status = #{item.status},</if>
                <if test="item.createBy != null">create_by = #{item.createBy},</if>
                <if test="item.createTime != null">create_time = #{item.createTime},</if>
                <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
                <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
                <if test="item.remark != null">remark = #{item.remark},</if>
            </trim>
        where id = #{item.id}
        </foreach>
    </update>
 
    <!--删除-->
    <delete id="deleteTmsLoadingServiceProviderById" parameterType="Integer">
        delete from tms_loading_service_provider where id = #{id}
    </delete>
    <delete id="deleteTmsLoadingServiceProviderByIds" parameterType="Integer">
        delete from tms_loading_service_provider where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
</mapper>