|
|
|
@ -1095,5 +1095,222 @@
|
|
|
|
|
SELECT ldpl.* FROM logpm_distribution_parcel_list ldpl |
|
|
|
|
WHERE ldpl.waybill_number = #{waybillNumber} |
|
|
|
|
</select> |
|
|
|
|
<select id="selectPackageAllocationAndTray" |
|
|
|
|
resultType="com.logpm.distribution.vo.DistributionParcelListNodeVO"> |
|
|
|
|
SELECT |
|
|
|
|
ldpl.order_code AS orderCode, |
|
|
|
|
ldpl.order_package_code AS orderPackageCode, |
|
|
|
|
ldpl.warehouse AS warehouseName, |
|
|
|
|
ldpl.warehouse_id AS warehouseId, |
|
|
|
|
ldpl.quantity AS quantity, |
|
|
|
|
ldpl.train_number AS tranNumber, |
|
|
|
|
lwugl.create_time AS nodeTime, |
|
|
|
|
lwugl.create_user AS nodeControlsUserId, |
|
|
|
|
CASE lwugl.binding_type |
|
|
|
|
WHEN 1 THEN '上架操作' |
|
|
|
|
ELSE '下架操作' |
|
|
|
|
END nodeName, |
|
|
|
|
CASE lwugl.binding_type |
|
|
|
|
WHEN 1 THEN CONCAT('上架成功,',lwga.qr_code,lwugl.remark) |
|
|
|
|
ELSE |
|
|
|
|
CONCAT('下架成功,',lwga.qr_code,lwugl.remark) |
|
|
|
|
END description |
|
|
|
|
FROM |
|
|
|
|
logpm_warehouse_updown_goods_log AS lwugl |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON lwugl.association_value = ldpl.order_package_code |
|
|
|
|
LEFT JOIN logpm_warehouse_goods_allocation AS lwga ON lwugl.allocation_id = lwga.id |
|
|
|
|
WHERE |
|
|
|
|
lwugl.association_value = #{orderPackageCode} AND ldpl.warehouse_id = #{warehouseId} AND lwugl.association_type = '3' |
|
|
|
|
UNION ALL |
|
|
|
|
SELECT |
|
|
|
|
ldpl.order_code AS orderCode, |
|
|
|
|
ldpl.order_package_code AS orderPackageCode, |
|
|
|
|
ldpl.warehouse AS warehouseName, |
|
|
|
|
ldpl.warehouse_id AS warehouseId, |
|
|
|
|
ldpl.quantity AS quantity, |
|
|
|
|
ldpl.train_number AS tranNumber, |
|
|
|
|
lwtgl.create_time AS nodeTime, |
|
|
|
|
lwtgl.create_user AS nodeControlsUserId, |
|
|
|
|
CASE lwtgl.binding_type |
|
|
|
|
WHEN 1 THEN '打托操作' |
|
|
|
|
ELSE '解托操作' |
|
|
|
|
END nodeName, |
|
|
|
|
CASE lwtgl.binding_type |
|
|
|
|
WHEN 1 THEN CONCAT('打托成功,',lwt.pallet_name,lwtgl.remark) |
|
|
|
|
ELSE |
|
|
|
|
CONCAT('解托成功,',lwt.pallet_name,lwtgl.remark) |
|
|
|
|
END description |
|
|
|
|
FROM |
|
|
|
|
logpm_warehouse_tray_goods_log AS lwtgl |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON lwtgl.association_value = ldpl.order_package_code |
|
|
|
|
LEFT JOIN logpm_warehouse_tray AS lwt ON lwtgl.tray_id = lwt.id |
|
|
|
|
WHERE |
|
|
|
|
lwtgl.association_value = #{orderPackageCode} AND ldpl.warehouse_id = #{warehouseId} AND lwtgl.association_type = '3' |
|
|
|
|
</select> |
|
|
|
|
<select id="selectPackagePlanDelivery" resultType="com.logpm.distribution.vo.DistributionParcelListNodeVO"> |
|
|
|
|
SELECT |
|
|
|
|
ldpl.order_code AS orderCode, |
|
|
|
|
ldpl.order_package_code AS orderPackageCode, |
|
|
|
|
ldpl.warehouse AS warehouseName, |
|
|
|
|
ldpl.warehouse_id AS warehouseId, |
|
|
|
|
ldpl.quantity AS quantity, |
|
|
|
|
ldpl.train_number AS tranNumber, |
|
|
|
|
ldrp.create_time AS nodeTime, |
|
|
|
|
ldrp.create_user AS nodeControlsUserId, |
|
|
|
|
'计划配送' AS nodeName, |
|
|
|
|
lwt.pallet_name, |
|
|
|
|
lwga.qr_code, |
|
|
|
|
CASE ldrp.packet_bar_status |
|
|
|
|
WHEN '3' THEN CONCAT('计划新增配送成功,预约单:',ldr.reservation_code) |
|
|
|
|
ELSE CONCAT('计划配送成功,预约单:',ldr.reservation_code) |
|
|
|
|
END description |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_reservation_package AS ldrp |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldrp.parce_list_id = ldpl.id |
|
|
|
|
LEFT JOIN logpm_distribution_reservation AS ldr ON ldrp.reservation_id = ldr.id |
|
|
|
|
LEFT JOIN logpm_warehouse_updown_goods AS lwug ON ldpl.order_package_code = lwug.association_value |
|
|
|
|
LEFT JOIN logpm_warehouse_goods_allocation AS lwga ON lwug.allocation_id = lwga.id |
|
|
|
|
LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON ldpl.order_package_code = lwtg.association_value |
|
|
|
|
LEFT JOIN logpm_warehouse_tray AS lwt ON lwtg.tray_id = lwt.id |
|
|
|
|
WHERE |
|
|
|
|
ldrp.packet_bar_code = #{orderPackageCode} AND ldpl.warehouse_id = #{warehouseId} |
|
|
|
|
</select> |
|
|
|
|
<select id="selectPackageCancelPlanDelivery" |
|
|
|
|
resultType="com.logpm.distribution.vo.DistributionParcelListNodeVO"> |
|
|
|
|
SELECT |
|
|
|
|
ldpl.order_code AS orderCode, |
|
|
|
|
ldpl.order_package_code AS orderPackageCode, |
|
|
|
|
ldpl.warehouse AS warehouseName, |
|
|
|
|
ldpl.warehouse_id AS warehouseId, |
|
|
|
|
ldpl.quantity AS quantity, |
|
|
|
|
ldpl.train_number AS tranNumber, |
|
|
|
|
ldrp.create_time AS nodeTime, |
|
|
|
|
ldrp.create_user AS nodeControlsUserId, |
|
|
|
|
'配送取消' AS nodeName, |
|
|
|
|
lwt.pallet_name, |
|
|
|
|
lwga.qr_code, |
|
|
|
|
CASE lwrc.order_package_code |
|
|
|
|
WHEN ldpl.order_package_code THEN CONCAT('计划配送取消,预约单:',ldr.reservation_code,IF(lwrc.id is not null,';司机滞留取消',lwrc.id)) |
|
|
|
|
ELSE |
|
|
|
|
CONCAT('计划配送取消,预约单:',ldr.reservation_code,IF(ldrp.cancel_status = 1,';复核释放取消',';文员操作取消')) |
|
|
|
|
END description |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_reservation_package AS ldrp |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldrp.parce_list_id = ldpl.id |
|
|
|
|
LEFT JOIN logpm_distribution_reservation AS ldr ON ldrp.reservation_id = ldr.id |
|
|
|
|
LEFT JOIN logpm_warehouse_updown_goods AS lwug ON ldpl.order_package_code = lwug.association_value |
|
|
|
|
LEFT JOIN logpm_warehouse_goods_allocation AS lwga ON lwug.allocation_id = lwga.id |
|
|
|
|
LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON ldpl.order_package_code = lwtg.association_value |
|
|
|
|
LEFT JOIN logpm_warehouse_tray AS lwt ON lwtg.tray_id = lwt.id |
|
|
|
|
LEFT JOIN logpm_warehouse_retention_scan AS lwrc ON lwrc.order_package_code = ldpl.order_package_code |
|
|
|
|
WHERE |
|
|
|
|
ldrp.packet_bar_code = #{orderPackageCode} AND ldpl.warehouse_id = #{warehouseId} AND ldrp.packet_bar_status = '2' |
|
|
|
|
</select> |
|
|
|
|
<select id="selectPackageLoading" resultType="com.logpm.distribution.vo.DistributionParcelListNodeVO"> |
|
|
|
|
SELECT |
|
|
|
|
ldpl.order_code AS orderCode, |
|
|
|
|
ldpl.order_package_code AS orderPackageCode, |
|
|
|
|
ldpl.warehouse AS warehouseName, |
|
|
|
|
ldpl.warehouse_id AS warehouseId, |
|
|
|
|
ldpl.quantity AS quantity, |
|
|
|
|
lddl.train_number AS tranNumber, |
|
|
|
|
ldl.scan_time AS nodeTime, |
|
|
|
|
ldl.scan_user AS nodeControlsUserName, |
|
|
|
|
ldl.create_user AS nodeControlsUserId, |
|
|
|
|
IF(ldla.id is not null AND ldl.scan_status = '2','异常装车','扫描装车' )AS nodeName, |
|
|
|
|
CASE ldl.scan_status |
|
|
|
|
WHEN '2' THEN CONCAT('扫描装车,装车方式:',IF(ldl.tray_no is not null,'托盘','包件'),IF(ldl.tray_no is null,'',ldl.tray_no)) |
|
|
|
|
WHEN '3' THEN CONCAT('扫描装车,装车方式:订单') |
|
|
|
|
WHEN '4' THEN CONCAT('扫描装车,装车方式:批量确认') |
|
|
|
|
WHEN '5' THEN CONCAT('扫描装车,装车方式:装车补录') |
|
|
|
|
ELSE CONCAT('扫描装车,装车方式:',IF(ldl.tray_no is not null,'托盘','包件'),IF(ldl.tray_no is null,'',ldl.tray_no)) |
|
|
|
|
END description |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_loadscan AS ldl |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldl.package_id = ldpl.id |
|
|
|
|
LEFT JOIN logpm_distribution_delivery_list AS lddl ON ldl.delivery_id = lddl.id |
|
|
|
|
LEFT JOIN logpm_distribution_loadscan_abnormal AS ldla ON ldla.package_id = ldpl.id |
|
|
|
|
WHERE ldl.order_package_code = #{orderPackageCode} AND ldpl.warehouse_id = #{warehouseId} |
|
|
|
|
</select> |
|
|
|
|
<select id="selectPackageCancelLoading" |
|
|
|
|
resultType="com.logpm.distribution.vo.DistributionParcelListNodeVO"> |
|
|
|
|
SELECT |
|
|
|
|
ldpl.order_code AS orderCode, |
|
|
|
|
ldpl.order_package_code AS orderPackageCode, |
|
|
|
|
ldpl.warehouse AS warehouseName, |
|
|
|
|
ldpl.warehouse_id AS warehouseId, |
|
|
|
|
ldpl.quantity AS quantity, |
|
|
|
|
lddl.train_number AS tranNumber, |
|
|
|
|
ldl.update_time AS nodeTime, |
|
|
|
|
ldl.update_user AS nodeControlsUserId, |
|
|
|
|
IF(lwrs.id is not null,'滞留扫描','装车取消') AS nodeName, |
|
|
|
|
IF(lwrs.id is not null,'滞留扫描成功','装车取消成功') AS description |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_loadscan AS ldl |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldl.package_id = ldpl.id |
|
|
|
|
LEFT JOIN logpm_distribution_delivery_list AS lddl ON ldl.delivery_id = lddl.id |
|
|
|
|
LEFT JOIN logpm_warehouse_retention_scan AS lwrs ON lwrs.order_package_code = ldpl.order_package_code |
|
|
|
|
WHERE ldl.order_package_code = #{orderPackageCode} AND ldpl.warehouse_id = #{warehouseId} AND ldl.scan_status = '1' |
|
|
|
|
</select> |
|
|
|
|
<select id="selectPackageCancelSigning" |
|
|
|
|
resultType="com.logpm.distribution.vo.DistributionParcelListNodeVO"> |
|
|
|
|
SELECT |
|
|
|
|
ldpl.order_code AS orderCode, |
|
|
|
|
ldpl.order_package_code AS orderPackageCode, |
|
|
|
|
ldpl.warehouse AS warehouseName, |
|
|
|
|
ldpl.warehouse_id AS warehouseId, |
|
|
|
|
ldpl.quantity AS quantity, |
|
|
|
|
lddl.train_number AS tranNumber, |
|
|
|
|
ldl.signing_time AS nodeTime, |
|
|
|
|
ldl.signing_user AS nodeControlsUserName, |
|
|
|
|
ldl.signing_user_id AS nodeControlsUserId, |
|
|
|
|
IF(ldla.id is not null AND ldl.scan_status = '2','异常签收','扫描签收' )AS nodeName, |
|
|
|
|
CONCAT('签收操作成功') AS description |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_loadscan AS ldl |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldl.package_id = ldpl.id |
|
|
|
|
LEFT JOIN logpm_distribution_delivery_list AS lddl ON ldl.delivery_id = lddl.id |
|
|
|
|
LEFT JOIN logpm_distribution_loadscan_abnormal AS ldla ON ldla.package_id = ldpl.id |
|
|
|
|
WHERE ldl.order_package_code = #{orderPackageCode} AND ldpl.warehouse_id = #{warehouseId} AND signfor_state = '2' |
|
|
|
|
</select> |
|
|
|
|
<select id="selectPackageStockUp" resultType="com.logpm.distribution.vo.DistributionParcelListNodeVO"> |
|
|
|
|
SELECT |
|
|
|
|
ldpl.order_code AS orderCode, |
|
|
|
|
ldpl.order_package_code AS orderPackageCode, |
|
|
|
|
ldpl.warehouse AS warehouseName, |
|
|
|
|
ldpl.warehouse_id AS warehouseId, |
|
|
|
|
ldpl.quantity AS quantity, |
|
|
|
|
ldpl.train_number AS tranNumber, |
|
|
|
|
lds.create_user AS nodeControlsUserId, |
|
|
|
|
lds.create_time AS nodeTime, |
|
|
|
|
'备货扫描' AS nodeName, |
|
|
|
|
CONCAT('备货扫描成功,',IF(ldsup.stockup_code is not null,ldsup.stockup_code,'')) AS description |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_stock AS lds |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON lds.parcel_list_id = ldpl.id |
|
|
|
|
LEFT JOIN logpm_distribution_stockup AS ldsup ON lds.stockup_id = ldsup.id |
|
|
|
|
WHERE |
|
|
|
|
lds.coding = #{orderPackageCode} AND ldpl.warehouse_id = #{warehouseId} AND lds.type = '1' |
|
|
|
|
</select> |
|
|
|
|
<select id="selectPackageExamineAbnormal" |
|
|
|
|
resultType="com.logpm.distribution.vo.DistributionParcelListNodeVO"> |
|
|
|
|
SELECT |
|
|
|
|
ldpl.order_code AS orderCode, |
|
|
|
|
ldpl.order_package_code AS orderPackageCode, |
|
|
|
|
ldpl.warehouse AS warehouseName, |
|
|
|
|
ldpl.warehouse_id AS warehouseId, |
|
|
|
|
ldpl.quantity AS quantity, |
|
|
|
|
ldla.train_number AS tranNumber, |
|
|
|
|
ldla.auditing_user AS nodeControlsUserName, |
|
|
|
|
ldla.update_user AS nodeControlsUserId, |
|
|
|
|
ldla.auditing_time AS nodeTime, |
|
|
|
|
'异常审核' AS nodeName, |
|
|
|
|
CONCAT('异常审核成功') AS description |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_loadscan_abnormal AS ldla |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldla.package_id = ldpl.id |
|
|
|
|
WHERE |
|
|
|
|
ldla.package_code = #{orderPackageCode} AND ldpl.warehouse_id = #{warehouseId} |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
|
|