lvzhikai 5 yıl önce
ebeveyn
işleme
6d0c647d2f

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

@@ -675,17 +675,17 @@
675
     tt.storehouse keeper,
675
     tt.storehouse keeper,
676
     tt.updatetime updatetime
676
     tt.updatetime updatetime
677
     FROM
677
     FROM
678
-    business_agent_temperature temper
679
-    LEFT JOIN business_agent agent ON agent.id = temper.agent_id
680
-    AND agent.org_id = #{orgId,jdbcType=INTEGER}
681
-    LEFT JOIN business_agent_depot depot ON depot.id = temper.agent_depot_id
682
-    AND depot.org_id = #{orgId,jdbcType=INTEGER}
683
-    LEFT JOIN basic_storehouse store ON store.storehouse_id = temper.storehouse_id
684
-    AND store.library_type = 1
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
685
     AND store.org_id = #{orgId,jdbcType=INTEGER}
682
     AND store.org_id = #{orgId,jdbcType=INTEGER}
686
-    LEFT JOIN t_testdata tt ON tt.storehouse = store.storehouse_code
687
-    AND depot.depot_id = tt.org_id
688
-    WHERE tt.iLq_yq = '0'
683
+    LEFT JOIN t_testdata tt ON depot.depot_id = tt.org_id
684
+    AND tt.updatetime >= depot.updatetime
685
+    WHERE
686
+    tt.iLq_yq = '0'
687
+    AND depot.org_id = #{orgId,jdbcType=INTEGER}
688
+    AND depot.del_flag = 1
689
     <if test="agentId != null">
689
     <if test="agentId != null">
690
       AND agent.id = #{agentId,jdbcType=INTEGER}
690
       AND agent.id = #{agentId,jdbcType=INTEGER}
691
     </if>
691
     </if>