|
|
|
@ -83,6 +83,32 @@
|
|
|
|
|
</where> |
|
|
|
|
GROUP BY lds.id |
|
|
|
|
</select> |
|
|
|
|
<select id="getInventoryOwnSelf" resultType="com.logpm.distribution.vo.DistributionStockupVO"> |
|
|
|
|
select DISTINCT ldsii.sku,ldsii.cargo_unit cargoUnit,lds.stockup_status stockupStatus,lds.stockup_date stockupDate,lds.stockup_area stockupArea,ldsii.description_goods descriptionGoods |
|
|
|
|
,lddd.quantity reservationNum,ldsii.order_code orderCode, |
|
|
|
|
( |
|
|
|
|
select GROUP_CONCAT(DISTINCT tray_code) |
|
|
|
|
from logpm_warehouse_tray_goods |
|
|
|
|
where association_id = ldsii.id and market_id = ldsii.market_id |
|
|
|
|
) pallet , |
|
|
|
|
( |
|
|
|
|
select GROUP_CONCAT(DISTINCT position_code) |
|
|
|
|
from logpm_warehouse_updown_goods |
|
|
|
|
where association_id = ldsii.id and market_id = ldsii.market_id |
|
|
|
|
) goodsAllocation, |
|
|
|
|
( |
|
|
|
|
select count(1) |
|
|
|
|
from logpm_distribution_stock ds |
|
|
|
|
WHERE ds.stock_list_id = ldsii.id and ds.bill_lading_id = lddd.bill_lading_id |
|
|
|
|
) number |
|
|
|
|
from logpm_distribution_stockup lds |
|
|
|
|
LEFT JOIN logpm_distribution_stockup_info ldsi on lds.id = ldsi.stockup_id |
|
|
|
|
LEFT JOIN logpm_distribution_delivery_details lddd on lddd.bill_lading_id = ldsi.reservation_id |
|
|
|
|
LEFT JOIN logpm_distribution_stock_list ldsii on ldsii.id = lddd.stock_list_id |
|
|
|
|
<where> |
|
|
|
|
ldsi.stockup_id =#{id} |
|
|
|
|
</where> |
|
|
|
|
</select> |
|
|
|
|
<select id="pageOweList" resultType="com.logpm.distribution.vo.DistributionStockupVO"> |
|
|
|
|
select DISTINCT lds.id,lds.stockup_date stockupDate, lds.stockup_user stockupUser, lds.stockup_status stockupStatus, lds.stockup_area stockupArea, |
|
|
|
|
lds.assign_status assignStatus, lds.goods_area_id goodsAreaId, lds.forklift_name forkliftName, |
|
|
|
@ -152,7 +178,7 @@
|
|
|
|
|
where ds.id = lds.id |
|
|
|
|
) orderNum , |
|
|
|
|
( |
|
|
|
|
select COUNT(ldrp.id) |
|
|
|
|
select COUNT(DISTINCT ldrp.id) |
|
|
|
|
from logpm_distribution_stockup ds |
|
|
|
|
LEFT JOIN logpm_distribution_stockup_info ldsi on ds.id = ldsi.stockup_id |
|
|
|
|
LEFT JOIN logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id and ldrp.packet_bar_status in (1,3) |
|
|
|
@ -215,11 +241,11 @@
|
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldbs.stock_article_id |
|
|
|
|
where ldbs.bill_lading_id = ldsi.reservation_id) |
|
|
|
|
) trays , |
|
|
|
|
(select COUNT(id) |
|
|
|
|
(select COUNT(DISTINCT id) |
|
|
|
|
from logpm_distrilbution_bill_stock |
|
|
|
|
where bill_lading_id = ldsi.reservation_id and order_status in (1,2) ) orderNum, |
|
|
|
|
( |
|
|
|
|
select COUNT(ldbs.id) |
|
|
|
|
select COUNT(DISTINCT ldbs.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 |
|
|
|
@ -230,7 +256,7 @@
|
|
|
|
|
where lddd.bill_lading_id = ldbs.bill_lading_id |
|
|
|
|
) inventoryNub, |
|
|
|
|
( |
|
|
|
|
select COUNT(id) |
|
|
|
|
select COUNT(DISTINCT id) |
|
|
|
|
from logpm_distribution_stock |
|
|
|
|
where parcel_list_id in ( |
|
|
|
|
select id |
|
|
|
@ -238,7 +264,7 @@
|
|
|
|
|
where ldbs.stock_article_id = stock_article_id |
|
|
|
|
) |
|
|
|
|
)+( |
|
|
|
|
select COUNT(lds.id) |
|
|
|
|
select COUNT(DISTINCT lds.id) |
|
|
|
|
from logpm_distribution_delivery_details lddd |
|
|
|
|
LEFT JOIN logpm_distribution_stock lds on lddd.stock_list_id = lds.stock_list_id |
|
|
|
|
where lds.bill_lading_id =ldbs.bill_lading_id |
|
|
|
@ -554,9 +580,7 @@
|
|
|
|
|
where dpl.stock_article_id = ldrsi.stocklist_id |
|
|
|
|
) |
|
|
|
|
) number |
|
|
|
|
|
|
|
|
|
from logpm_distribution_stockup_info ldsi |
|
|
|
|
|
|
|
|
|
LEFT JOIN logpm_distribution_reservation_stockarticle ldrs on ldsi.reservation_id = ldrs.reservation_id |
|
|
|
|
LEFT JOIN logpm_distribution_reservation_stocklist ldrsi on ldrsi.reservation_id = ldrs.reservation_id |
|
|
|
|
LEFT JOIN logpm_distribution_stockup lds on lds.id = ldsi.stockup_id |
|
|
|
@ -589,8 +613,9 @@
|
|
|
|
|
and ldsi.is_deleted = 0 |
|
|
|
|
</select> |
|
|
|
|
<select id="getInventoryCheSelf" resultType="com.logpm.distribution.vo.DistributionStockupVO"> |
|
|
|
|
select lddd.quantity,ldsi.reservation_id |
|
|
|
|
from logpm_distribution_stockup_info ldsi |
|
|
|
|
select lddd.quantity reservationStockListNum,ldsi.reservation_id,lds.type_service |
|
|
|
|
from logpm_distribution_stockup lds |
|
|
|
|
LEFT JOIN logpm_distribution_stockup_info ldsi on ldsi.stockup_id = lds.id |
|
|
|
|
LEFT JOIN logpm_distribution_delivery_details lddd on ldsi.reservation_id = lddd.bill_lading_id |
|
|
|
|
<where> |
|
|
|
|
ldsi.stockup_id =#{id} and lddd.inventory_status in (1,2) |
|
|
|
|