|
|
@@ -12,7 +12,7 @@
|
|
12
|
12
|
<result column="lspz" property="lspz" jdbcType="INTEGER" />
|
|
13
|
13
|
<result column="grain_number" property="grainNumber" jdbcType="VARCHAR" />
|
|
14
|
14
|
<result column="storehouse_id" property="storehouseId" jdbcType="VARCHAR" />
|
|
15
|
|
- <result column="warehouse_id" property="warehouseId" jdbcType="INTEGER" />
|
|
|
15
|
+ <result column="warehouse_id" property="warehouseId" jdbcType="VARCHAR" />
|
|
16
|
16
|
<result column="crk_time" property="crkTime" jdbcType="TIMESTAMP" />
|
|
17
|
17
|
<result column="org_id" property="orgId" jdbcType="INTEGER" />
|
|
18
|
18
|
<result column="sjly" property="sjly" jdbcType="INTEGER" />
|
|
|
@@ -122,7 +122,7 @@
|
|
122
|
122
|
values (#{id,jdbcType=INTEGER}, #{agentId,jdbcType=INTEGER}, #{agentDepotId,jdbcType=INTEGER},
|
|
123
|
123
|
#{notice,jdbcType=VARCHAR}, #{businessNumber,jdbcType=VARCHAR}, #{carBrand,jdbcType=VARCHAR},
|
|
124
|
124
|
#{businessType,jdbcType=VARCHAR}, #{lspz,jdbcType=INTEGER}, #{grainNumber,jdbcType=VARCHAR},
|
|
125
|
|
- #{storehouseId,jdbcType=VARCHAR}, #{warehouseId,jdbcType=INTEGER}, #{crkTime,jdbcType=TIMESTAMP},
|
|
|
125
|
+ #{storehouseId,jdbcType=VARCHAR}, #{warehouseId,jdbcType=VARCHAR}, #{crkTime,jdbcType=TIMESTAMP},
|
|
126
|
126
|
#{orgId,jdbcType=INTEGER}, #{sjly,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
|
|
127
|
127
|
#{updatetime,jdbcType=TIMESTAMP})
|
|
128
|
128
|
</insert>
|
|
|
@@ -210,7 +210,7 @@
|
|
210
|
210
|
#{storehouseId,jdbcType=VARCHAR},
|
|
211
|
211
|
</if>
|
|
212
|
212
|
<if test="warehouseId != null" >
|
|
213
|
|
- #{warehouseId,jdbcType=INTEGER},
|
|
|
213
|
+ #{warehouseId,jdbcType=VARCHAR},
|
|
214
|
214
|
</if>
|
|
215
|
215
|
<if test="crkTime != null" >
|
|
216
|
216
|
#{crkTime,jdbcType=TIMESTAMP},
|
|
|
@@ -269,7 +269,7 @@
|
|
269
|
269
|
storehouse_id = #{record.storehouseId,jdbcType=VARCHAR},
|
|
270
|
270
|
</if>
|
|
271
|
271
|
<if test="record.warehouseId != null" >
|
|
272
|
|
- warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
|
|
|
272
|
+ warehouse_id = #{record.warehouseId,jdbcType=VARCHAR},
|
|
273
|
273
|
</if>
|
|
274
|
274
|
<if test="record.crkTime != null" >
|
|
275
|
275
|
crk_time = #{record.crkTime,jdbcType=TIMESTAMP},
|
|
|
@@ -303,7 +303,7 @@
|
|
303
|
303
|
lspz = #{record.lspz,jdbcType=INTEGER},
|
|
304
|
304
|
grain_number = #{record.grainNumber,jdbcType=VARCHAR},
|
|
305
|
305
|
storehouse_id = #{record.storehouseId,jdbcType=VARCHAR},
|
|
306
|
|
- warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
|
|
|
306
|
+ warehouse_id = #{record.warehouseId,jdbcType=VARCHAR},
|
|
307
|
307
|
crk_time = #{record.crkTime,jdbcType=TIMESTAMP},
|
|
308
|
308
|
org_id = #{record.orgId,jdbcType=INTEGER},
|
|
309
|
309
|
sjly = #{record.sjly,jdbcType=INTEGER},
|
|
|
@@ -344,7 +344,7 @@
|
|
344
|
344
|
storehouse_id = #{storehouseId,jdbcType=VARCHAR},
|
|
345
|
345
|
</if>
|
|
346
|
346
|
<if test="warehouseId != null" >
|
|
347
|
|
- warehouse_id = #{warehouseId,jdbcType=INTEGER},
|
|
|
347
|
+ warehouse_id = #{warehouseId,jdbcType=VARCHAR},
|
|
348
|
348
|
</if>
|
|
349
|
349
|
<if test="crkTime != null" >
|
|
350
|
350
|
crk_time = #{crkTime,jdbcType=TIMESTAMP},
|
|
|
@@ -375,7 +375,7 @@
|
|
375
|
375
|
lspz = #{lspz,jdbcType=INTEGER},
|
|
376
|
376
|
grain_number = #{grainNumber,jdbcType=VARCHAR},
|
|
377
|
377
|
storehouse_id = #{storehouseId,jdbcType=VARCHAR},
|
|
378
|
|
- warehouse_id = #{warehouseId,jdbcType=INTEGER},
|
|
|
378
|
+ warehouse_id = #{warehouseId,jdbcType=VARCHAR},
|
|
379
|
379
|
crk_time = #{crkTime,jdbcType=TIMESTAMP},
|
|
380
|
380
|
org_id = #{orgId,jdbcType=INTEGER},
|
|
381
|
381
|
sjly = #{sjly,jdbcType=INTEGER},
|
|
|
@@ -408,10 +408,10 @@
|
|
408
|
408
|
AND qc.agent_depot_id = #{agentDepotId,jdbcType=INTEGER}
|
|
409
|
409
|
</if>
|
|
410
|
410
|
<if test="storehouseId != null">
|
|
411
|
|
- AND qc.storehouse_id = #{storehouseId,jdbcType=INTEGER}
|
|
|
411
|
+ AND qc.storehouse_id = #{storehouseId,jdbcType=VARCHAR}
|
|
412
|
412
|
</if>
|
|
413
|
413
|
<if test="warehouseId != null">
|
|
414
|
|
- AND qc.warehouse_id = #{warehouseId,jdbcType=INTEGER}
|
|
|
414
|
+ AND qc.warehouse_id = #{warehouseId,jdbcType=VARCHAR}
|
|
415
|
415
|
</if>
|
|
416
|
416
|
<if test="businessType != null">
|
|
417
|
417
|
AND qc.business_type = #{businessType,jdbcType=INTEGER}
|
|
|
@@ -442,10 +442,10 @@
|
|
442
|
442
|
AND qc.agent_depot_id = #{agentDepotId,jdbcType=INTEGER}
|
|
443
|
443
|
</if>
|
|
444
|
444
|
<if test="storehouseId != null">
|
|
445
|
|
- AND qc.storehouse_id = #{storehouseId,jdbcType=INTEGER}
|
|
|
445
|
+ AND qc.storehouse_id = #{storehouseId,jdbcType=VARCHAR}
|
|
446
|
446
|
</if>
|
|
447
|
447
|
<if test="warehouseId != null">
|
|
448
|
|
- AND qc.warehouse_id = #{warehouseId,jdbcType=INTEGER}
|
|
|
448
|
+ AND qc.warehouse_id = #{warehouseId,jdbcType=VARCHAR}
|
|
449
|
449
|
</if>
|
|
450
|
450
|
<if test="businessType != null">
|
|
451
|
451
|
AND qc.business_type = #{businessType,jdbcType=INTEGER}
|
|
|
@@ -454,22 +454,98 @@
|
|
454
|
454
|
AND qc.lspz = #{lspz,jdbcType=INTEGER}
|
|
455
|
455
|
</if>
|
|
456
|
456
|
GROUP BY qc.business_number
|
|
|
457
|
+ UNION
|
|
|
458
|
+ SELECT
|
|
|
459
|
+ qc.id,qc.agent_id agentId,qc.agent_depot_id agentDepotId,qc.notice,qc.business_number businessNumber,qc.car_brand carBrand,
|
|
|
460
|
+ qc.business_type businessType,qc.lspz,qc.grain_number grainNumber,qc.storehouse_id storehouseId,
|
|
|
461
|
+ qc.warehouse_id warehouseId,qc.crk_time crkTime,qc.org_id orgId,qc.create_time createTime,qc.sjly sjly,
|
|
|
462
|
+ '' warehouseName,tank.tank_name storehouseName,agent.agent_name agentName,
|
|
|
463
|
+ depot.agent_depot_name agentDepotName,qc.updatetime
|
|
|
464
|
+ FROM business_agent_qc qc
|
|
|
465
|
+ LEFT JOIN business_agent agent ON agent.id = qc.agent_id
|
|
|
466
|
+ LEFT JOIN business_agent_depot depot ON depot.id = qc.agent_depot_id
|
|
|
467
|
+ LEFT JOIN business_agent_tank tank ON tank.id=qc.storehouse_id
|
|
|
468
|
+ WHERE 1=1 AND qc.sjly=0 AND SUBSTR(qc.storehouse_id,1,2)='YG'
|
|
|
469
|
+ <if test="orgId != null">
|
|
|
470
|
+ AND qc.org_id = #{orgId,jdbcType=INTEGER}
|
|
|
471
|
+ </if>
|
|
|
472
|
+ <if test="agentId != null">
|
|
|
473
|
+ AND qc.agent_id = #{agentId,jdbcType=INTEGER}
|
|
|
474
|
+ </if>
|
|
|
475
|
+ <if test="agentDepotId != null">
|
|
|
476
|
+ AND qc.agent_depot_id = #{agentDepotId,jdbcType=INTEGER}
|
|
|
477
|
+ </if>
|
|
|
478
|
+ <if test="storehouseId != null">
|
|
|
479
|
+ AND qc.storehouse_id = #{storehouseId,jdbcType=VARCHAR}
|
|
|
480
|
+ </if>
|
|
|
481
|
+ <if test="warehouseId != null">
|
|
|
482
|
+ AND qc.warehouse_id = #{warehouseId,jdbcType=VARCHAR}
|
|
|
483
|
+ </if>
|
|
|
484
|
+ <if test="businessType != null">
|
|
|
485
|
+ AND qc.business_type = #{businessType,jdbcType=INTEGER}
|
|
|
486
|
+ </if>
|
|
|
487
|
+ <if test="lspz != null">
|
|
|
488
|
+ AND qc.lspz = #{lspz,jdbcType=INTEGER}
|
|
|
489
|
+ </if>
|
|
|
490
|
+ UNION
|
|
|
491
|
+ SELECT
|
|
|
492
|
+ qc.id,qc.agent_id agentId,qc.agent_depot_id agentDepotId,qc.notice,qc.business_number businessNumber,qc.car_brand carBrand,
|
|
|
493
|
+ qc.business_type businessType,qc.lspz,qc.grain_number grainNumber,qc.storehouse_id storehouseId,
|
|
|
494
|
+ qc.warehouse_id warehouseId,qc.crk_time crkTime,qc.org_id orgId,qc.create_time createTime,qc.sjly sjly,
|
|
|
495
|
+ '' warehouseName,tank.storageTank_name storehouseName,agent.agent_name agentName,
|
|
|
496
|
+ depot.agent_depot_name agentDepotName,qc.updatetime
|
|
|
497
|
+ FROM business_agent_qc qc
|
|
|
498
|
+ LEFT JOIN business_agent agent ON agent.id = qc.agent_id
|
|
|
499
|
+ LEFT JOIN business_agent_depot depot ON depot.id = qc.agent_depot_id
|
|
|
500
|
+ LEFT JOIN basic_tank tank ON tank.id=qc.storehouse_id
|
|
|
501
|
+ WHERE 1=1 AND qc.sjly=1 AND SUBSTR(qc.storehouse_id,1,2)='YG'
|
|
|
502
|
+ <if test="orgId != null">
|
|
|
503
|
+ AND qc.org_id = #{orgId,jdbcType=INTEGER}
|
|
|
504
|
+ </if>
|
|
|
505
|
+ <if test="agentId != null">
|
|
|
506
|
+ AND qc.agent_id = #{agentId,jdbcType=INTEGER}
|
|
|
507
|
+ </if>
|
|
|
508
|
+ <if test="agentDepotId != null">
|
|
|
509
|
+ AND qc.agent_depot_id = #{agentDepotId,jdbcType=INTEGER}
|
|
|
510
|
+ </if>
|
|
|
511
|
+ <if test="storehouseId != null">
|
|
|
512
|
+ AND qc.storehouse_id = #{storehouseId,jdbcType=VARCHAR}
|
|
|
513
|
+ </if>
|
|
|
514
|
+ <if test="warehouseId != null">
|
|
|
515
|
+ AND qc.warehouse_id = #{warehouseId,jdbcType=VARCHAR}
|
|
|
516
|
+ </if>
|
|
|
517
|
+ <if test="businessType != null">
|
|
|
518
|
+ AND qc.business_type = #{businessType,jdbcType=INTEGER}
|
|
|
519
|
+ </if>
|
|
|
520
|
+ <if test="lspz != null">
|
|
|
521
|
+ AND qc.lspz = #{lspz,jdbcType=INTEGER}
|
|
|
522
|
+ </if>
|
|
457
|
523
|
) a
|
|
458
|
524
|
ORDER BY a.updatetime DESC
|
|
459
|
525
|
</select>
|
|
460
|
526
|
|
|
461
|
527
|
<!-- 查询代储库仓房货位信息 -->
|
|
462
|
528
|
<select id="selectAgentHouseWareList" parameterType="java.util.Map" resultType="java.util.Map">
|
|
463
|
|
- SELECT
|
|
464
|
|
- a.depot_id+"" unitid,
|
|
465
|
|
- c.warehouse_id hwh,
|
|
466
|
|
- c.qccrk_tbsj modifydate
|
|
|
529
|
+ SELECT
|
|
|
530
|
+ a.depot_id+"" unitid,
|
|
|
531
|
+ c.warehouse_id hwh,
|
|
|
532
|
+ c.qccrk_tbsj modifydate
|
|
467
|
533
|
FROM business_agent_depot a
|
|
468
|
|
- LEFT JOIN business_agent_storehouse b ON b.agent_depot_id=a.id
|
|
469
|
|
- LEFT JOIN business_agent_warehouse c ON c.agent_storehouse_id=b.id
|
|
470
|
|
- WHERE a.depot_id != 0 AND b.storehouse_id IS NOT NULL AND c.warehouse_id IS NOT NULL
|
|
471
|
|
- <if test="orgId != null">
|
|
472
|
|
- and c.org_id=#{orgId,jdbcType=INTEGER}
|
|
473
|
|
- </if>
|
|
|
534
|
+ LEFT JOIN business_agent_storehouse b ON b.agent_depot_id=a.id
|
|
|
535
|
+ LEFT JOIN business_agent_warehouse c ON c.agent_storehouse_id=b.id AND c.del_flag=1
|
|
|
536
|
+ WHERE a.depot_id != 0 AND b.storehouse_id IS NOT NULL AND c.warehouse_id IS NOT NULL
|
|
|
537
|
+ <if test="orgId != null">
|
|
|
538
|
+ and c.org_id=#{orgId,jdbcType=INTEGER}
|
|
|
539
|
+ </if>
|
|
|
540
|
+ UNION
|
|
|
541
|
+ SELECT
|
|
|
542
|
+ a.depot_id unitid,
|
|
|
543
|
+ b.tank_id hwh,
|
|
|
544
|
+ b.qccrk_tbsj modifydate
|
|
|
545
|
+ FROM business_agent_depot a
|
|
|
546
|
+ INNER JOIN business_agent_tank_exist b ON b.agent_depot_id = a.id
|
|
|
547
|
+ <if test="orgId != null">
|
|
|
548
|
+ AND b.org_id = #{orgId,jdbcType=INTEGER}
|
|
|
549
|
+ </if>
|
|
474
|
550
|
</select>
|
|
475
|
551
|
</mapper>
|