IdentificationMapperAuto.xml
9.21 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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<?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.huaheng.pc.config.zone.mapper.IdentificationMapperAuto">
<select id="selectListEntityByLike" resultType="com.huaheng.pc.config.zone.domain.Identification">
SELECT ID, HeaderId, itemId, UserDeft1, UserDeft2, UserDeft3, UserDeft4
FROM identification
<where>
<if test="ID != null ">
AND ID = #{ID}
</if>
<if test="HeaderId != null and HeaderId != ''">
<bind name="HeaderIdPattern" value="'%' + HeaderId + '%'" />
AND HeaderId like #{HeaderIdPattern}
</if>
<if test="itemId != null and itemId != ''">
<bind name="itemIdPattern" value="'%' + itemId + '%'" />
AND itemId like #{itemIdPattern}
</if>
<if test="UserDeft1 != null and UserDeft1 != ''">
<bind name="UserDeft1Pattern" value="'%' + UserDeft1 + '%'" />
AND UserDeft1 like #{UserDeft1Pattern}
</if>
<if test="UserDeft2 != null and UserDeft2 != ''">
<bind name="UserDeft2Pattern" value="'%' + UserDeft2 + '%'" />
AND UserDeft2 like #{UserDeft2Pattern}
</if>
<if test="UserDeft3 != null and UserDeft3 != ''">
<bind name="UserDeft3Pattern" value="'%' + UserDeft3 + '%'" />
AND UserDeft3 like #{UserDeft3Pattern}
</if>
<if test="UserDeft4 != null and UserDeft4 != ''">
<bind name="UserDeft4Pattern" value="'%' + UserDeft4 + '%'" />
AND UserDeft4 like #{UserDeft4Pattern}
</if>
</where>
</select>
<select id="selectListEntityByEqual" resultType="com.huaheng.pc.config.zone.domain.Identification">
SELECT ID, HeaderId, itemId, UserDeft1, UserDeft2, UserDeft3, UserDeft4
FROM identification
<where>
<if test="ID != null">
AND ID = #{ID}
</if>
<if test="HeaderId != null">
AND HeaderId = #{HeaderId}
</if>
<if test="itemId != null">
AND itemId = #{itemId}
</if>
<if test="UserDeft1 != null">
AND UserDeft1 = #{UserDeft1}
</if>
<if test="UserDeft2 != null">
AND UserDeft2 = #{UserDeft2}
</if>
<if test="UserDeft3 != null">
AND UserDeft3 = #{UserDeft3}
</if>
<if test="UserDeft4 != null">
AND UserDeft4 = #{UserDeft4}
</if>
</where>
</select>
<select id="selectListMapByEqual" resultType="java.util.HashMap">
SELECT ${columns} FROM identification
<where>
<if test="condition.ID != null">
AND ID = #{condition.ID}
</if>
<if test="condition.HeaderId != null">
AND HeaderId = #{condition.HeaderId}
</if>
<if test="condition.itemId != null">
AND itemId = #{condition.itemId}
</if>
<if test="condition.UserDeft1 != null">
AND UserDeft1 = #{condition.UserDeft1}
</if>
<if test="condition.UserDeft2 != null">
AND UserDeft2 = #{condition.UserDeft2}
</if>
<if test="condition.UserDeft3 != null">
AND UserDeft3 = #{condition.UserDeft3}
</if>
<if test="condition.UserDeft4 != null">
AND UserDeft4 = #{condition.UserDeft4}
</if>
</where>
</select>
<select id="selectEntityById" resultType="com.huaheng.pc.config.zone.domain.Identification">
SELECT ID, HeaderId, itemId, UserDeft1, UserDeft2, UserDeft3, UserDeft4 FROM identification WHERE id = #{id}
</select>
<select id="selectFirstEntity" resultType="com.huaheng.pc.config.zone.domain.Identification">
SELECT ID, HeaderId, itemId, UserDeft1, UserDeft2, UserDeft3, UserDeft4
FROM identification
<where>
<if test="ID != null">
AND ID = #{ID}
</if>
<if test="HeaderId != null">
AND HeaderId = #{HeaderId}
</if>
<if test="itemId != null">
AND itemId = #{itemId}
</if>
<if test="UserDeft1 != null">
AND UserDeft1 = #{UserDeft1}
</if>
<if test="UserDeft2 != null">
AND UserDeft2 = #{UserDeft2}
</if>
<if test="UserDeft3 != null">
AND UserDeft3 = #{UserDeft3}
</if>
<if test="UserDeft4 != null">
AND UserDeft4 = #{UserDeft4}
</if>
</where>
LIMIT 1
</select>
<select id="selectFirstMap" resultType="java.util.HashMap">
SELECT ${columns} FROM identification
<where>
<if test="condition.ID != null">
AND ID = #{condition.ID}
</if>
<if test="condition.HeaderId != null">
AND HeaderId = #{condition.HeaderId}
</if>
<if test="condition.itemId != null">
AND itemId = #{condition.itemId}
</if>
<if test="condition.UserDeft1 != null">
AND UserDeft1 = #{condition.UserDeft1}
</if>
<if test="condition.UserDeft2 != null">
AND UserDeft2 = #{condition.UserDeft2}
</if>
<if test="condition.UserDeft3 != null">
AND UserDeft3 = #{condition.UserDeft3}
</if>
<if test="condition.UserDeft4 != null">
AND UserDeft4 = #{condition.UserDeft4}
</if>
</where>
LIMIT 1
</select>
<insert id="insert" parameterType="com.huaheng.pc.config.zone.domain.Identification" keyProperty="id" useGeneratedKeys="true" >
INSERT INTO identification
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ID != null">
ID,
</if>
<if test="HeaderId != null">
HeaderId,
</if>
<if test="itemId != null">
itemId,
</if>
<if test="UserDeft1 != null">
UserDeft1,
</if>
<if test="UserDeft2 != null">
UserDeft2,
</if>
<if test="UserDeft3 != null">
UserDeft3,
</if>
<if test="UserDeft4 != null">
UserDeft4,
</if>
</trim>
<trim prefix=" values (" suffix=")" suffixOverrides=",">
<if test="ID != null">
#{ID, jdbcType=INTEGER},
</if>
<if test="HeaderId != null">
#{HeaderId, jdbcType=VARCHAR},
</if>
<if test="itemId != null">
#{itemId, jdbcType=VARCHAR},
</if>
<if test="UserDeft1 != null">
#{UserDeft1, jdbcType=VARCHAR},
</if>
<if test="UserDeft2 != null">
#{UserDeft2, jdbcType=VARCHAR},
</if>
<if test="UserDeft3 != null">
#{UserDeft3, jdbcType=VARCHAR},
</if>
<if test="UserDeft4 != null">
#{UserDeft4, jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByModel">
UPDATE identification
<set>
<if test="ID != null">
ID = #{ID, jdbcType=INTEGER},
</if>
<if test="HeaderId != null">
HeaderId = #{HeaderId, jdbcType=VARCHAR},
</if>
<if test="itemId != null">
itemId = #{itemId, jdbcType=VARCHAR},
</if>
<if test="UserDeft1 != null">
UserDeft1 = #{UserDeft1, jdbcType=VARCHAR},
</if>
<if test="UserDeft2 != null">
UserDeft2 = #{UserDeft2, jdbcType=VARCHAR},
</if>
<if test="UserDeft3 != null">
UserDeft3 = #{UserDeft3, jdbcType=VARCHAR},
</if>
<if test="UserDeft4 != null">
UserDeft4 = #{UserDeft4, jdbcType=VARCHAR},
</if>
</set>
WHERE id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByCondition">
UPDATE identification
<set>
<if test="record.ID != null">
ID = #{record.ID, jdbcType=INTEGER},
</if>
<if test="record.HeaderId != null">
HeaderId = #{record.HeaderId, jdbcType=VARCHAR},
</if>
<if test="record.itemId != null">
itemId = #{record.itemId, jdbcType=VARCHAR},
</if>
<if test="record.UserDeft1 != null">
UserDeft1 = #{record.UserDeft1, jdbcType=VARCHAR},
</if>
<if test="record.UserDeft2 != null">
UserDeft2 = #{record.UserDeft2, jdbcType=VARCHAR},
</if>
<if test="record.UserDeft3 != null">
UserDeft3 = #{record.UserDeft3, jdbcType=VARCHAR},
</if>
<if test="record.UserDeft4 != null">
UserDeft4 = #{record.UserDeft4, jdbcType=VARCHAR},
</if>
</set>
<where>
<if test="condition.ID != null">
AND ID = #{condition.ID}
</if>
<if test="condition.HeaderId != null">
AND HeaderId = #{condition.HeaderId}
</if>
<if test="condition.itemId != null">
AND itemId = #{condition.itemId}
</if>
<if test="condition.UserDeft1 != null">
AND UserDeft1 = #{condition.UserDeft1}
</if>
<if test="condition.UserDeft2 != null">
AND UserDeft2 = #{condition.UserDeft2}
</if>
<if test="condition.UserDeft3 != null">
AND UserDeft3 = #{condition.UserDeft3}
</if>
<if test="condition.UserDeft4 != null">
AND UserDeft4 = #{condition.UserDeft4}
</if>
</where>
</update>
<delete id="deleteById">
DELETE FROM identification WHERE id = #{id, jdbcType=INTEGER}
</delete>
<delete id="deleteByCondition">
DELETE FROM identification
<where>
<if test="ID != null">
AND ID = #{ID}
</if>
<if test="HeaderId != null">
AND HeaderId = #{HeaderId}
</if>
<if test="itemId != null">
AND itemId = #{itemId}
</if>
<if test="UserDeft1 != null">
AND UserDeft1 = #{UserDeft1}
</if>
<if test="UserDeft2 != null">
AND UserDeft2 = #{UserDeft2}
</if>
<if test="UserDeft3 != null">
AND UserDeft3 = #{UserDeft3}
</if>
<if test="UserDeft4 != null">
AND UserDeft4 = #{UserDeft4}
</if>
</where>
</delete>
</mapper>