|
|
@@ -675,17 +675,17 @@
|
|
675
|
675
|
tt.storehouse keeper,
|
|
676
|
676
|
tt.updatetime updatetime
|
|
677
|
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
|
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
|
689
|
<if test="agentId != null">
|
|
690
|
690
|
AND agent.id = #{agentId,jdbcType=INTEGER}
|
|
691
|
691
|
</if>
|