|
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
3
|
<mapper namespace="com.huaheng.pc.receipt.receiptContainerDetail.mapper.ReceiptContainerDetailMapperAuto">
|
|
4
|
<select id="selectListEntityByLike" resultType="com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail">
|
|
5
|
SELECT id, headerId, receiptCode, receiptId, receiptDetailId, materialCode, materialName, materialSpec, qty, created, createdBy
|
|
6
|
FROM receipt_container_detail
|
|
7
|
<where>
|
|
8
|
<if test="id != null ">
|
|
9
|
AND id = #{id}
|
|
10
|
</if>
|
|
11
|
<if test="headerId != null ">
|
|
12
13
|
AND headerId = #{headerId}
</if>
|
|
14
15
|
<if test="receiptCode != null and receiptCode != '' ">
AND receiptCode = #{receiptCode}
|
|
16
|
</if>
|
|
17
|
<if test="receiptId != null ">
|
|
18
|
AND receiptId = #{receiptId}
|
|
19
|
</if>
|
|
20
|
<if test="receiptDetailId != null ">
|
|
21
|
AND receiptDetailId = #{receiptDetailId}
|
|
22
|
</if>
|
|
23
24
|
<if test="materialCode != null and materialCode != '' ">
AND materialCode = #{materialCode}
|
|
25
|
</if>
|
|
26
27
28
29
30
31
32
33
|
<if test="materialName != null and materialName != ''">
<bind name="materialNamePattern" value="'%' + materialName + '%'" />
AND materialName like #{materialNamePattern}
</if>
<if test="materialSpec != null and materialSpec != ''">
<bind name="materialSpecPattern" value="'%' + materialSpec + '%'" />
AND materialSpec like #{materialSpecPattern}
</if>
|
|
34
|
<if test="qty != null ">
|
|
35
|
AND qty = #{qty}
|
|
36
|
</if>
|
|
37
|
<if test="params != null and params.createdBegin != null and params.createdBegin != ''">
|
|
38
|
AND created >= #{params.createdBegin}
|
|
39
40
|
</if>
<if test="params != null and params.createdEnd != null and params.createdEnd != ''">
|
|
41
|
AND created <= #{params.createdEnd}
|
|
42
|
</if>
|
|
43
44
|
<if test="createdBy != null and createdBy != ''">
<bind name="createdByPattern" value="'%' + createdBy + '%'" />
|
|
45
|
AND createdBy like #{createdByPattern}
|
|
46
47
48
49
50
|
</if>
</where>
</select>
<select id="selectListEntityByEqual" resultType="com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail">
|
|
51
|
SELECT id, headerId, receiptCode, receiptId, receiptDetailId, materialCode, materialName, materialSpec, qty, created, createdBy
|
|
52
53
54
55
56
57
58
59
|
FROM receipt_container_detail
<where>
<if test="id != null">
AND id = #{id}
</if>
<if test="headerId != null">
AND headerId = #{headerId}
</if>
|
|
60
61
62
|
<if test="receiptCode != null">
AND receiptCode = #{receiptCode}
</if>
|
|
63
64
65
|
<if test="receiptId != null">
AND receiptId = #{receiptId}
</if>
|
|
66
67
68
69
70
71
|
<if test="receiptDetailId != null">
AND receiptDetailId = #{receiptDetailId}
</if>
<if test="materialCode != null">
AND materialCode = #{materialCode}
</if>
|
|
72
73
74
75
76
77
|
<if test="materialName != null">
AND materialName = #{materialName}
</if>
<if test="materialSpec != null">
AND materialSpec = #{materialSpec}
</if>
|
|
78
79
80
81
82
83
84
85
86
87
88
89
90
|
<if test="qty != null">
AND qty = #{qty}
</if>
<if test="created != null">
AND created = #{created}
</if>
<if test="createdBy != null">
AND createdBy = #{createdBy}
</if>
</where>
</select>
<select id="selectListMapByEqual" resultType="java.util.HashMap">
|
|
91
|
SELECT ${columns} FROM receipt_container_detail
|
|
92
93
94
95
96
97
98
|
<where>
<if test="condition.id != null">
AND id = #{condition.id}
</if>
<if test="condition.headerId != null">
AND headerId = #{condition.headerId}
</if>
|
|
99
100
101
|
<if test="condition.receiptCode != null">
AND receiptCode = #{condition.receiptCode}
</if>
|
|
102
103
104
|
<if test="condition.receiptId != null">
AND receiptId = #{condition.receiptId}
</if>
|
|
105
106
107
108
109
110
|
<if test="condition.receiptDetailId != null">
AND receiptDetailId = #{condition.receiptDetailId}
</if>
<if test="condition.materialCode != null">
AND materialCode = #{condition.materialCode}
</if>
|
|
111
112
113
114
115
116
|
<if test="condition.materialName != null">
AND materialName = #{condition.materialName}
</if>
<if test="condition.materialSpec != null">
AND materialSpec = #{condition.materialSpec}
</if>
|
|
117
118
119
120
121
122
123
124
125
126
127
128
129
|
<if test="condition.qty != null">
AND qty = #{condition.qty}
</if>
<if test="condition.created != null">
AND created = #{condition.created}
</if>
<if test="condition.createdBy != null">
AND createdBy = #{condition.createdBy}
</if>
</where>
</select>
<select id="selectEntityById" resultType="com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail">
|
|
130
|
SELECT id, headerId, receiptCode, receiptId, receiptDetailId, materialCode, materialName, materialSpec, qty, created, createdBy FROM receipt_container_detail WHERE id = #{id}
|
|
131
132
133
|
</select>
<select id="selectFirstEntity" resultType="com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail">
|
|
134
|
SELECT id, headerId, receiptCode, receiptId, receiptDetailId, materialCode, materialName, materialSpec, qty, created, createdBy
|
|
135
136
137
138
139
140
141
142
|
FROM receipt_container_detail
<where>
<if test="id != null">
AND id = #{id}
</if>
<if test="headerId != null">
AND headerId = #{headerId}
</if>
|
|
143
144
145
|
<if test="receiptCode != null">
AND receiptCode = #{receiptCode}
</if>
|
|
146
147
148
|
<if test="receiptId != null">
AND receiptId = #{receiptId}
</if>
|
|
149
150
151
152
153
154
|
<if test="receiptDetailId != null">
AND receiptDetailId = #{receiptDetailId}
</if>
<if test="materialCode != null">
AND materialCode = #{materialCode}
</if>
|
|
155
156
157
158
159
160
|
<if test="materialName != null">
AND materialName = #{materialName}
</if>
<if test="materialSpec != null">
AND materialSpec = #{materialSpec}
</if>
|
|
161
|
<if test="qty != null">
|
|
162
163
164
165
166
167
168
169
170
171
172
173
174
|
AND qty = #{qty}
</if>
<if test="created != null">
AND created = #{created}
</if>
<if test="createdBy != null">
AND createdBy = #{createdBy}
</if>
</where>
LIMIT 1
</select>
<select id="selectFirstMap" resultType="java.util.HashMap">
|
|
175
|
SELECT ${columns} FROM receipt_container_detail
|
|
176
177
178
179
180
181
182
|
<where>
<if test="condition.id != null">
AND id = #{condition.id}
</if>
<if test="condition.headerId != null">
AND headerId = #{condition.headerId}
</if>
|
|
183
184
185
|
<if test="condition.receiptCode != null">
AND receiptCode = #{condition.receiptCode}
</if>
|
|
186
187
188
|
<if test="condition.receiptId != null">
AND receiptId = #{condition.receiptId}
</if>
|
|
189
190
191
192
193
194
|
<if test="condition.receiptDetailId != null">
AND receiptDetailId = #{condition.receiptDetailId}
</if>
<if test="condition.materialCode != null">
AND materialCode = #{condition.materialCode}
</if>
|
|
195
196
197
198
199
200
|
<if test="condition.materialName != null">
AND materialName = #{condition.materialName}
</if>
<if test="condition.materialSpec != null">
AND materialSpec = #{condition.materialSpec}
</if>
|
|
201
|
<if test="condition.qty != null">
|
|
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
|
AND qty = #{condition.qty}
</if>
<if test="condition.created != null">
AND created = #{condition.created}
</if>
<if test="condition.createdBy != null">
AND createdBy = #{condition.createdBy}
</if>
</where>
LIMIT 1
</select>
<insert id="insert" parameterType="com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail" keyProperty="id" useGeneratedKeys="true" >
INSERT INTO receipt_container_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="headerId != null">
headerId,
</if>
|
|
220
221
222
|
<if test="receiptCode != null">
receiptCode,
</if>
|
|
223
224
225
|
<if test="receiptId != null">
receiptId,
</if>
|
|
226
227
228
229
230
231
|
<if test="receiptDetailId != null">
receiptDetailId,
</if>
<if test="materialCode != null">
materialCode,
</if>
|
|
232
233
234
235
236
237
|
<if test="materialName != null">
materialName,
</if>
<if test="materialSpec != null">
materialSpec,
</if>
|
|
238
|
<if test="qty != null">
|
|
239
240
241
242
243
244
245
246
247
248
249
250
251
|
qty,
</if>
<if test="created != null">
created,
</if>
<if test="createdBy != null">
createdBy,
</if>
</trim>
<trim prefix=" values (" suffix=")" suffixOverrides=",">
<if test="headerId != null">
#{headerId, jdbcType=INTEGER},
</if>
|
|
252
253
254
|
<if test="receiptCode != null">
#{receiptCode, jdbcType=VARCHAR},
</if>
|
|
255
256
257
|
<if test="receiptId != null">
#{receiptId, jdbcType=INTEGER},
</if>
|
|
258
259
260
261
262
263
|
<if test="receiptDetailId != null">
#{receiptDetailId, jdbcType=INTEGER},
</if>
<if test="materialCode != null">
#{materialCode, jdbcType=VARCHAR},
</if>
|
|
264
265
266
267
268
269
|
<if test="materialName != null">
#{materialName, jdbcType=VARCHAR},
</if>
<if test="materialSpec != null">
#{materialSpec, jdbcType=VARCHAR},
</if>
|
|
270
|
<if test="qty != null">
|
|
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
|
#{qty, jdbcType=DECIMAL},
</if>
<if test="created != null">
#{created, jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
#{createdBy, jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByModel">
UPDATE receipt_container_detail
<set>
<if test="headerId != null">
headerId = #{headerId, jdbcType=INTEGER},
</if>
|
|
288
289
290
|
<if test="receiptCode != null">
receiptCode = #{receiptCode, jdbcType=VARCHAR},
</if>
|
|
291
292
293
|
<if test="receiptId != null">
receiptId = #{receiptId, jdbcType=INTEGER},
</if>
|
|
294
295
296
297
298
299
|
<if test="receiptDetailId != null">
receiptDetailId = #{receiptDetailId, jdbcType=INTEGER},
</if>
<if test="materialCode != null">
materialCode = #{materialCode, jdbcType=VARCHAR},
</if>
|
|
300
301
302
303
304
305
|
<if test="materialName != null">
materialName = #{materialName, jdbcType=VARCHAR},
</if>
<if test="materialSpec != null">
materialSpec = #{materialSpec, jdbcType=VARCHAR},
</if>
|
|
306
|
<if test="qty != null">
|
|
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
|
qty = #{qty, jdbcType=DECIMAL},
</if>
<if test="created != null">
created = #{created, jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
createdBy = #{createdBy, jdbcType=VARCHAR},
</if>
</set>
WHERE id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByCondition">
UPDATE receipt_container_detail
<set>
<if test="record.headerId != null">
headerId = #{record.headerId, jdbcType=INTEGER},
</if>
|
|
325
326
327
|
<if test="record.receiptCode != null">
receiptCode = #{record.receiptCode, jdbcType=VARCHAR},
</if>
|
|
328
329
330
|
<if test="record.receiptId != null">
receiptId = #{record.receiptId, jdbcType=INTEGER},
</if>
|
|
331
332
333
334
335
336
|
<if test="record.receiptDetailId != null">
receiptDetailId = #{record.receiptDetailId, jdbcType=INTEGER},
</if>
<if test="record.materialCode != null">
materialCode = #{record.materialCode, jdbcType=VARCHAR},
</if>
|
|
337
338
339
340
341
342
|
<if test="record.materialName != null">
materialName = #{record.materialName, jdbcType=VARCHAR},
</if>
<if test="record.materialSpec != null">
materialSpec = #{record.materialSpec, jdbcType=VARCHAR},
</if>
|
|
343
|
<if test="record.qty != null">
|
|
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
|
qty = #{record.qty, jdbcType=DECIMAL},
</if>
<if test="record.created != null">
created = #{record.created, jdbcType=TIMESTAMP},
</if>
<if test="record.createdBy != null">
createdBy = #{record.createdBy, 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>
|
|
360
361
362
|
<if test="condition.receiptCode != null">
AND receiptCode = #{condition.receiptCode}
</if>
|
|
363
364
365
|
<if test="condition.receiptId != null">
AND receiptId = #{condition.receiptId}
</if>
|
|
366
367
368
369
370
371
|
<if test="condition.receiptDetailId != null">
AND receiptDetailId = #{condition.receiptDetailId}
</if>
<if test="condition.materialCode != null">
AND materialCode = #{condition.materialCode}
</if>
|
|
372
373
374
375
376
377
|
<if test="condition.materialName != null">
AND materialName = #{condition.materialName}
</if>
<if test="condition.materialSpec != null">
AND materialSpec = #{condition.materialSpec}
</if>
|
|
378
|
<if test="condition.qty != null">
|
|
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
|
AND qty = #{condition.qty}
</if>
<if test="condition.created != null">
AND created = #{condition.created}
</if>
<if test="condition.createdBy != null">
AND createdBy = #{condition.createdBy}
</if>
</where>
</update>
<delete id="deleteById">
DELETE FROM receipt_container_detail WHERE id = #{id, jdbcType=INTEGER}
</delete>
<delete id="deleteByCondition">
DELETE FROM receipt_container_detail
<where>
<if test="id != null">
AND id = #{id}
</if>
<if test="headerId != null">
AND headerId = #{headerId}
</if>
|
|
403
404
405
|
<if test="receiptCode != null">
AND receiptCode = #{receiptCode}
</if>
|
|
406
407
408
|
<if test="receiptId != null">
AND receiptId = #{receiptId}
</if>
|
|
409
410
411
412
413
414
|
<if test="receiptDetailId != null">
AND receiptDetailId = #{receiptDetailId}
</if>
<if test="materialCode != null">
AND materialCode = #{materialCode}
</if>
|
|
415
416
417
418
419
420
|
<if test="materialName != null">
AND materialName = #{materialName}
</if>
<if test="materialSpec != null">
AND materialSpec = #{materialSpec}
</if>
|
|
421
|
<if test="qty != null">
|
|
422
423
424
425
426
427
428
429
430
431
432
433
434
435
|
AND qty = #{qty}
</if>
<if test="created != null">
AND created = #{created}
</if>
<if test="createdBy != null">
AND createdBy = #{createdBy}
</if>
</where>
</delete>
</mapper>
|