소스 검색

代储点粮情

lvzhikai 5 년 전
부모
커밋
349e78ffad
1개의 변경된 파일9개의 추가작업 그리고 6개의 파일을 삭제
  1. 9 6
      src/main/java/com/chinaitop/depot/agent/temperature/mapper/BusinessAgentTemperatureMapper.xml

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

@@ -652,8 +652,8 @@
652
     depot.depot_id agentOrgId,
652
     depot.depot_id agentOrgId,
653
     depot.depot_id agentStoreOrgId,
653
     depot.depot_id agentStoreOrgId,
654
     '0' sign,
654
     '0' sign,
655
-    depot.agent_depot_name agentName,
656
-    store.depot_name agentDepotName,
655
+    agent.agent_name agentName,
656
+    depot.agent_depot_name agentDepotName,
657
     store.storehouse_name storehouseName,
657
     store.storehouse_name storehouseName,
658
     tt.storehouse lspz,
658
     tt.storehouse lspz,
659
     tt.time detectionTime,
659
     tt.time detectionTime,
@@ -676,11 +676,14 @@
676
     tt.updatetime updatetime
676
     tt.updatetime updatetime
677
     FROM
677
     FROM
678
     business_agent_depot depot
678
     business_agent_depot depot
679
-    LEFT JOIN business_agent_storehouse agentStore ON depot.id = agentStore.agent_depot_id
680
-    AND agentStore.org_id = #{orgId,jdbcType=INTEGER}
681
-    LEFT JOIN basic_storehouse store ON store.storehouse_id = agentStore.storehouse_id
682
-    AND store.org_id = #{orgId,jdbcType=INTEGER}
679
+    LEFT JOIN business_agent agent ON depot.agent_id = agent.id
680
+    AND agent.org_id = #{orgId,jdbcType=INTEGER}
681
+    INNER JOIN business_agent_storehouse agentStore ON depot.id = agentStore.agent_depot_id
682
+    INNER JOIN basic_storehouse store ON store.storehouse_id = agentStore.storehouse_id
683
+    AND store.del_flag = 1
683
     LEFT JOIN t_testdata tt ON depot.depot_id = tt.org_id
684
     LEFT JOIN t_testdata tt ON depot.depot_id = tt.org_id
685
+    AND tt.storehouse = store.storehouse_code
686
+    AND tt.org_id != #{orgId,jdbcType=INTEGER}
684
     AND tt.updatetime >= depot.updatetime
687
     AND tt.updatetime >= depot.updatetime
685
     WHERE
688
     WHERE
686
     tt.iLq_yq = '0'
689
     tt.iLq_yq = '0'