|
|
@ -616,28 +616,27 @@ |
|
|
|
LEFT JOIN logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id |
|
|
|
LEFT JOIN logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id |
|
|
|
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id |
|
|
|
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id |
|
|
|
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id |
|
|
|
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id |
|
|
|
LEFT JOIN |
|
|
|
<where> |
|
|
|
(SELECT ldsaa.id,SUM(ldpll.quantity) AS num |
|
|
|
ldsa.order_status in ('10','20','30','70') |
|
|
|
FROM logpm_distribution_stock_article ldsaa |
|
|
|
and ldsa.reservation_status in ('10','20') |
|
|
|
LEFT JOIN logpm_distribution_parcel_list ldpll ON ldsaa.id = ldpll.stock_article_id |
|
|
|
AND EXISTS ( |
|
|
|
WHERE ldpll.order_package_loading_status != '20' |
|
|
|
SELECT 1 |
|
|
|
AND ldpll.order_package_reservation_status !='20' |
|
|
|
FROM logpm_distribution_parcel_list ldpll |
|
|
|
|
|
|
|
WHERE |
|
|
|
|
|
|
|
ldsa.id = ldpll.stock_article_id |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AND ldpll.order_package_loading_status != '20' |
|
|
|
|
|
|
|
AND ldpll.order_package_reservation_status != '20' |
|
|
|
AND ldpll.order_package_status != '70' |
|
|
|
AND ldpll.order_package_status != '70' |
|
|
|
AND ldpll.conditions != 2 |
|
|
|
AND ldpll.conditions != 2 |
|
|
|
AND ldsaa.warehouse_id = #{par.warehouseId} |
|
|
|
|
|
|
|
AND ldpll.warehouse_id = #{par.warehouseId} |
|
|
|
AND ldpll.warehouse_id = #{par.warehouseId} |
|
|
|
AND ldsaa.type_service = #{par.typeService} |
|
|
|
AND ldsa.type_service = #{par.typeService} |
|
|
|
<if test="par.orderCode != null and par.orderCode != '' "> |
|
|
|
<if test="par.orderCode != null and par.orderCode != '' "> |
|
|
|
and ldsaa.order_code like concat(#{par.orderCode},'%') |
|
|
|
and ldpll.order_code like concat(#{par.orderCode},'%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
GROUP BY ldsaa.id |
|
|
|
GROUP BY ldpll.stock_article_id |
|
|
|
|
|
|
|
HAVING SUM(ldpll.quantity) > 0 |
|
|
|
) |
|
|
|
) |
|
|
|
AS t ON t.id = ldsa.id |
|
|
|
|
|
|
|
<where> |
|
|
|
|
|
|
|
ldsa.order_status in ('10','20','30','70') |
|
|
|
|
|
|
|
and ldsa.reservation_status in ('10','20') |
|
|
|
|
|
|
|
and t.num > 0 |
|
|
|
|
|
|
|
<!-- AND (ldsa.incoming_num - ldsa.delivery_quantity) > 0 --> |
|
|
|
|
|
|
|
AND ldsa.hand_quantity > 0 |
|
|
|
AND ldsa.hand_quantity > 0 |
|
|
|
<if test="par.warehouseId != null and par.warehouseId != '' "> |
|
|
|
<if test="par.warehouseId != null and par.warehouseId != '' "> |
|
|
|
and ldsa.warehouse_id = #{par.warehouseId} |
|
|
|
and ldsa.warehouse_id = #{par.warehouseId} |
|
|
|