|
|
|
@ -2043,4 +2043,172 @@
|
|
|
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="pageOweListTransfer" resultType="com.logpm.distribution.entity.DistributionParcelListEntity"> |
|
|
|
|
select DISTINCT ldpl.id, |
|
|
|
|
ldpl.tenant_id, |
|
|
|
|
ldpl.create_user, |
|
|
|
|
ldpl.create_time, |
|
|
|
|
ldpl.update_user, |
|
|
|
|
ldpl.update_time, |
|
|
|
|
ldpl.status, ldpl.is_deleted, ldpl.create_dept, |
|
|
|
|
ldpl.reserve1, ldpl.reserve2, ldpl.reserve3, ldpl.reserve4, ldpl.reserve5, |
|
|
|
|
ldpl.warehouse_id, ldpl.warehouse, ldpl.conditions, ldpl.order_package_code, |
|
|
|
|
ldpl.cargo_title, ldpl.shelf_title, |
|
|
|
|
ldpl.firsts, ldpl.second, ldpl.third_product, ldpl.quantity, |
|
|
|
|
ldpl.train_number, ldpl.stock_article_id, ldpl.order_code, ldpl.service_number, |
|
|
|
|
ldpl.material_id, ldpl.material_name, ldpl.material_code, ldpl.material_unit, ldpl.brand_id, |
|
|
|
|
ldpl.brand_name, ldpl.order_package_status, ldpl.order_package_freeze_status, |
|
|
|
|
ldpl.order_package_grounding_status, ldpl.order_package_stockup_status, |
|
|
|
|
ldpl.order_package_reservation_status, ldpl.order_package_loading_status, |
|
|
|
|
ldpl.waybill_number, ldpl.waybill_id, ldpl.warehouse_entry_time_end, |
|
|
|
|
ldpl.dealer_name, ldpl.dealer_code, ldpl.send_warehouse_id, |
|
|
|
|
ldpl.send_warehouse_name, ldpl.accept_warehouse_id, ldpl.accept_warehouse_name, |
|
|
|
|
ldpl.order_package_delivery_status, |
|
|
|
|
ldpl.pallet pallet, |
|
|
|
|
ldpl.goods_allocation goodsAllocation |
|
|
|
|
From logpm_distribution_parcel_list ldpl |
|
|
|
|
<where> |
|
|
|
|
ldpl.conditions in ('1','3') |
|
|
|
|
<if test="param.serviceNumber != null and param.serviceNumber != ''">and ldpl.service_number like |
|
|
|
|
concat('%',#{param.serviceNumber},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.waybillNumber != null and param.waybillNumber != ''">and ldpl.waybill_number like |
|
|
|
|
concat('%',#{param.waybillNumber},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.orderCode != null and param.orderCode != ''">and ldpl.order_code like |
|
|
|
|
concat('%',#{param.orderCode},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.warehouse != null and param.warehouse != ''">and ldpl.warehouse like |
|
|
|
|
concat('%',#{param.warehouse},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.orderPackageReservationStatus != null and param.orderPackageReservationStatus != ''">and |
|
|
|
|
ldpl.order_package_reservation_status = #{param.orderPackageReservationStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.isLoading != null and param.isLoading == 0">and |
|
|
|
|
ldpl.order_package_loading_status != 20 |
|
|
|
|
</if> |
|
|
|
|
<if test="param.isSigning != null and param.isSigning == 0">and |
|
|
|
|
ldpl.order_package_status != 70 |
|
|
|
|
</if> |
|
|
|
|
<if test="param.orderPackageFreezeStatus != null and param.orderPackageFreezeStatus != ''">and |
|
|
|
|
ldpl.order_package_freeze_status = #{param.orderPackageFreezeStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.orderPackageStatus != null and param.orderPackageStatus != ''">and ldpl.order_package_status |
|
|
|
|
= #{param.orderPackageStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.orderPackageGroundingStatus != null and param.orderPackageGroundingStatus != ''">and |
|
|
|
|
ldpl.order_package_grounding_status = #{param.orderPackageGroundingStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.orderPackageStockupStatus != null and param.orderPackageStockupStatus != ''">and |
|
|
|
|
ldpl.order_package_stockup_status = #{param.orderPackageStockupStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.orderPackageReservationStatus != null and param.orderPackageReservationStatus != ''">and |
|
|
|
|
ldpl.order_package_reservation_status = #{param.orderPackageReservationStatus} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.orderPackageCode != null and param.orderPackageCode != ''">and ldpl.order_package_code like |
|
|
|
|
concat('%',#{param.orderPackageCode},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.pallet != null and param.pallet != ''">and ldpl.pallet like |
|
|
|
|
concat('%',#{param.pallet},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.goodsAllocation != null and param.goodsAllocation != ''">and ldpl.goods_allocation like |
|
|
|
|
concat('%',#{param.goodsAllocation},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.firsts != null and param.firsts != ''">and ldpl.firsts like |
|
|
|
|
concat('%',#{param.firsts},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.second != null and param.second != ''">and ldpl.second like |
|
|
|
|
concat('%',#{param.second},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.thirdProduct != null and param.thirdProduct != ''">and ldpl.third_product like |
|
|
|
|
concat('%',#{param.thirdProduct},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.materialName != null and param.materialName != ''">and ldpl.material_name like |
|
|
|
|
concat('%',#{param.materialName},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.warehouseEntryTimeEnd != null">and DATE(ldpl.warehouse_entry_time_end) = |
|
|
|
|
#{param.warehouseEntryTimeEnd} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.trainNumber != null and param.trainNumber != ''">and ldpl.train_number = |
|
|
|
|
#{param.trainNumber} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.sendWarehouseName != null and param.sendWarehouseName != ''">and ldpl.send_warehouse_name |
|
|
|
|
like concat('%',#{param.sendWarehouseName},'%') |
|
|
|
|
</if> |
|
|
|
|
<if test="param.stockArticleIdsList != null ">and ldpl.stock_article_id in |
|
|
|
|
<foreach collection="param.stockArticleIdsList" separator="," close=")" item="a" open="("> |
|
|
|
|
#{a} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="param.stockArticleIdsLike != null and param.stockArticleIdsLike != ''">and ldpl.stock_article_id = |
|
|
|
|
#{param.stockArticleIdsLike} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.stockArticleId != null and param.stockArticleId != ''">and ldpl.stock_article_id = |
|
|
|
|
#{param.stockArticleId} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.conditions != null and param.conditions != ''">and ldpl.conditions = #{param.conditions} |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="pageOweZeroListTransfer" resultType="com.logpm.distribution.vo.DistributionOrderZeroPackafeVO"> |
|
|
|
|
SELECT |
|
|
|
|
t.id AS id, |
|
|
|
|
t.warehouse AS warehouseName, |
|
|
|
|
t.firsts AS firsts, |
|
|
|
|
t.quantity AS quantity, |
|
|
|
|
t.train_number AS train_number, |
|
|
|
|
t.order_code AS orderCode, |
|
|
|
|
t.brand_name AS brandName, |
|
|
|
|
t.waybill_number AS waybillNumber, |
|
|
|
|
t.warehouse_entry_time_end AS warehouseEntryTimeEnd, |
|
|
|
|
t.send_warehouse_name AS sendWarehouseName, |
|
|
|
|
t.accept_warehouse_name AS acceptWarehouseName, |
|
|
|
|
t.pallet AS pallet, |
|
|
|
|
t.goodsAllocation AS goodsAllocation, |
|
|
|
|
t.hand_quantity AS handQuantity, |
|
|
|
|
t.delivery_quantity AS deliveryQuantity, |
|
|
|
|
t.outbound_quantity AS outboundQuantity, |
|
|
|
|
t.signin_quantity AS signinQuantity, |
|
|
|
|
t.aaa, |
|
|
|
|
t.bbb, |
|
|
|
|
t.ccc |
|
|
|
|
FROM |
|
|
|
|
( |
|
|
|
|
SELECT |
|
|
|
|
ldpl.id, |
|
|
|
|
ldpl.warehouse, |
|
|
|
|
ldpl.firsts, |
|
|
|
|
ldpl.train_number, |
|
|
|
|
ldpl.order_code, |
|
|
|
|
ldpl.brand_name, |
|
|
|
|
ldpl.waybill_number, |
|
|
|
|
ldpl.warehouse_entry_time_end, |
|
|
|
|
ldpl.send_warehouse_name, |
|
|
|
|
ldpl.accept_warehouse_name, |
|
|
|
|
ldsa.trays pallet, |
|
|
|
|
ldsa.allocation goodsAllocation, |
|
|
|
|
ldpn.hand_quantity, |
|
|
|
|
ldpn.quantity, |
|
|
|
|
ldpn.delivery_quantity, |
|
|
|
|
ldpn.outbound_quantity, |
|
|
|
|
ldpn.signin_quantity, |
|
|
|
|
IF(ldpn.outbound_quantity > 0,IF(ldpn.outbound_quantity = ldpn.quantity,'已出库','部分出库'),'未出库') AS aaa, |
|
|
|
|
IF(ldpn.signin_quantity > 0,IF(ldpn.signin_quantity = ldpn.quantity,'已签收','部分签收'),'未签收') AS bbb, |
|
|
|
|
IF((ldpn.quantity - ldpn.delivery_quantity -ldpn.outbound_quantity) = 0,IF(ldpn.quantity > 0,'已配送','未知'),IF(( ldpn.delivery_quantity +ldpn.outbound_quantity) > 0 ,'部分配送','未配送')) AS ccc |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_parcel_list ldpl |
|
|
|
|
LEFT JOIN logpm_distribution_stock_article AS ldsa ON ldpl.stock_article_id = ldsa.id |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_number AS ldpn ON ldpn.parcel_list_id = ldpl.id |
|
|
|
|
WHERE |
|
|
|
|
ldpl.conditions = '3' |
|
|
|
|
AND ldpl.is_deleted = 0 |
|
|
|
|
AND ldpl.order_code = #{orderCode} |
|
|
|
|
and ldpl.waybill_number = #{waybillNumber} |
|
|
|
|
GROUP BY |
|
|
|
|
ldpl.id |
|
|
|
|
) AS t |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
|
|