Blame view

src/main/resources/mybatis/shipment/ShipmentContainerHeaderMapperAuto.xml 17.7 KB
1
<?xml version="1.0" encoding="UTF-8"?>
tangying authored
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.shipment.shipmentContainerHeader.mapper.ShipmentContainerHeaderMapperAuto">
4
  <select id="selectListEntityByLike" resultType="com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader">
5
   SELECT id, shipmentContainerCode, locationCode, warehouseId, warehouseCode, companyId, companyCode, taskType, taskTypeReal, status, created, createdBy  
6
7
   FROM shipment_container_header
  <where>
8
    <if test="id != null "> 
9
10
        AND id = #{id}
    </if>
11
12
    <if test="shipmentContainerCode != null and shipmentContainerCode != '' "> 
        AND shipmentContainerCode = #{shipmentContainerCode}
13
    </if>
14
15
    <if test="locationCode != null and locationCode != '' "> 
        AND locationCode = #{locationCode}
16
    </if>
17
    <if test="warehouseId != null "> 
18
19
        AND warehouseId = #{warehouseId}
    </if>
20
21
    <if test="warehouseCode != null and warehouseCode != '' "> 
        AND warehouseCode = #{warehouseCode}
22
    </if>
tangying authored
23
    <if test="companyIdList != null and companyIdList.size() > 0 "> 
24
25
26
27
28
        AND companyId in 
        <foreach collection="companyIdList" item="companyIdItem" open="(" separator="," close=")">
            #{companyIdItem}
        </foreach>
    </if>
29
30
31
    <if test="companyId != null "> 
        AND companyId = #{companyId}
    </if>
tangying authored
32
    <if test="companyCodeList != null and companyCodeList.size() > 0 "> 
33
34
35
36
37
        AND companyCode in 
        <foreach collection="companyCodeList" item="companyCodeItem" open="(" separator="," close=")">
            #{companyCodeItem}
        </foreach>
    </if>
38
39
40
    <if test="companyCode != null and companyCode != '' "> 
        AND companyCode = #{companyCode}
    </if>
41
    <if test="taskType != null and taskType != '' "> 
42
43
        AND taskType = #{taskType}
    </if>
44
    <if test="taskTypeReal != null and taskTypeReal != '' "> 
45
46
        AND taskTypeReal = #{taskTypeReal}
    </if>
47
    <if test="status != null "> 
48
49
        AND status = #{status}
    </if>
50
51
52
53
54
    <if test="params != null and params.createdBegin != null and params.createdBegin != ''"> 
        AND created &gt;= #{params.createdBegin}
    </if>
    <if test="params != null and params.createdEnd != null and params.createdEnd != ''"> 
        AND created &lt;= #{params.createdEnd}
55
    </if>
56
57
58
    <if test="createdBy != null and createdBy != ''"> 
        <bind name="createdByPattern" value="'%' + createdBy + '%'" />
        AND createdBy like #{createdByPattern}
59
60
61
62
63
    </if>
  </where>
  </select>

  <select id="selectListEntityByEqual" resultType="com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader">
64
   SELECT id, shipmentContainerCode, locationCode, warehouseId, warehouseCode, companyId, companyCode, taskType, taskTypeReal, status, created, createdBy  
65
66
67
68
69
70
71
72
   FROM shipment_container_header
  <where>
    <if test="id != null"> 
        AND id = #{id}
    </if>
    <if test="shipmentContainerCode != null"> 
        AND shipmentContainerCode = #{shipmentContainerCode}
    </if>
73
74
75
    <if test="locationCode != null"> 
        AND locationCode = #{locationCode}
    </if>
76
77
78
79
80
81
    <if test="warehouseId != null"> 
        AND warehouseId = #{warehouseId}
    </if>
    <if test="warehouseCode != null"> 
        AND warehouseCode = #{warehouseCode}
    </if>
tangying authored
82
    <if test="companyIdList != null and companyIdList.size() > 0 "> 
83
84
85
86
87
        AND companyId in 
        <foreach collection="companyIdList" item="companyIdItem" open="(" separator="," close=")">
            #{companyIdItem}
        </foreach>
    </if>
88
89
90
    <if test="companyId != null"> 
        AND companyId = #{companyId}
    </if>
tangying authored
91
    <if test="companyCodeList != null and companyCodeList.size() > 0 "> 
92
93
94
95
96
        AND companyCode in 
        <foreach collection="companyCodeList" item="companyCodeItem" open="(" separator="," close=")">
            #{companyCodeItem}
        </foreach>
    </if>
97
98
99
    <if test="companyCode != null"> 
        AND companyCode = #{companyCode}
    </if>
100
101
102
    <if test="taskType != null"> 
        AND taskType = #{taskType}
    </if>
103
104
105
    <if test="taskTypeReal != null"> 
        AND taskTypeReal = #{taskTypeReal}
    </if>
106
107
108
109
110
111
112
113
114
115
116
117
118
    <if test="status != null"> 
        AND status = #{status}
    </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">
119
      SELECT ${columns} FROM shipment_container_header
120
121
122
123
124
125
126
  <where>
    <if test="condition.id != null"> 
        AND id = #{condition.id}
    </if>
    <if test="condition.shipmentContainerCode != null"> 
        AND shipmentContainerCode = #{condition.shipmentContainerCode}
    </if>
127
128
129
    <if test="condition.locationCode != null"> 
        AND locationCode = #{condition.locationCode}
    </if>
130
131
132
133
134
135
    <if test="condition.warehouseId != null"> 
        AND warehouseId = #{condition.warehouseId}
    </if>
    <if test="condition.warehouseCode != null"> 
        AND warehouseCode = #{condition.warehouseCode}
    </if>
tangying authored
136
    <if test="condition.companyIdList != null and condition.companyIdList.size() > 0 "> 
137
        AND companyId in 
tangying authored
138
        <foreach collection="condition.companyIdList" item="companyIdItem" open="(" separator="," close=")">
139
140
141
            #{companyIdItem}
        </foreach>
    </if>
142
143
144
    <if test="condition.companyId != null"> 
        AND companyId = #{condition.companyId}
    </if>
tangying authored
145
    <if test="condition.companyCodeList != null and condition.companyCodeList.size() > 0 "> 
146
        AND companyCode in 
tangying authored
147
        <foreach collection="condition.companyCodeList" item="companyCodeItem" open="(" separator="," close=")">
148
149
150
            #{companyCodeItem}
        </foreach>
    </if>
151
152
153
    <if test="condition.companyCode != null"> 
        AND companyCode = #{condition.companyCode}
    </if>
154
155
156
    <if test="condition.taskType != null"> 
        AND taskType = #{condition.taskType}
    </if>
157
158
159
    <if test="condition.taskTypeReal != null"> 
        AND taskTypeReal = #{condition.taskTypeReal}
    </if>
160
161
162
163
164
165
166
167
168
169
170
171
172
    <if test="condition.status != null"> 
        AND status = #{condition.status}
    </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.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader">
173
      SELECT id, shipmentContainerCode, locationCode, warehouseId, warehouseCode, companyId, companyCode, taskType, taskTypeReal, status, created, createdBy  FROM shipment_container_header WHERE id = #{id}
174
175
176
  </select>

  <select id="selectFirstEntity" resultType="com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader">
177
  SELECT id, shipmentContainerCode, locationCode, warehouseId, warehouseCode, companyId, companyCode, taskType, taskTypeReal, status, created, createdBy  
178
179
180
181
182
183
184
185
  FROM shipment_container_header
  <where>
    <if test="id != null"> 
        AND id = #{id}
    </if>
    <if test="shipmentContainerCode != null"> 
        AND shipmentContainerCode = #{shipmentContainerCode}
    </if>
186
187
188
    <if test="locationCode != null"> 
        AND locationCode = #{locationCode}
    </if>
189
190
191
192
193
194
    <if test="warehouseId != null"> 
        AND warehouseId = #{warehouseId}
    </if>
    <if test="warehouseCode != null"> 
        AND warehouseCode = #{warehouseCode}
    </if>
tangying authored
195
    <if test="companyIdList != null and companyIdList.size() > 0 "> 
196
197
198
199
200
        AND companyId in 
        <foreach collection="companyIdList" item="companyIdItem" open="(" separator="," close=")">
            #{companyIdItem}
        </foreach>
    </if>
201
202
203
    <if test="companyId != null"> 
        AND companyId = #{companyId}
    </if>
tangying authored
204
    <if test="companyCodeList != null and companyCodeList.size() > 0 "> 
205
206
207
208
209
        AND companyCode in 
        <foreach collection="companyCodeList" item="companyCodeItem" open="(" separator="," close=")">
            #{companyCodeItem}
        </foreach>
    </if>
210
211
212
    <if test="companyCode != null"> 
        AND companyCode = #{companyCode}
    </if>
213
214
215
    <if test="taskType != null"> 
        AND taskType = #{taskType}
    </if>
216
217
218
    <if test="taskTypeReal != null"> 
        AND taskTypeReal = #{taskTypeReal}
    </if>
219
220
221
222
223
224
225
226
227
228
229
230
231
232
    <if test="status != null"> 
        AND status = #{status}
    </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">
233
      SELECT ${columns} FROM shipment_container_header
234
235
236
237
238
239
240
  <where>
    <if test="condition.id != null"> 
        AND id = #{condition.id}
    </if>
    <if test="condition.shipmentContainerCode != null"> 
        AND shipmentContainerCode = #{condition.shipmentContainerCode}
    </if>
241
242
243
    <if test="condition.locationCode != null"> 
        AND locationCode = #{condition.locationCode}
    </if>
244
245
246
247
248
249
    <if test="condition.warehouseId != null"> 
        AND warehouseId = #{condition.warehouseId}
    </if>
    <if test="condition.warehouseCode != null"> 
        AND warehouseCode = #{condition.warehouseCode}
    </if>
tangying authored
250
    <if test="condition.companyIdList != null  and condition.companyIdList.size() > 0 "> 
251
        AND companyId in 
tangying authored
252
        <foreach collection="condition.companyIdList" item="companyIdItem" open="(" separator="," close=")">
253
254
255
            #{companyIdItem}
        </foreach>
    </if>
256
257
258
    <if test="condition.companyId != null"> 
        AND companyId = #{condition.companyId}
    </if>
tangying authored
259
    <if test="condition.companyCodeList != null  and condition.companyCodeList.size() > 0 "> 
260
        AND companyCode in 
tangying authored
261
        <foreach collection="condition.companyCodeList" item="companyCodeItem" open="(" separator="," close=")">
262
263
264
            #{companyCodeItem}
        </foreach>
    </if>
265
266
267
    <if test="condition.companyCode != null"> 
        AND companyCode = #{condition.companyCode}
    </if>
268
269
270
    <if test="condition.taskType != null"> 
        AND taskType = #{condition.taskType}
    </if>
271
272
273
    <if test="condition.taskTypeReal != null"> 
        AND taskTypeReal = #{condition.taskTypeReal}
    </if>
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
    <if test="condition.status != null"> 
        AND status = #{condition.status}
    </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.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader" keyProperty="id" useGeneratedKeys="true" >
  INSERT INTO shipment_container_header 
  <trim prefix="(" suffix=")" suffixOverrides=",">
    <if test="shipmentContainerCode != null"> 
        shipmentContainerCode, 
    </if>
293
294
295
    <if test="locationCode != null"> 
        locationCode, 
    </if>
296
297
298
299
300
301
    <if test="warehouseId != null"> 
        warehouseId, 
    </if>
    <if test="warehouseCode != null"> 
        warehouseCode, 
    </if>
302
303
304
305
306
307
    <if test="companyId != null"> 
        companyId, 
    </if>
    <if test="companyCode != null"> 
        companyCode, 
    </if>
308
309
310
    <if test="taskType != null"> 
        taskType, 
    </if>
311
312
313
    <if test="taskTypeReal != null"> 
        taskTypeReal, 
    </if>
314
315
316
317
318
319
320
321
322
323
324
325
326
327
    <if test="status != null"> 
        status, 
    </if>
    <if test="created != null"> 
        created, 
    </if>
    <if test="createdBy != null"> 
        createdBy, 
    </if>
  </trim>
  <trim prefix=" values (" suffix=")" suffixOverrides=",">
    <if test="shipmentContainerCode != null"> 
        #{shipmentContainerCode, jdbcType=VARCHAR}, 
    </if>
328
329
330
    <if test="locationCode != null"> 
        #{locationCode, jdbcType=VARCHAR}, 
    </if>
331
332
333
334
335
336
    <if test="warehouseId != null"> 
        #{warehouseId, jdbcType=INTEGER}, 
    </if>
    <if test="warehouseCode != null"> 
        #{warehouseCode, jdbcType=VARCHAR}, 
    </if>
337
338
339
340
341
342
    <if test="companyId != null"> 
        #{companyId, jdbcType=INTEGER}, 
    </if>
    <if test="companyCode != null"> 
        #{companyCode, jdbcType=VARCHAR}, 
    </if>
343
344
345
    <if test="taskType != null"> 
        #{taskType, jdbcType=SMALLINT}, 
    </if>
346
347
348
    <if test="taskTypeReal != null"> 
        #{taskTypeReal, jdbcType=SMALLINT}, 
    </if>
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
    <if test="status != null"> 
        #{status, jdbcType=SMALLINT}, 
    </if>
    <if test="created != null"> 
        #{created, jdbcType=TIMESTAMP}, 
    </if>
    <if test="createdBy != null"> 
        #{createdBy, jdbcType=VARCHAR}, 
    </if>
  </trim>
  </insert>

  <update id="updateByModel">
  UPDATE shipment_container_header 
  <set>
    <if test="shipmentContainerCode != null"> 
        shipmentContainerCode = #{shipmentContainerCode, jdbcType=VARCHAR}, 
    </if>
367
368
369
    <if test="locationCode != null"> 
        locationCode = #{locationCode, jdbcType=VARCHAR}, 
    </if>
370
371
372
373
374
375
    <if test="warehouseId != null"> 
        warehouseId = #{warehouseId, jdbcType=INTEGER}, 
    </if>
    <if test="warehouseCode != null"> 
        warehouseCode = #{warehouseCode, jdbcType=VARCHAR}, 
    </if>
376
377
378
379
380
381
    <if test="companyId != null"> 
        companyId = #{companyId, jdbcType=INTEGER}, 
    </if>
    <if test="companyCode != null"> 
        companyCode = #{companyCode, jdbcType=VARCHAR}, 
    </if>
382
383
384
    <if test="taskType != null"> 
        taskType = #{taskType, jdbcType=SMALLINT}, 
    </if>
385
386
387
    <if test="taskTypeReal != null"> 
        taskTypeReal = #{taskTypeReal, jdbcType=SMALLINT}, 
    </if>
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
    <if test="status != null"> 
        status = #{status, jdbcType=SMALLINT}, 
    </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 shipment_container_header 
  <set>
    <if test="record.shipmentContainerCode != null"> 
        shipmentContainerCode = #{record.shipmentContainerCode, jdbcType=VARCHAR}, 
    </if>
407
408
409
    <if test="record.locationCode != null"> 
        locationCode = #{record.locationCode, jdbcType=VARCHAR}, 
    </if>
410
411
412
413
414
415
    <if test="record.warehouseId != null"> 
        warehouseId = #{record.warehouseId, jdbcType=INTEGER}, 
    </if>
    <if test="record.warehouseCode != null"> 
        warehouseCode = #{record.warehouseCode, jdbcType=VARCHAR}, 
    </if>
416
417
418
419
420
421
    <if test="record.companyId != null"> 
        companyId = #{record.companyId, jdbcType=INTEGER}, 
    </if>
    <if test="record.companyCode != null"> 
        companyCode = #{record.companyCode, jdbcType=VARCHAR}, 
    </if>
422
423
424
    <if test="record.taskType != null"> 
        taskType = #{record.taskType, jdbcType=SMALLINT}, 
    </if>
425
426
427
    <if test="record.taskTypeReal != null"> 
        taskTypeReal = #{record.taskTypeReal, jdbcType=SMALLINT}, 
    </if>
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
    <if test="record.status != null"> 
        status = #{record.status, jdbcType=SMALLINT}, 
    </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.shipmentContainerCode != null"> 
        AND shipmentContainerCode = #{condition.shipmentContainerCode}
    </if>
445
446
447
    <if test="condition.locationCode != null"> 
        AND locationCode = #{condition.locationCode}
    </if>
448
449
450
451
452
453
    <if test="condition.warehouseId != null"> 
        AND warehouseId = #{condition.warehouseId}
    </if>
    <if test="condition.warehouseCode != null"> 
        AND warehouseCode = #{condition.warehouseCode}
    </if>
454
455
456
457
458
459
    <if test="condition.companyId != null"> 
        AND companyId = #{condition.companyId}
    </if>
    <if test="condition.companyCode != null"> 
        AND companyCode = #{condition.companyCode}
    </if>
460
461
462
    <if test="condition.taskType != null"> 
        AND taskType = #{condition.taskType}
    </if>
463
464
465
    <if test="condition.taskTypeReal != null"> 
        AND taskTypeReal = #{condition.taskTypeReal}
    </if>
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
    <if test="condition.status != null"> 
        AND status = #{condition.status}
    </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 shipment_container_header WHERE id = #{id, jdbcType=INTEGER} 
  </delete>

  <delete id="deleteByCondition"> 
  DELETE FROM shipment_container_header 
  <where>
    <if test="id != null"> 
        AND id = #{id}
    </if>
    <if test="shipmentContainerCode != null"> 
        AND shipmentContainerCode = #{shipmentContainerCode}
    </if>
491
492
493
    <if test="locationCode != null"> 
        AND locationCode = #{locationCode}
    </if>
494
495
496
497
498
499
    <if test="warehouseId != null"> 
        AND warehouseId = #{warehouseId}
    </if>
    <if test="warehouseCode != null"> 
        AND warehouseCode = #{warehouseCode}
    </if>
500
501
502
503
504
505
    <if test="companyId != null"> 
        AND companyId = #{companyId}
    </if>
    <if test="companyCode != null"> 
        AND companyCode = #{companyCode}
    </if>
506
507
508
    <if test="taskType != null"> 
        AND taskType = #{taskType}
    </if>
509
510
511
    <if test="taskTypeReal != null"> 
        AND taskTypeReal = #{taskTypeReal}
    </if>
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
    <if test="status != null"> 
        AND status = #{status}
    </if>
    <if test="created != null"> 
        AND created = #{created}
    </if>
    <if test="createdBy != null"> 
        AND createdBy = #{createdBy}
    </if>
  </where>
  </delete>

  </mapper>