(select COUNT(id) from logpm_distrilbution_bill_package
where stock_article_id = ldsa.id and packet_bar_status in (1,3) and bill_lading_id = #{param.billLadingId} ) handQuantity,
(select COUNT(id) from logpm_distribution_bill_lading_scan
where stock_article_id = ldsa.id and packet_bar_status in (1,3) and bill_lading_id = #{param.billLadingId} ) + (SELECT IFNULL(SUM(quantity),0) FROM logpm_distribution_reservation_zero_package WHERE stock_article_id = ldsa.id AND zero_package_status IN ( 1, 3 ) AND reservation_id = #{param.billLadingId}) handQuantity,
(select IFNULL(SUM(quantity),0) from logpm_distribution_bill_lading_scan
where stock_article_id = ldsa.id ) pick_up_quantity,
CASE
WHEN ( SELECT count( id ) FROM logpm_distribution_bill_lading_scan WHERE stock_article_id = ldsa.id ) = 0 THEN 10