|
|
|
@ -944,33 +944,43 @@
|
|
|
|
|
|
|
|
|
|
</select> |
|
|
|
|
<select id="detailReservationOwn" resultType="com.logpm.distribution.vo.DistributionStockupVO"> |
|
|
|
|
select DISTINCT ldr.consignee ,ldr.delivery_address deliveryAddress,ldr.delivery_phone |
|
|
|
|
deliveryPhone,ldr.mall_name mallName, |
|
|
|
|
ldr.stock_article_id stockArticleId,ldr.stockup_status stockupStatus,ldr.reserve_quantity reserveQuantity,ldr.end_time_stocking endTimeStocking, |
|
|
|
|
ldr.start_time_stocking startTimeStocking,ldr.stock_order_quantity stockOrderQuantity, |
|
|
|
|
( |
|
|
|
|
select GROUP_CONCAT(DISTINCT lwug.position_code) goodsAllocation |
|
|
|
|
from logpm_distribution_reservation_package ldrp |
|
|
|
|
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldrp.parce_list_id |
|
|
|
|
where ldrp.reservation_id = ldsi.reservation_id |
|
|
|
|
) goodsAllocation, |
|
|
|
|
SELECT |
|
|
|
|
ldr.reservation_code, |
|
|
|
|
ldr.consignee, |
|
|
|
|
ldr.delivery_address deliveryAddress, |
|
|
|
|
ldr.delivery_phone deliveryPhone, |
|
|
|
|
ldr.mall_name mallName, |
|
|
|
|
ldr.stock_article_id stockArticleId, |
|
|
|
|
ldr.stockup_status stockupStatus, |
|
|
|
|
ldr.reserve_quantity reserveQuantity, |
|
|
|
|
ldr.end_time_stocking endTimeStocking, |
|
|
|
|
ldr.start_time_stocking startTimeStocking, |
|
|
|
|
ldr.stock_order_quantity stockOrderQuantity, |
|
|
|
|
CONCAT(IFNULL(GROUP_CONCAT( DISTINCT ldpl.pallet ),''),',',IFNULL(GROUP_CONCAT( DISTINCT ldsl.tray_name ),'')) pallet, |
|
|
|
|
CONCAT(IFNULL(GROUP_CONCAT( DISTINCT ldpl.goods_allocation ),''),',',IFNULL(GROUP_CONCAT( DISTINCT ldsl.storage_location ),'')) goodsAllocation, |
|
|
|
|
ldr.stockup_status stockStatus, |
|
|
|
|
ldr.reservation_num reservationNum, |
|
|
|
|
ldr.reservation_stock_list_num reservationStockListNum |
|
|
|
|
from logpm_distribution_reservation ldr |
|
|
|
|
LEFT JOIN logpm_distribution_stockup_info ldsi on ldr.id = ldsi.reservation_id |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_stockup lds |
|
|
|
|
LEFT JOIN logpm_distribution_stockup_info ldsi ON lds.id = ldsi.stockup_id |
|
|
|
|
LEFT JOIN logpm_distribution_reservation ldr ON ldr.id = ldsi.reservation_id |
|
|
|
|
left join logpm_distribution_reservation_package ldrp ON ldrp.reservation_id = ldr.id |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list ldpl ON ldpl.id = ldrp.parce_list_id |
|
|
|
|
LEFT JOIN logpm_distribution_reservation_stocklist ldrs on ldrs.reservation_id = ldr.id |
|
|
|
|
LEFT JOIN logpm_distribution_stock_list ldsl ON ldrs.stocklist_id = ldsl.id |
|
|
|
|
<where> |
|
|
|
|
ldr.id in (select reservation_id |
|
|
|
|
from logpm_distribution_stockup_info ) |
|
|
|
|
and ldsi.stockup_id = #{param.id} |
|
|
|
|
and ldr.is_deleted = 0 |
|
|
|
|
and ldsi.stock_status != 4 |
|
|
|
|
lds.id = #{param.id} |
|
|
|
|
AND ldr.is_deleted = 0 |
|
|
|
|
AND ldsi.stock_status != 4 |
|
|
|
|
<if test="param.stockupStatus != null and param.stockupStatus !=''"> and ldr.stockup_status = #{param.stockupStatus} </if> |
|
|
|
|
<if test="param.mallName != null and param.mallName !=''"> and ldr.mall_name = #{param.mallName} </if> |
|
|
|
|
<if test="param.goodsAllocation != null and param.goodsAllocation !=''"> and lwug.position_code like concat('%', #{param.goodsAllocation},'%' )</if> |
|
|
|
|
<if test="param.goodsAllocation != null and param.goodsAllocation !=''"> and ldpl.goods_allocation like concat('%', #{param.goodsAllocation},'%' )</if> |
|
|
|
|
<if test="param.startTimeStocking != null and param.startTimeStocking != '' ">and date_format(from_unixtime( ldr.start_time_stocking),'%Y-%m-%d') = date_format(#{param.startTimeStocking },'%Y-%m-%d') </if> |
|
|
|
|
<if test="param.endTimeStocking != null and param.endTimeStocking != '' ">and date_format(from_unixtime( ldr.end_time_stocking),'%Y-%m-%d') = date_format(#{param.endTimeStocking },'%Y-%m-%d') </if> |
|
|
|
|
</where> |
|
|
|
|
GROUP BY |
|
|
|
|
ldr.id; |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="detailOrderOwn" resultType="com.logpm.distribution.vo.DistributionStockupVO"> |
|
|
|
@ -982,9 +992,9 @@
|
|
|
|
|
lds.stockup_area AS stockupArea, |
|
|
|
|
ldsa.id stockArticleId, |
|
|
|
|
( |
|
|
|
|
SELECT GROUP_CONCAT(DISTINCT lwug.position_code) |
|
|
|
|
SELECT GROUP_CONCAT(DISTINCT dpl.goods_allocation) |
|
|
|
|
FROM logpm_distribution_parcel_list dpl |
|
|
|
|
left join logpm_warehouse_updown_goods lwug on dpl.id = lwug.association_id |
|
|
|
|
|
|
|
|
|
WHERE dpl.stock_article_id = ldrs.stock_article_id |
|
|
|
|
) AS goodsAllocation |
|
|
|
|
FROM logpm_distribution_stockup_info ldsi |
|
|
|
@ -1010,6 +1020,7 @@
|
|
|
|
|
ldsii.cargo_unit cargoUnit, |
|
|
|
|
ldsii.id stockListId, |
|
|
|
|
ldrsi.reservation_id reservationId, |
|
|
|
|
ldr.reservation_code reservationCode, |
|
|
|
|
ldrsi.reservation_num reservationNum, |
|
|
|
|
lds.stockup_area stockupArea, |
|
|
|
|
lds.stockup_status stockupStatus, |
|
|
|
@ -1019,7 +1030,8 @@
|
|
|
|
|
( SELECT count( ds.id ) FROM logpm_distribution_stock ds WHERE ds.stock_list_id = ldsii.id AND ds.reservation_id = ldsi.reservation_id ) number, |
|
|
|
|
ldrsi.stock_status stockStatus, |
|
|
|
|
ldrsi.start_time_stocking startTimeStocking, |
|
|
|
|
ldrsi.end_time_stocking endTimeStocking |
|
|
|
|
ldrsi.end_time_stocking endTimeStocking, |
|
|
|
|
ldsii.storage_location |
|
|
|
|
from logpm_distribution_stockup_info ldsi |
|
|
|
|
LEFT JOIN logpm_distribution_reservation ldr ON ldsi.reservation_id = ldr.id |
|
|
|
|
LEFT JOIN logpm_distribution_reservation_stocklist ldrsi ON ldrsi.reservation_id = ldsi.reservation_id |
|
|
|
|