|
|
|
@ -527,11 +527,12 @@
|
|
|
|
|
) trays , |
|
|
|
|
(select COUNT(DISTINCT id) |
|
|
|
|
from logpm_distrilbution_bill_stock |
|
|
|
|
where bill_lading_id = ldsi.reservation_id and order_status in (1,2) ) orderNum, |
|
|
|
|
where bill_lading_id = ldsi.reservation_id and order_status in (1,3) ) orderNum, |
|
|
|
|
( |
|
|
|
|
select COUNT(DISTINCT ldbs.id) |
|
|
|
|
from logpm_distrilbution_bill_package ldbs |
|
|
|
|
where ldbs.bill_lading_id = ldsi.reservation_id |
|
|
|
|
AND ldbs.packet_bar_status IN (1,3) |
|
|
|
|
) planNum, |
|
|
|
|
( |
|
|
|
|
select SUM(lddd.quantity) |
|
|
|
@ -724,35 +725,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectStockupClientInfoSelf" resultType="com.logpm.distribution.vo.DistributionStockupListVO"> |
|
|
|
|
select DISTINCT ldbs.bill_lading_id reservationId, GROUP_CONCAT(DISTINCT ldsa.mall_name SEPARATOR ',') customer, |
|
|
|
|
( |
|
|
|
|
select count(id) |
|
|
|
|
from logpm_distrilbution_bill_stock |
|
|
|
|
where bill_lading_id = ldsi.reservation_id |
|
|
|
|
) orderNum, |
|
|
|
|
|
|
|
|
|
SELECT DISTINCT |
|
|
|
|
ldbs.bill_lading_id reservationId, |
|
|
|
|
GROUP_CONCAT( DISTINCT ldsa.mall_name SEPARATOR ',' ) customer, |
|
|
|
|
( SELECT count( id ) FROM logpm_distrilbution_bill_stock WHERE bill_lading_id = ldsi.reservation_id AND order_status IN ( 1, 3 ) ) orderNum, |
|
|
|
|
( |
|
|
|
|
select count(ldpl.id) |
|
|
|
|
from logpm_distrilbution_bill_stock ldbs |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id =ldbs.stock_article_id |
|
|
|
|
where ldbs.bill_lading_id = ldsi.reservation_id |
|
|
|
|
SELECT |
|
|
|
|
IFNULL( sum( ldbl.packet_number ), 0 ) |
|
|
|
|
FROM |
|
|
|
|
logpm_distrilbution_bill_package ldbl |
|
|
|
|
WHERE |
|
|
|
|
ldbl.bill_lading_id = ldsi.reservation_id |
|
|
|
|
AND ldbl.packet_bar_status IN ( 1, 3 ) |
|
|
|
|
) + ( |
|
|
|
|
SELECT |
|
|
|
|
IFNULL( sum( ldrzp.quantity ), 0 ) |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_reservation_zero_package AS ldrzp |
|
|
|
|
WHERE |
|
|
|
|
ldrzp.reservation_id = ldsi.reservation_id |
|
|
|
|
AND ldrzp.type = 3 |
|
|
|
|
AND ldrzp.zero_package_status IN ( 1, 3 ) |
|
|
|
|
) planNum, |
|
|
|
|
( |
|
|
|
|
select COUNT(id) |
|
|
|
|
from logpm_distribution_stock |
|
|
|
|
where bill_lading_id = ldbs.bill_lading_id |
|
|
|
|
) stockupNum,lds.stockup_status stockupStatus ,lds.type_service typeService, |
|
|
|
|
( |
|
|
|
|
SELECT sum(lddd.quantity) |
|
|
|
|
from logpm_distribution_delivery_details lddd |
|
|
|
|
where lddd.bill_lading_id = ldsi.reservation_id |
|
|
|
|
) inventoryNub, |
|
|
|
|
GROUP_CONCAT(DISTINCT ldsa.mall_name) mallName |
|
|
|
|
from logpm_distribution_stockup lds |
|
|
|
|
LEFT JOIN logpm_distribution_stockup_info ldsi on lds.id = ldsi.stockup_id |
|
|
|
|
LEFT JOIN logpm_distrilbution_bill_stock ldbs on ldsi.reservation_id = ldbs.bill_lading_id |
|
|
|
|
LEFT JOIN logpm_distribution_stock_article ldsa on ldsa.id = ldbs.stock_article_id |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id |
|
|
|
|
( SELECT COUNT( id ) FROM logpm_distribution_stock WHERE bill_lading_id = ldbs.bill_lading_id ) stockupNum, |
|
|
|
|
lds.stockup_status stockupStatus, |
|
|
|
|
lds.type_service typeService, |
|
|
|
|
( SELECT IFNULL( sum( lddd.quantity ), 0 ) FROM logpm_distribution_delivery_details lddd WHERE lddd.bill_lading_id = ldsi.reservation_id ) inventoryNub, |
|
|
|
|
GROUP_CONCAT( DISTINCT ldsa.mall_name ) mallName |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_stockup lds |
|
|
|
|
LEFT JOIN logpm_distribution_stockup_info ldsi ON lds.id = ldsi.stockup_id |
|
|
|
|
LEFT JOIN logpm_distrilbution_bill_stock ldbs ON ldsi.reservation_id = ldbs.bill_lading_id |
|
|
|
|
LEFT JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldbs.stock_article_id |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list ldpl ON ldsa.id = ldpl.stock_article_id |
|
|
|
|
<where> |
|
|
|
|
lds.id = #{param.stockupId} |
|
|
|
|
</where> |
|
|
|
|