|
|
|
@ -270,10 +270,10 @@
|
|
|
|
|
from wms_stock_total wst
|
|
|
|
|
left join wms_base_warehouse wbw on wbw.warehouse_id = wst.warehouse_id
|
|
|
|
|
left join mes_base_material_info mbmi on mbmi.material_id = wst.material_id
|
|
|
|
|
left join mes_sale_order mso on wst.sale_order_id = mso.sale_order_id
|
|
|
|
|
left join mes_sale_order mso on wst.sale_order_id = mso.sale_order_id and mso.is_flag = '1'
|
|
|
|
|
left join mes_base_unit_info mbui on mbmi.material_unit_id = mbui.erp_id
|
|
|
|
|
<where>
|
|
|
|
|
mso.is_flag = '1' and wst.total_amount > 0
|
|
|
|
|
wst.total_amount > 0
|
|
|
|
|
<if test="warehouseId != null ">and wst.warehouse_id = #{warehouseId}</if>
|
|
|
|
|
<if test="warehouseFloor != null ">and wst.warehouse_floor = #{warehouseFloor}</if>
|
|
|
|
|
<if test="stockType != null and stockType != ''">and wst.stock_type = #{stockType}</if>
|
|
|
|
@ -325,9 +325,8 @@
|
|
|
|
|
from wms_stock_total wst
|
|
|
|
|
left join wms_base_warehouse wbw on wbw.warehouse_id = wst.warehouse_id
|
|
|
|
|
left join mes_base_material_info mbmi on mbmi.material_id = wst.material_id
|
|
|
|
|
left join mes_sale_order mso on wst.sale_order_id=mso.sale_order_id
|
|
|
|
|
left join mes_sale_order mso on wst.sale_order_id=mso.sale_order_id and mso.is_flag = '1'
|
|
|
|
|
<where>
|
|
|
|
|
mso.is_flag = '1'
|
|
|
|
|
<if test="warehouseId != null ">and wst.warehouse_id = #{warehouseId}</if>
|
|
|
|
|
<if test="warehouseFloor != null ">and wst.warehouse_floor = #{warehouseFloor}</if>
|
|
|
|
|
<if test="warehouseType != null and warehouseType != ''">and wbw.warehouse_type = #{warehouseType}</if>
|
|
|
|
|