TransportationEnterpriseMapper.xml
16.7 KB
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<?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.trash.enterprise.mapper.TransportationEnterpriseMapper">
<resultMap type="TransportationEnterprise" id="TransportationEnterpriseResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="abbreviation" column="abbreviation" />
<result property="registrationArea" column="registration_area" />
<result property="transportPermissionDate" column="transport_permission_date" />
<result property="enterDate" column="enter_date" />
<result property="businessLicenseDate" column="business_license_date" />
<result property="officeAddress" column="office_address" />
<result property="officeAddressGps" column="office_address_gps" />
<result property="parkingLotLocation" column="parking_lot_location" />
<result property="parkingArea" column="parking_area" />
<result property="carNumber" column="car_number" />
<result property="safetyManagerName" column="safety_manager_name" />
<result property="safetyManagerPhone" column="safety_manager_phone" />
<result property="socialUniformCreditCodeNumber" column="social_uniform_credit_code_number" />
<result property="legalRepresentative" column="legal_representative" />
<result property="legalRepresentativePhone" column="legal_representative_phone" />
<result property="safetyPeopleName" column="safety_people_name" />
<result property="remark" column="remark" />
<result property="transportPermission" column="transport_permission" />
<result property="enterpriseBusinessLicense" column="enterprise_business_license" />
<result property="safetyOfficerQualificationCertificate" column="safety_officer_qualification_certificate" />
<result property="safetyCertificate" column="safety_certificate" />
<result property="carParkPanorama" column="car_park_panorama" />
<result property="businessUnit" column="business_unit" />
<result property="status" column="status" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="parentId" column="parent_id" />
<result property="companyType" column="company_type" />
<result property="creditStatus" column="credit_status" />
<result property="qrCode" column="qr_code" />
<result property="servicePhone" column="service_phone" />
<result property="offer" column="offer" />
<result property="companyLogo" column="company_logo" />
</resultMap>
<sql id="selectTransportationEnterpriseVo">
select id, name, abbreviation, registration_area, transport_permission_date, enter_date, business_license_date, office_address, parking_lot_location, parking_area, (select count(id) from car_info where company_id = te.id) car_number, safety_manager_name, safety_manager_phone, social_uniform_credit_code_number, legal_representative, legal_representative_phone, safety_people_name, remark, transport_permission, enterprise_business_license, safety_officer_qualification_certificate, safety_certificate, car_park_panorama, business_unit, status, create_time, create_by, update_time, update_by, parent_id, company_type, credit_status, qr_code,service_phone,office_address_gps,offer,company_logo from transportation_enterprise te
</sql>
<select id="selectTransportationEnterpriseList" parameterType="TransportationEnterprise" resultMap="TransportationEnterpriseResult">
<include refid="selectTransportationEnterpriseVo"/>
<where>
<if test="id != null and id != ''"> and id = #{id}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="abbreviation != null and abbreviation != ''"> and abbreviation = #{abbreviation}</if>
<if test="registrationArea != null and registrationArea != ''"> and registration_area = #{registrationArea}</if>
<if test="transportPermissionDate != null "> and transport_permission_date = #{transportPermissionDate}</if>
<if test="enterDate != null "> and enter_date = #{enterDate}</if>
<if test="businessLicenseDate != null "> and business_license_date = #{businessLicenseDate}</if>
<if test="officeAddress != null and officeAddress != ''"> and office_address = #{officeAddress}</if>
<if test="parkingLotLocation != null and parkingLotLocation != ''"> and parking_lot_location = #{parkingLotLocation}</if>
<if test="parkingArea != null "> and parking_area = #{parkingArea}</if>
<if test="carNumber != null "> and car_number = #{carNumber}</if>
<if test="safetyManagerName != null and safetyManagerName != ''"> and safety_manager_name like concat('%', #{safetyManagerName}, '%')</if>
<if test="safetyManagerPhone != null and safetyManagerPhone != ''"> and safety_manager_phone = #{safetyManagerPhone}</if>
<if test="socialUniformCreditCodeNumber != null and socialUniformCreditCodeNumber != ''"> and social_uniform_credit_code_number = #{socialUniformCreditCodeNumber}</if>
<if test="legalRepresentative != null and legalRepresentative != ''"> and legal_representative like concat('%',#{legalRepresentative},'%')</if>
<if test="legalRepresentativePhone != null and legalRepresentativePhone != ''"> and legal_representative_phone = #{legalRepresentativePhone}</if>
<if test="safetyPeopleName != null and safetyPeopleName != ''"> and safety_people_name like concat('%', #{safetyPeopleName}, '%')</if>
<if test="transportPermission != null and transportPermission != ''"> and transport_permission = #{transportPermission}</if>
<if test="enterpriseBusinessLicense != null and enterpriseBusinessLicense != ''"> and enterprise_business_license = #{enterpriseBusinessLicense}</if>
<if test="safetyOfficerQualificationCertificate != null and safetyOfficerQualificationCertificate != ''"> and safety_officer_qualification_certificate = #{safetyOfficerQualificationCertificate}</if>
<if test="safetyCertificate != null and safetyCertificate != ''"> and safety_certificate = #{safetyCertificate}</if>
<if test="carParkPanorama != null and carParkPanorama != ''"> and car_park_panorama = #{carParkPanorama}</if>
<if test="businessUnit != null and businessUnit != ''"> and business_unit = #{businessUnit}</if>
<if test="status != null "> and status = #{status}</if>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="companyType != null "> and company_type = #{companyType}</if>
<if test="creditStatus != null and creditStatus != ''"> and credit_status = #{creditStatus}</if>
<if test="qrCode != null and qrCode != ''"> and qr_code = #{qrCode}</if>
<if test="servicePhone != null and servicePhone != ''"> and service_phone = #{servicePhone}</if>
</where>
</select>
<select id="selectTransportationEnterpriseById" parameterType="Long" resultMap="TransportationEnterpriseResult">
<include refid="selectTransportationEnterpriseVo"/>
where id = #{id}
</select>
<insert id="insertTransportationEnterprise" parameterType="TransportationEnterprise" useGeneratedKeys="true" keyProperty="id">
insert into transportation_enterprise
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="abbreviation != null">abbreviation,</if>
<if test="registrationArea != null">registration_area,</if>
<if test="transportPermissionDate != null">transport_permission_date,</if>
<if test="enterDate != null">enter_date,</if>
<if test="businessLicenseDate != null">business_license_date,</if>
<if test="officeAddress != null">office_address,</if>
<if test="parkingLotLocation != null">parking_lot_location,</if>
<if test="parkingArea != null">parking_area,</if>
<if test="carNumber != null">car_number,</if>
<if test="safetyManagerName != null">safety_manager_name,</if>
<if test="safetyManagerPhone != null">safety_manager_phone,</if>
<if test="socialUniformCreditCodeNumber != null">social_uniform_credit_code_number,</if>
<if test="legalRepresentative != null">legal_representative,</if>
<if test="legalRepresentativePhone != null">legal_representative_phone,</if>
<if test="safetyPeopleName != null">safety_people_name,</if>
<if test="remark != null">remark,</if>
<if test="transportPermission != null">transport_permission,</if>
<if test="enterpriseBusinessLicense != null">enterprise_business_license,</if>
<if test="safetyOfficerQualificationCertificate != null">safety_officer_qualification_certificate,</if>
<if test="safetyCertificate != null">safety_certificate,</if>
<if test="carParkPanorama != null">car_park_panorama,</if>
<if test="businessUnit != null">business_unit,</if>
<if test="status != null">status,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="parentId != null">parent_id,</if>
<if test="companyType != null">company_type,</if>
<if test="creditStatus != null">credit_status,</if>
<if test="qrCode != null">qr_code,</if>
<if test="servicePhone != null">service_phone,</if>
<if test="officeAddressGps != null">office_address_gps,</if>
<if test="offer != null">offer,</if>
<if test="companyLogo != null">company_logo,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="abbreviation != null">#{abbreviation},</if>
<if test="registrationArea != null">#{registrationArea},</if>
<if test="transportPermissionDate != null">#{transportPermissionDate},</if>
<if test="enterDate != null">#{enterDate},</if>
<if test="businessLicenseDate != null">#{businessLicenseDate},</if>
<if test="officeAddress != null">#{officeAddress},</if>
<if test="parkingLotLocation != null">#{parkingLotLocation},</if>
<if test="parkingArea != null">#{parkingArea},</if>
<if test="carNumber != null">#{carNumber},</if>
<if test="safetyManagerName != null">#{safetyManagerName},</if>
<if test="safetyManagerPhone != null">#{safetyManagerPhone},</if>
<if test="socialUniformCreditCodeNumber != null">#{socialUniformCreditCodeNumber},</if>
<if test="legalRepresentative != null">#{legalRepresentative},</if>
<if test="legalRepresentativePhone != null">#{legalRepresentativePhone},</if>
<if test="safetyPeopleName != null">#{safetyPeopleName},</if>
<if test="remark != null">#{remark},</if>
<if test="transportPermission != null">#{transportPermission},</if>
<if test="enterpriseBusinessLicense != null">#{enterpriseBusinessLicense},</if>
<if test="safetyOfficerQualificationCertificate != null">#{safetyOfficerQualificationCertificate},</if>
<if test="safetyCertificate != null">#{safetyCertificate},</if>
<if test="carParkPanorama != null">#{carParkPanorama},</if>
<if test="businessUnit != null">#{businessUnit},</if>
<if test="status != null">#{status},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="parentId != null">#{parentId},</if>
<if test="companyType != null">#{companyType},</if>
<if test="creditStatus != null">#{creditStatus},</if>
<if test="qrCode != null">#{qrCode},</if>
<if test="servicePhone != null">#{servicePhone},</if>
<if test="officeAddressGps != null">#{officeAddressGps},</if>
<if test="offer != null">#{offer},</if>
<if test="companyLogo != null">#{companyLogo},</if>
</trim>
</insert>
<update id="updateTransportationEnterprise" parameterType="TransportationEnterprise">
update transportation_enterprise
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="abbreviation != null">abbreviation = #{abbreviation},</if>
<if test="registrationArea != null">registration_area = #{registrationArea},</if>
<if test="transportPermissionDate != null">transport_permission_date = #{transportPermissionDate},</if>
<if test="enterDate != null">enter_date = #{enterDate},</if>
<if test="businessLicenseDate != null">business_license_date = #{businessLicenseDate},</if>
<if test="officeAddress != null">office_address = #{officeAddress},</if>
<if test="parkingLotLocation != null">parking_lot_location = #{parkingLotLocation},</if>
<if test="parkingArea != null">parking_area = #{parkingArea},</if>
<if test="carNumber != null">car_number = #{carNumber},</if>
<if test="safetyManagerName != null">safety_manager_name = #{safetyManagerName},</if>
<if test="safetyManagerPhone != null">safety_manager_phone = #{safetyManagerPhone},</if>
<if test="socialUniformCreditCodeNumber != null">social_uniform_credit_code_number = #{socialUniformCreditCodeNumber},</if>
<if test="legalRepresentative != null">legal_representative = #{legalRepresentative},</if>
<if test="legalRepresentativePhone != null">legal_representative_phone = #{legalRepresentativePhone},</if>
<if test="safetyPeopleName != null">safety_people_name = #{safetyPeopleName},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="transportPermission != null">transport_permission = #{transportPermission},</if>
<if test="enterpriseBusinessLicense != null">enterprise_business_license = #{enterpriseBusinessLicense},</if>
<if test="safetyOfficerQualificationCertificate != null">safety_officer_qualification_certificate = #{safetyOfficerQualificationCertificate},</if>
<if test="safetyCertificate != null">safety_certificate = #{safetyCertificate},</if>
<if test="carParkPanorama != null">car_park_panorama = #{carParkPanorama},</if>
<if test="businessUnit != null">business_unit = #{businessUnit},</if>
<if test="status != null">status = #{status},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="companyType != null">company_type = #{companyType},</if>
<if test="creditStatus != null">credit_status = #{creditStatus},</if>
<if test="qrCode != null">qr_code = #{qrCode},</if>
<if test="servicePhone != null">service_phone = #{servicePhone},</if>
<if test="officeAddressGps != null">office_address_gps = #{officeAddressGps},</if>
<if test="offer != null">offer = #{offer},</if>
<if test="companyLogo != null">company_logo = #{companyLogo},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTransportationEnterpriseById" parameterType="Long">
delete from transportation_enterprise where id = #{id}
</delete>
<delete id="deleteTransportationEnterpriseByIds" parameterType="String">
delete from transportation_enterprise where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>