(SELECT count(id) FROM logpm_distribution_bill_lading_scan ldbls WHERE ldbls.stock_list_id = lddd.stock_list_id and ldbls.material_type = 1 and
(SELECT count(id) FROM logpm_distribution_bill_lading_scan ldbls WHERE ldbls.bill_lading_id = lddd.bill_lading_id AND ldbls.stock_list_id = lddd.stock_list_id and ldbls.material_type = 1 and ldbls.scan_type=1 ) AS pickUpQuantity,
ldbls.bill_lading_id=#{param.billLadingId}
) AS pick_up_quantity,
CASE
CASE
WHEN ( SELECT count( id ) FROM logpm_distribution_bill_lading_scan ldbls WHERE ldbls.stock_list_id = lddd.stock_list_id AND ldbls.material_type = 1 ) = 0 THEN
WHEN ( SELECT count( id ) FROM logpm_distribution_bill_lading_scan ldbls WHERE ldbls.stock_list_id = lddd.stock_list_id AND ldbls.material_type = 1 ) = 0 THEN
'待提货'
'待提货'
WHEN lddd.quantity - ( SELECT count( id ) FROM logpm_distribution_bill_lading_scan ldbls WHERE ldbls.stock_list_id = lddd.stock_list_id AND ldbls.material_type = 1 ) > 0 THEN
WHEN lddd.quantity - ( SELECT count( id ) FROM logpm_distribution_bill_lading_scan ldbls WHERE ldbls.stock_list_id = lddd.stock_list_id AND ldbls.material_type = 1 ) > 0 THEN