Commit 43f36fa7 by yinyong

sql修改

parent 3731e64c
...@@ -1244,17 +1244,17 @@ ...@@ -1244,17 +1244,17 @@
left join (select warehouse_code,hq_type from dc_base_warehouse where hq_type=#{jobParameter}) tb2 left join (select warehouse_code,hq_type from dc_base_warehouse where hq_type=#{jobParameter}) tb2
on tb1.warehouse_code=tb2.warehouse_code on tb1.warehouse_code=tb2.warehouse_code
LEFT JOIN dc_auto_turnover tb3 ON tb1.bailun_sku = tb3.bailun_sku and tb1.warehouse_code = tb3.warehouse_code LEFT JOIN dc_auto_turnover tb3 ON tb1.bailun_sku = tb3.bailun_sku and tb1.warehouse_code = tb3.warehouse_code
where tb2.warehouse_code is not null and tb2.bailun_sku is null order by tb1.id asc limit #{v1}, #{v2} where tb2.warehouse_code is not null and tb3.bailun_sku is null order by tb1.id asc limit #{v1}, #{v2}
</select> </select>
<select id="listWarehouseStockById" resultType="com.bailuntec.domain.entity.DcBaseStock"> <select id="listWarehouseStockById" resultType="com.bailuntec.domain.entity.DcBaseStock">
select * from dc_base_stock tb1 select * from dc_base_stock tb1
LEFT JOIN dc_auto_turnover tb3 ON tb1.bailun_sku = tb3.bailun_sku and tb1.warehouse_code = tb3.warehouse_code LEFT JOIN dc_auto_turnover tb3 ON tb1.bailun_sku = tb3.bailun_sku and tb1.warehouse_code = tb3.warehouse_code
where warehouse_code=#{warehouseCode} and tb2.bailun_sku is null order by id asc limit #{v1}, #{v2} where tb1.warehouse_code=#{warehouseCode} and tb3.bailun_sku is null order by id asc limit #{v1}, #{v2}
</select> </select>
<select id="listInStockNotInAutoTurnover" resultType="com.bailuntec.domain.entity.DcBaseStock"> <select id="listInStockNotInAutoTurnover" resultType="com.bailuntec.domain.entity.DcBaseStock">
SELECT tb1.* FROM dc_base_stock tb1 LEFT JOIN dc_auto_turnover tb2 ON tb1.bailun_sku = tb2.bailun_sku and tb1.warehouse_code = tb2.warehouse_code WHERE tb2.bailun_sku is null; SELECT tb1.* FROM dc_base_stock tb1 LEFT JOIN dc_auto_turnover tb2 ON tb1.bailun_sku = tb2.bailun_sku and tb1.warehouse_code = tb2.warehouse_code left join dc_base_sku tb3 on tb1.bailun_sku = tb3.bailun_sku WHERE tb2.bailun_sku is null and tb1.warehouse_code = 'GZBLWH' and tb3.buyer_name in ('黎艳漫', '李志民') and tb3.push_time > '2019-08-01'
</select> </select>
<select id="countByParam" resultType="long"> <select id="countByParam" resultType="long">
...@@ -1263,13 +1263,13 @@ ...@@ -1263,13 +1263,13 @@
left join (select warehouse_code,hq_type from dc_base_warehouse where hq_type=#{jobParameter}) tb2 left join (select warehouse_code,hq_type from dc_base_warehouse where hq_type=#{jobParameter}) tb2
on tb1.warehouse_code=tb2.warehouse_code on tb1.warehouse_code=tb2.warehouse_code
LEFT JOIN dc_auto_turnover tb3 ON tb1.bailun_sku = tb3.bailun_sku and tb1.warehouse_code = tb3.warehouse_code LEFT JOIN dc_auto_turnover tb3 ON tb1.bailun_sku = tb3.bailun_sku and tb1.warehouse_code = tb3.warehouse_code
where tb2.warehouse_code is not null and tb2.bailun_sku is null where tb2.warehouse_code is not null and tb3.bailun_sku is null
</select> </select>
<select id="countByWarehouseCode" resultType="long"> <select id="countByWarehouseCode" resultType="long">
select count(*) select count(*)
from dc_base_stock tb1 from dc_base_stock tb1
LEFT JOIN dc_auto_turnover tb3 ON tb1.bailun_sku = tb3.bailun_sku and tb1.warehouse_code = tb3.warehouse_code LEFT JOIN dc_auto_turnover tb3 ON tb1.bailun_sku = tb3.bailun_sku and tb1.warehouse_code = tb3.warehouse_code
where warehouse_code=#{warehouseCode} and tb2.bailun_sku is null where tb1.warehouse_code=#{warehouseCode} and tb3.bailun_sku is null
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment