Commit 3731e64c by yinyong

库存sql修改

parent 390b5d6c
......@@ -1242,11 +1242,15 @@
<select id="listParameterStockById" resultType="com.bailuntec.domain.entity.DcBaseStock">
select * from dc_base_stock tb1
left join (select warehouse_code,hq_type from dc_base_warehouse where hq_type=#{jobParameter}) tb2
on tb1.warehouse_code=tb2.warehouse_code where tb2.warehouse_code is not null order by tb1.id asc limit #{v1}, #{v2}
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
where tb2.warehouse_code is not null and tb2.bailun_sku is null order by tb1.id asc limit #{v1}, #{v2}
</select>
<select id="listWarehouseStockById" resultType="com.bailuntec.domain.entity.DcBaseStock">
select * from dc_base_stock tb1 where warehouse_code=#{warehouseCode} order by id asc limit #{v1}, #{v2}
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
where warehouse_code=#{warehouseCode} and tb2.bailun_sku is null order by id asc limit #{v1}, #{v2}
</select>
<select id="listInStockNotInAutoTurnover" resultType="com.bailuntec.domain.entity.DcBaseStock">
......@@ -1257,12 +1261,15 @@
select count(*)
from dc_base_stock tb1
left join (select warehouse_code,hq_type from dc_base_warehouse where hq_type=#{jobParameter}) tb2
on tb1.warehouse_code=tb2.warehouse_code where tb2.warehouse_code is not null;
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
where tb2.warehouse_code is not null and tb2.bailun_sku is null
</select>
<select id="countByWarehouseCode" resultType="long">
select count(*)
from dc_base_stock tb1
where warehouse_code=#{warehouseCode}
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
</select>
</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