from logpm_distribution_reservation_stocklist ldrs
left join logpm_distribution_stock_list ldst on ldst.id = ldrs.stocklist_id and ldst.is_deleted = 0
left join logpm_distribution_stock ldss on ldss.stock_list_id = ldst.id and ldss.reservation_id = #{reservationId} and ldss.is_deleted = 0
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldst.material_id and lwug.association_type = '4' and ldst.market_id = lwug.market_id and ldst.incoming_batch = lwug.incoming_batch
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldst.material_id and lwug.association_type = '4'
and ldst.market_id = lwug.market_id and ldst.incoming_batch = lwug.incoming_batch and ldst.warehouse_id = lwug.warehouse_id
where ldrs.reservation_id = #{reservationId}
and ldrs.is_deleted = 0
group by ldst.id, ldst.storage_location, ldst.description_goods, ldst.sku,ldrs.id,
from logpm_distribution_reservation_stocklist ldrs
LEFT JOIN logpm_distribution_stock_list ldsl on ldrs.stocklist_id = ldsl.id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldsl.material_id and lwug.association_type = '4' and ldsl.market_id = lwug.market_id
and ldsl.incoming_batch = lwug.incoming_batch
and ldsl.incoming_batch = lwug.incoming_batch and ldsl.warehouse_id = lwug.warehouse_id
LEFT JOIN logpm_distribution_stock_list ldsl on lddd.stock_list_id = ldsl.id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldsl.material_id and lwug.association_type = '4' and ldsl.market_id = lwug.market_id
and ldsl.incoming_batch = lwug.incoming_batch
and ldsl.incoming_batch = lwug.incoming_batch and ldsl.warehouse_id = lwug.warehouse_id
where lddd.id = #{param.deliveryDetailsId}
GROUP BY lwug.position_code ,lwug.allocation_id,lwug.allocation_title,lwug.num
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldrp.parce_list_id and lwug.association_type = 3
from logpm_distribution_reservation ldr
LEFT JOIN logpm_distribution_reservation_package ldrp on ldr.id = ldrp.reservation_id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldrp.parce_list_id and lwug.association_type = 3 and ldr.warehouse_id = lwug.warehouse_id
LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldrp.parce_list_id
<where>
ldrp.packet_bar_status in (1,3) and ldrp.reservation_id = #{param.reservationId}
ldrp.packet_bar_status in (1,3) and ldr.id = #{param.reservationId}
</where>
</select>
@ -363,7 +364,8 @@
) realNum,lddd.id deliveryDetailsId
from logpm_distribution_delivery_details lddd
LEFT JOIN logpm_distribution_stock_list ldsl on lddd.stock_list_id = ldsl.id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldsl.material_id and lwug.association_type = '4' and ldsl.market_id = lwug.market_id and ldsl.incoming_batch = lwug.incoming_batch
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldsl.material_id and lwug.association_type = '4'
and ldsl.market_id = lwug.market_id and ldsl.incoming_batch = lwug.incoming_batch and ldsl.warehouse_id = lwug.warehouse_id
where lddd.bill_lading_id = #{reservationId}
GROUP BY lddd.stock_list_id,ldsl.description_goods,ldsl.sku,ldsl.cargo_norms,lddd.quantity,ldsl.cargo_unit,ldsl.tray_name,ldsl.unpack,lddd.id