|
|
@@ -1676,10 +1676,10 @@
|
|
1676
|
1676
|
depot.agent_depot_name agentDepotName,
|
|
1677
|
1677
|
'0' AS stateType
|
|
1678
|
1678
|
FROM business_agent_quality sqk
|
|
1679
|
|
- LEFT JOIN basic_storehouse store ON store.storehouse_id = sqk.storehouse_id AND store.library_type = 1
|
|
1680
|
|
- LEFT JOIN basic_warehouse ware ON ware.warehouse_id = sqk.warehouse_id AND ware.library_type = 1
|
|
1681
|
|
- LEFT JOIN basic_tank bb on bb.id = sqk.tank_id
|
|
1682
|
|
- LEFT JOIN storage_foodbasicinfo sfo on sfo.house_id = sqk.storehouse_id and sfo.warehouse_id = sqk.warehouse_id
|
|
|
1679
|
+ LEFT JOIN basic_storehouse store ON store.storehouse_id = sqk.storehouse_id
|
|
|
1680
|
+ LEFT JOIN basic_warehouse ware ON ware.warehouse_id = sqk.warehouse_id
|
|
|
1681
|
+ LEFT JOIN storage_foodbasicinfo sfo ON sfo.house_id = sqk.storehouse_id AND sfo.warehouse_id = sqk.warehouse_id
|
|
|
1682
|
+ LEFT JOIN basic_tank bb ON bb.id = sqk.tank_id
|
|
1683
|
1683
|
LEFT JOIN business_agent agent ON agent.id = sqk.agent_id
|
|
1684
|
1684
|
LEFT JOIN business_agent_depot depot ON depot.id = sqk.agent_depot_id
|
|
1685
|
1685
|
<where>
|
|
|
@@ -1722,63 +1722,6 @@
|
|
1722
|
1722
|
UNION ALL
|
|
1723
|
1723
|
select
|
|
1724
|
1724
|
<include refid="ExtBase_Column_List"/>,
|
|
1725
|
|
- sqk.agent_id,sqk.agent_depot_id,sqk.storehouse_id,
|
|
1726
|
|
- bstore.storeHouse_name storehouseName,
|
|
1727
|
|
- bware.warehouse_name wareHouseName,
|
|
1728
|
|
- bb.storageTank_name tankName,
|
|
1729
|
|
- sfo.id foodbasicinfoId,
|
|
1730
|
|
- agent.agent_name agentName,
|
|
1731
|
|
- depot.agent_depot_name agentDepotName,
|
|
1732
|
|
- '0' AS stateType
|
|
1733
|
|
- FROM business_agent_quality sqk
|
|
1734
|
|
- INNER JOIN business_agent_storehouse aStore ON aStore.storehouse_id = sqk.storehouse_id
|
|
1735
|
|
- INNER JOIN business_agent_warehouse aWare ON aWare.warehouse_id = sqk.warehouse_id
|
|
1736
|
|
- LEFT JOIN basic_storehouse bstore ON bstore.storehouse_id = aStore.storehouse_id
|
|
1737
|
|
- LEFT JOIN basic_warehouse bware ON bware.warehouse_id = aWare.warehouse_id
|
|
1738
|
|
- LEFT JOIN basic_tank bb on bb.id = sqk.tank_id
|
|
1739
|
|
- LEFT JOIN storage_foodbasicinfo sfo on sfo.house_id = aStore.storehouse_id and sfo.warehouse_id = aWare.warehouse_id
|
|
1740
|
|
- LEFT JOIN business_agent agent ON agent.id = sqk.agent_id
|
|
1741
|
|
- LEFT JOIN business_agent_depot depot ON depot.id = sqk.agent_depot_id
|
|
1742
|
|
- <where>
|
|
1743
|
|
- <if test="agentId !=null">
|
|
1744
|
|
- and sqk.agent_id = #{agentId}
|
|
1745
|
|
- </if>
|
|
1746
|
|
- <if test="agentDepotId !=null">
|
|
1747
|
|
- and sqk.agent_depot_id = #{agentDepotId}
|
|
1748
|
|
- </if>
|
|
1749
|
|
- <if test="storehouseId !=null">
|
|
1750
|
|
- and sqk.storehouse_id = #{storehouseId}
|
|
1751
|
|
- </if>
|
|
1752
|
|
- <if test="warehouseId !=null">
|
|
1753
|
|
- and sqk.warehouse_id = #{warehouseId}
|
|
1754
|
|
- </if>
|
|
1755
|
|
- <if test="tankId !=null">
|
|
1756
|
|
- and sqk.tank_id = #{tankId}
|
|
1757
|
|
- </if>
|
|
1758
|
|
- <if test="type !=null">
|
|
1759
|
|
- and sqk.type = #{type}
|
|
1760
|
|
- </if>
|
|
1761
|
|
- <if test="subTypeDetailed !=null">
|
|
1762
|
|
- and sqk.sub_type_detailed = #{subTypeDetailed}
|
|
1763
|
|
- </if>
|
|
1764
|
|
- <if test="level !=null">
|
|
1765
|
|
- and sqk.level = #{level}
|
|
1766
|
|
- </if>
|
|
1767
|
|
- <if test="historyStatus !=null">
|
|
1768
|
|
- and sqk.history_status = #{historyStatus}
|
|
1769
|
|
- </if>
|
|
1770
|
|
- <if test="sealStatus !=null">
|
|
1771
|
|
- and sqk.seal_status = #{sealStatus}
|
|
1772
|
|
- </if>
|
|
1773
|
|
- <if test="checkResult !=null">
|
|
1774
|
|
- and sqk.check_result = #{checkResult}
|
|
1775
|
|
- </if>
|
|
1776
|
|
- AND sqk.org_id = #{orgId}
|
|
1777
|
|
- </where>
|
|
1778
|
|
- GROUP BY sqk.id
|
|
1779
|
|
- UNION ALL
|
|
1780
|
|
- select
|
|
1781
|
|
- <include refid="ExtBase_Column_List"/>,
|
|
1782
|
1725
|
depot.agent_id ,depot.id agent_depot_id,sqk.house_id storehouse_id,
|
|
1783
|
1726
|
store.storeHouse_name storehouseName,
|
|
1784
|
1727
|
ware.warehouse_name wareHouseName,
|
|
|
@@ -1799,10 +1742,10 @@
|
|
1799
|
1742
|
LEFT JOIN storage_foodbasicinfo sfo ON sfo.house_id = sqk.house_id AND sfo.warehouse_id = sqk.warehouse_id
|
|
1800
|
1743
|
<where>
|
|
1801
|
1744
|
<if test="agentId !=null">
|
|
1802
|
|
- and agent.agent_id = #{agentId}
|
|
|
1745
|
+ and agent.id = #{agentId}
|
|
1803
|
1746
|
</if>
|
|
1804
|
1747
|
<if test="agentDepotId !=null">
|
|
1805
|
|
- and depot.agent_depot_id = #{agentDepotId}
|
|
|
1748
|
+ and depot.id = #{agentDepotId}
|
|
1806
|
1749
|
</if>
|
|
1807
|
1750
|
<if test="storehouseId !=null">
|
|
1808
|
1751
|
and sqk.house_id = #{storehouseId}
|