소스 검색

剩下的除了智能仓房的查询

lvzhikai 4 년 전
부모
커밋
d8bd3e0555

+ 4 - 1
src/main/java/com/chinaitop/depot/agent/basic/controller/AgentDepotController.java

@@ -56,12 +56,15 @@ public class AgentDepotController {
56 56
             @ApiImplicitParam(name = "agentId", value = "代储点id", paramType = "query"),
57 57
             @ApiImplicitParam(name = "orgid", value = "组织id", paramType = "query")
58 58
     })
59
-    public PageInfo<BusinessAgentDepot> getAgentDepotList(Integer pageNum, Integer pageSize,String agentDepotName,String orgid, String agentId){
59
+    public PageInfo<BusinessAgentDepot> getAgentDepotList(Integer pageNum, Integer pageSize,String agentDepotName,String agentName,String orgid, String agentId){
60 60
         Map<String,Object> map = new HashMap<>();
61 61
         map.put("orgId",orgid);
62 62
         if(ParameterUtil.isnotnull(agentDepotName)){
63 63
             map.put("agentDepotName","%" + agentDepotName + "%");
64 64
         }
65
+        if(ParameterUtil.isnotnull(agentName)){
66
+            map.put("agentName","%" + agentName + "%");
67
+        }
65 68
         if(ParameterUtil.isnotnull(agentId)){
66 69
             map.put("agentId",agentId);
67 70
         }

+ 6 - 4
src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentDepotMapper.xml

@@ -402,13 +402,14 @@
402 402
     depot.updatetime
403 403
     FROM
404 404
     business_agent_depot depot
405
+    LEFT JOIN business_agent agent ON agent.id = depot.agent_id
405 406
     WHERE
406 407
     depot.depot_id = 0 AND depot.del_flag = 1 AND depot.org_id = #{orgId,jdbcType=INTEGER}
407 408
     <if test="agentDepotName != null">
408 409
       AND depot.agent_depot_name LIKE #{agentDepotName,jdbcType=VARCHAR}
409 410
     </if>
410
-    <if test="agentId != null">
411
-      AND depot.agent_id LIKE #{agentId,jdbcType=VARCHAR}
411
+    <if test="agentName != null">
412
+      AND agent.agent_name LIKE #{agentName,jdbcType=VARCHAR}
412 413
     </if>
413 414
     UNION ALL
414 415
     SELECT
@@ -423,6 +424,7 @@
423 424
     depot.updatetime
424 425
     FROM
425 426
     business_agent_depot depot
427
+    LEFT JOIN business_agent agent ON agent.id = depot.agent_id
426 428
     LEFT JOIN org_info org ON org.org_id = depot.depot_id
427 429
     LEFT JOIN basic_enum depotType ON depotType.enumId = org.company_nature
428 430
     WHERE depot.org_id = #{orgId,jdbcType=INTEGER} AND depot.del_flag = 1
@@ -430,8 +432,8 @@
430 432
     <if test="agentDepotName != null">
431 433
       AND depot.agent_depot_name LIKE #{agentDepotName,jdbcType=VARCHAR}
432 434
     </if>
433
-    <if test="agentId != null">
434
-      AND depot.agent_id = #{agentId,jdbcType=VARCHAR}
435
+    <if test="agentName != null">
436
+      AND agent.agent_name LIKE #{agentName,jdbcType=VARCHAR}
435 437
     </if>
436 438
     ) t
437 439
     ORDER BY

+ 4 - 1
src/main/java/com/chinaitop/depot/agent/crk/controller/AgentQcController.java

@@ -73,7 +73,7 @@ public class AgentQcController {
73 73
             @ApiImplicitParam(name = "orgid", value = "组织id", paramType = "query")
74 74
     })
75 75
     public PageInfo<Map<String, Object>> getAgentQcList(Integer pageNum, Integer pageSize, Integer agentId, Integer agentDepotId,
76
-                                                                Integer storehouseId, Integer warehouseId, String businessType, Integer lspz, String orgid){
76
+      Integer storehouseId, Integer warehouseId, String businessType, Integer lspz, String orgid, String cph){
77 77
         Map<String,Object> map = new HashMap<>();
78 78
         map.put("orgId",orgid);
79 79
         if(ParameterUtil.isnotnull(agentId)){
@@ -98,6 +98,9 @@ public class AgentQcController {
98 98
         if(ParameterUtil.isnotnull(lspz)){
99 99
             map.put("lspz",lspz);
100 100
         }
101
+        if(ParameterUtil.isnotnull(cph)){
102
+            map.put("cph",cph);
103
+        }
101 104
 
102 105
         PageHelper.startPage(pageNum, pageSize);
103 106
         List<Map<String, Object>> list = agentQcService.getAgentQcList(map);

+ 6 - 0
src/main/java/com/chinaitop/depot/agent/crk/mapper/BusinessAgentQcMapper.xml

@@ -419,6 +419,9 @@
419 419
     <if test="lspz != null">
420 420
       AND qc.lspz = #{lspz,jdbcType=INTEGER}
421 421
     </if>
422
+    <if test="cph != null">
423
+      AND qc.car_brand = #{cph,jdbcType=VARCHAR}
424
+    </if>
422 425
     UNION ALL
423 426
     SELECT
424 427
         qc.id,qc.agent_id agentId,qc.agent_depot_id agentDepotId,depot.depot_id agentOrgId,qc.notice,qc.business_number businessNumber,qc.car_brand carBrand,
@@ -453,6 +456,9 @@
453 456
     <if test="lspz != null">
454 457
       AND qc.lspz = #{lspz,jdbcType=INTEGER}
455 458
     </if>
459
+    <if test="cph != null">
460
+      AND qc.car_brand = #{cph,jdbcType=VARCHAR}
461
+    </if>
456 462
     GROUP BY qc.business_number
457 463
     ) a
458 464
     ORDER BY a.crkTime DESC

+ 2 - 2
src/main/java/com/chinaitop/depot/agent/quality/mapper/BusinessAgentQualityMapper.xml

@@ -1976,10 +1976,10 @@
1976 1976
       LEFT JOIN storage_foodbasicinfo sfo ON sfo.house_id = sqk.house_id AND sfo.warehouse_id = sqk.warehouse_id
1977 1977
     <where>
1978 1978
       <if test="agentId !=null">
1979
-        and agent.agent_id = #{agentId}
1979
+        and agent.id = #{agentId}
1980 1980
       </if>
1981 1981
       <if test="agentDepotId !=null">
1982
-        and depot.agent_depot_id = #{agentDepotId}
1982
+        and depot.id = #{agentDepotId}
1983 1983
       </if>
1984 1984
       <if test="storehouseId !=null">
1985 1985
         and sqk.house_id = #{storehouseId}

+ 6 - 64
src/main/java/com/chinaitop/depot/agent/temperature/mapper/BusinessAgentTemperatureMapper.xml

@@ -588,60 +588,7 @@
588 588
   </update>
589 589
 
590 590
   <select id="getDataByExample" parameterType="java.util.Map" resultType="java.util.HashMap">
591
-    SELECT
592
-    temperAll.*
593
-    FROM
594
-    (
595
-    SELECT DISTINCT
596
-    temper.id id,
597
-    temper.org_id orgId,
598
-    depot.depot_id agentOrgId,
599
-    depot.depot_id agentStoreOrgId,
600
-    '1' sign,
601
-    depot.agent_depot_name agentDepotName,
602
-    store.storehouse_name storehouseName,
603
-    ba.agent_name agentName,
604
-    temper.lspz lspz,
605
-    temper.detection_time detectionTime,
606
-    temper.house_temperature houseTemperature,
607
-    temper.house_humidity houseHumidity,
608
-    temper.max max,
609
-    temper.min min,
610
-    temper.avg avg,
611
-    store.storehouse_type storehouseType,
612
-    store.design_capacity designCapacity,
613
-    temper.enter_time enterTime,
614
-    temper.nature nature,
615
-    temper.level level,
616
-    temper.actual_amount actualAmount,
617
-    temper.harvest_year harvestYear,
618
-    temper.gas_temperature gasTemperature,
619
-    temper.gas_humidity gasHumidity,
620
-    temper.keeper keeper,
621
-    temper.updatetime updatetime
622
-    FROM
623
-    business_agent_temperature temper
624
-    LEFT JOIN business_agent_depot depot ON depot.id = temper.agent_depot_id
625
-    AND depot.org_id = #{orgId,jdbcType=INTEGER}
626
-    LEFT JOIN basic_storehouse store ON store.storehouse_id = temper.storehouse_id
627
-    LEFT JOIN business_agent ba ON depot.org_id = ba.org_id
628
-    WHERE temper.org_id = #{orgId,jdbcType=INTEGER}
629
-    <if test="agentDepotId != null">
630
-      AND temper.agent_depot_id = #{agentDepotId,jdbcType=INTEGER}
631
-    </if>
632
-    <if test="storehouseId != null">
633
-      AND temper.storehouse_id = #{storehouseId,jdbcType=INTEGER}
634
-    </if>
635
-    <if test="startTime != null and endTime != null">
636
-      AND temper.detection_time BETWEEN #{startTime} AND #{endTime}
637
-    </if>
638
-    <if test="temperId != null">
639
-      AND temper.id = #{temperId,jdbcType=INTEGER}
640
-    </if>
641
-    <if test="lspz != null">
642
-      AND temper.lspz = #{lspz,jdbcType=INTEGER}
643
-    </if>
644
-    UNION ALL
591
+-- 去除手动添加的测温数据查询,如果需要可以去山西项目那,不过不推荐,测温表数据量过大,如果多方查询会造成查询过慢
645 592
     SELECT DISTINCT
646 593
     tt.id id,
647 594
     tt.org_id orgId,
@@ -649,7 +596,7 @@
649 596
     depot.depot_id agentStoreOrgId,
650 597
     '0' sign,
651 598
     depot.agent_depot_name agentDepotName,
652
-    store.storehouse_name storehouseName,
599
+    agentStore.storehouse_id storehouseName,
653 600
     ba.agent_name agentName,
654 601
     tt.storehouse lspz,
655 602
     tt.time detectionTime,
@@ -658,8 +605,6 @@
658 605
     tt.max max,
659 606
     tt.min min,
660 607
     tt.avg avg,
661
-    store.storehouse_type storehouseType,
662
-    store.design_capacity designCapacity,
663 608
     tt.storehouse enterTime,
664 609
     tt.storehouse nature,
665 610
     tt.storehouse level,
@@ -673,21 +618,19 @@
673 618
     business_agent_depot depot
674 619
     INNER JOIN business_agent_storehouse agentStore ON depot.id = agentStore.agent_depot_id
675 620
     INNER JOIN business_agent ba ON depot.org_id = ba.org_id
676
-    INNER JOIN basic_storehouse store ON store.storehouse_id = agentStore.storehouse_id
677
-    AND store.del_flag = 1
678 621
     LEFT JOIN t_testdata tt ON depot.depot_id = tt.org_id
679
-    AND tt.storehouse = store.storehouse_code
680 622
     AND tt.org_id != #{orgId,jdbcType=INTEGER}
681 623
     AND tt.updatetime >= depot.updatetime
682 624
     WHERE
683 625
     tt.iLq_yq = '0'
626
+    AND tt.org_id = #{orgId,jdbcType=INTEGER}
684 627
     AND depot.org_id = #{orgId,jdbcType=INTEGER}
685 628
     AND depot.del_flag = 1
686 629
     <if test="agentDepotId != null">
687 630
       AND depot.id = #{agentDepotId,jdbcType=INTEGER}
688 631
     </if>
689 632
     <if test="storehouseId != null">
690
-      AND store.storehouse_id = #{storehouseId,jdbcType=INTEGER}
633
+      AND agentStore.storehouse_id = #{storehouseId,jdbcType=INTEGER}
691 634
     </if>
692 635
     <if test="startTime != null and endTime != null">
693 636
       AND tt.time BETWEEN #{startTime} AND #{endTime}
@@ -695,10 +638,9 @@
695 638
     <if test="lspz != null and endTime != null">
696 639
       AND tt.storehouse = #{lspz,jdbcType=INTEGER}
697 640
     </if>
698
-    ) temperAll
699
-    WHERE temperAll.orgId IS NOT NULL AND temperAll.id IS NOT NULL
641
+    AND tt.org_id IS NOT NULL AND tt.id IS NOT NULL
700 642
     ORDER BY
701
-    temperAll.updatetime DESC
643
+    tt.updatetime DESC
702 644
   </select>
703 645
 
704 646
   <select id="getTestDataList" parameterType="java.util.Map" resultType="java.util.HashMap">