diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml index 13f078554..3bd62a9b2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml @@ -41,24 +41,13 @@ GROUP_CONCAT(DISTINCT dsa.customer_telephone) customerTelephone,dsa.warehouse,dsa.warehouse_entry_time warehouseEntryTime,dsa.storage_fee storageFee, - count( dbp.packet_number )+IFNULL((SELECT SUM(quantity) FROM logpm_distribution_reservation_zero_package WHERE reservation_id = dbl.id AND zero_package_status !=2),0) + IFNULL((SELECT SUM(quantity) FROM logpm_distribution_delivery_details WHERE bill_lading_id = dbl.id AND inventory_status != 2),0)AS totalNumber, + IFNULL((SELECT SUM(packet_number) FROM logpm_distrilbution_bill_package WHERE bill_lading_id = dbl.id AND packet_bar_status != 2),0)+IFNULL((SELECT SUM(quantity) FROM logpm_distribution_reservation_zero_package WHERE reservation_id = dbl.id AND zero_package_status !=2),0) + IFNULL((SELECT SUM(quantity) FROM logpm_distribution_delivery_details WHERE bill_lading_id = dbl.id AND inventory_status != 2),0)AS totalNumber, dbl.certificate_type certificateType, GROUP_CONCAT(DISTINCT dsa.brand) brand,dsa.type_service typeService, dbl.pick_up_time pickUpTime,dbl.consignee,dbl.delivery_document deliveryDocument,dbl.conditions, dbl.total_cost totalCost, dbl.pick_up_plate pickUpPlate,dbl.pickup_batch pickupBatch, - ( select COUNT(id) from logpm_distribution_bill_lading_scan @@ -81,9 +70,8 @@ GROUP BY id ) AS productInformation from logpm_distrilbution_bill_lading dbl - LEFT JOIN logpm_distrilbution_bill_package dbp on dbp.bill_lading_id = dbl.id and dbp.packet_bar_status in (1,3) - LEFT JOIN logpm_distribution_reservation_zero_package ldrzp on ldrzp.reservation_id = dbl.id and ldrzp.stock_status in (1,3) - LEFT JOIN logpm_distribution_stock_article dsa on dbp.stock_article_id = dsa.id OR ldrzp.stock_article_id = dsa.id + LEFT JOIN logpm_distrilbution_bill_stock AS lds on lds.bill_lading_id = dbl.id + LEFT JOIN logpm_distribution_stock_article dsa on lds.stock_article_id = dsa.id dbl.is_deleted = 0 and dsa.service_number like