@ -45,50 +45,664 @@
</resultMap>
</resultMap>
<select id= "selectWarehouseStockPage" resultType= "com.logpm.warehouse.vo.WarehouseScanRecordVO" >
<select id= "selectWarehouseStockPage" resultType= "com.logpm.warehouse.vo.WarehouseScanRecordVO" >
select vsr.* from view_scan_record vsr
SELECT
`ldpl`.`id` AS `id`,
`ldpl`.`tenant_id` AS `tenant_id`,
`ldpl`.`create_user` AS `create_user`,
`ldpl`.`create_time` AS `create_time`,
`ldpl`.`update_user` AS `update_user`,
`ldpl`.`update_time` AS `update_time`,
`ldpl`.`status` AS `status`,
`ldpl`.`is_deleted` AS `is_deleted`,
`ldpl`.`create_dept` AS `create_dept`,
`ldpl`.`reserve1` AS `reserve1`,
`ldpl`.`reserve2` AS `reserve2`,
`ldpl`.`reserve3` AS `reserve3`,
`ldpl`.`reserve4` AS `reserve4`,
`ldpl`.`reserve5` AS `reserve5`,
`ldpl`.`warehouse_id` AS `warehouse_id`,
`ldpl`.`warehouse` AS `warehouse`,
`ldpl`.`conditions` AS `conditions`,
`ldpl`.`order_package_code` AS `order_package_code`,
`ldpl`.`cargo_title` AS `cargo_title`,
`ldpl`.`shelf_title` AS `shelf_title`,
`ldpl`.`goods_allocation` AS `goods_allocation`,
`ldpl`.`pallet` AS `pallet`,
`ldpl`.`firsts` AS `firsts`,
`ldpl`.`second` AS `second`,
`ldpl`.`third_product` AS `third_product`,
`ldpl`.`quantity` AS `quantity`,
`ldpl`.`train_number` AS `train_number`,
`ldpl`.`stock_article_id` AS `stock_article_id`,
`ldpl`.`order_code` AS `order_code`,
`ldpl`.`service_number` AS `service_number`,
`ldpl`.`material_id` AS `material_id`,
`ldpl`.`material_name` AS `material_name`,
`ldpl`.`material_code` AS `material_code`,
`ldpl`.`material_unit` AS `material_unit`,
`ldpl`.`brand_id` AS `brand_id`,
`ldpl`.`brand_name` AS `brand_name`,
`ldpl`.`order_package_status` AS `order_package_status`,
`ldpl`.`order_package_freeze_status` AS `order_package_freeze_status`,
`ldpl`.`order_package_grounding_status` AS `order_package_grounding_status`,
`ldpl`.`order_package_stockup_status` AS `order_package_stockup_status`,
`ldpl`.`order_package_reservation_status` AS `order_package_reservation_status`,
`ldpl`.`order_package_loading_status` AS `order_package_loading_status`,
`ldpl`.`waybill_number` AS `waybill_number`,
`ldpl`.`waybill_id` AS `waybill_id`,
`ldpl`.`warehouse_entry_time_end` AS `warehouse_entry_time_end`,
`ldpl`.`dealer_name` AS `dealer_name`,
`ldpl`.`dealer_code` AS `dealer_code`,
`ldpl`.`send_warehouse_id` AS `send_warehouse_id`,
`ldpl`.`send_warehouse_name` AS `send_warehouse_name`,
`ldpl`.`accept_warehouse_id` AS `accept_warehouse_id`,
`ldpl`.`accept_warehouse_name` AS `accept_warehouse_name`,
`ldpl`.`order_package_delivery_status` AS `order_package_delivery_status`,
`ldl`.`update_time` AS `operatorTime`,
`ldl`.`create_user` AS `operatorId`,
'取消装车' AS `scanNodeType`,
'配送' AS `nodeName`
FROM
`logpm_distribution_parcel_list` `ldpl`
JOIN `logpm_distribution_loadscan` `ldl` ON
`ldpl`.`id` = `ldl`.`package_id`
AND `ldl`.`scan_status` = 1
<where >
ldpl.is_deleted =0 and ldl.is_deleted =0
<if test= "param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)" >
and ldpl.warehouse_id in
<foreach collection= "param.warehouseIdList" item= "item" open= "(" close= ")" separator= "," >
#{item}
</foreach>
</if>
<if test= "param.orderCode != null and param.orderCode != '' " >
and ldpl.order_code like concat('%',#{param.orderCode},'%')
</if>
<if test= "param.orderPackageCode != null and param.orderPackageCode != '' " >
and ldpl.order_package_code like concat('%',#{param.orderPackageCode},'%')
</if>
<if test= "param.serviceNumber != null and param.serviceNumber != '' " >
and ldpl.service_number like concat('%',#{param.serviceNumber},'%')
</if>
<if test= "param.brandName != null and param.brandName != '' " >
and ldpl.brand_name like concat('%',#{param.brandName},'%')
</if>
<if test= "param.materialCode != null and param.materialCode != '' " >
and ldpl.material_code like concat('%',#{param.materialCode},'%')
</if>
<if test= "param.materialName != null and param.materialName != '' " >
and ldpl.material_name like concat('%',#{param.materialName},'%')
</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.date != null and param.date != '' " >
and ldl.update_time like concat(#{param.date},'%')
</if>
</where>
UNION ALL
SELECT
`ldpl`.`id` AS `id`,
`ldpl`.`tenant_id` AS `tenant_id`,
`ldpl`.`create_user` AS `create_user`,
`ldpl`.`create_time` AS `create_time`,
`ldpl`.`update_user` AS `update_user`,
`ldpl`.`update_time` AS `update_time`,
`ldpl`.`status` AS `status`,
`ldpl`.`is_deleted` AS `is_deleted`,
`ldpl`.`create_dept` AS `create_dept`,
`ldpl`.`reserve1` AS `reserve1`,
`ldpl`.`reserve2` AS `reserve2`,
`ldpl`.`reserve3` AS `reserve3`,
`ldpl`.`reserve4` AS `reserve4`,
`ldpl`.`reserve5` AS `reserve5`,
`ldpl`.`warehouse_id` AS `warehouse_id`,
`ldpl`.`warehouse` AS `warehouse`,
`ldpl`.`conditions` AS `conditions`,
`ldpl`.`order_package_code` AS `order_package_code`,
`ldpl`.`cargo_title` AS `cargo_title`,
`ldpl`.`shelf_title` AS `shelf_title`,
`ldpl`.`goods_allocation` AS `goods_allocation`,
`ldpl`.`pallet` AS `pallet`,
`ldpl`.`firsts` AS `firsts`,
`ldpl`.`second` AS `second`,
`ldpl`.`third_product` AS `third_product`,
`ldpl`.`quantity` AS `quantity`,
`ldpl`.`train_number` AS `train_number`,
`ldpl`.`stock_article_id` AS `stock_article_id`,
`ldpl`.`order_code` AS `order_code`,
`ldpl`.`service_number` AS `service_number`,
`ldpl`.`material_id` AS `material_id`,
`ldpl`.`material_name` AS `material_name`,
`ldpl`.`material_code` AS `material_code`,
`ldpl`.`material_unit` AS `material_unit`,
`ldpl`.`brand_id` AS `brand_id`,
`ldpl`.`brand_name` AS `brand_name`,
`ldpl`.`order_package_status` AS `order_package_status`,
`ldpl`.`order_package_freeze_status` AS `order_package_freeze_status`,
`ldpl`.`order_package_grounding_status` AS `order_package_grounding_status`,
`ldpl`.`order_package_stockup_status` AS `order_package_stockup_status`,
`ldpl`.`order_package_reservation_status` AS `order_package_reservation_status`,
`ldpl`.`order_package_loading_status` AS `order_package_loading_status`,
`ldpl`.`waybill_number` AS `waybill_number`,
`ldpl`.`waybill_id` AS `waybill_id`,
`ldpl`.`warehouse_entry_time_end` AS `warehouse_entry_time_end`,
`ldpl`.`dealer_name` AS `dealer_name`,
`ldpl`.`dealer_code` AS `dealer_code`,
`ldpl`.`send_warehouse_id` AS `send_warehouse_id`,
`ldpl`.`send_warehouse_name` AS `send_warehouse_name`,
`ldpl`.`accept_warehouse_id` AS `accept_warehouse_id`,
`ldpl`.`accept_warehouse_name` AS `accept_warehouse_name`,
`ldpl`.`order_package_delivery_status` AS `order_package_delivery_status`,
`ldl`.`create_time` AS `operatorTime`,
`ldl`.`create_user` AS `operatorId`,
'装车' AS `scanNodeType`,
'配送' AS `nodeName`
FROM
`logpm_distribution_parcel_list` `ldpl`
JOIN `logpm_distribution_loadscan` `ldl` ON
`ldpl`.`id` = `ldl`.`package_id`
AND `ldl`.`scan_status` != 1
<where >
<if test= "param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)" >
and ldpl.warehouse_id in
<foreach collection= "param.warehouseIdList" item= "item" open= "(" close= ")" separator= "," >
#{item}
</foreach>
</if>
<if test= "param.orderCode != null and param.orderCode != '' " >
and ldpl.order_code like concat('%',#{param.orderCode},'%')
</if>
<if test= "param.orderPackageCode != null and param.orderPackageCode != '' " >
and ldpl.order_package_code like concat('%',#{param.orderPackageCode},'%')
</if>
<if test= "param.serviceNumber != null and param.serviceNumber != '' " >
and ldpl.service_number like concat('%',#{param.serviceNumber},'%')
</if>
<if test= "param.brandName != null and param.brandName != '' " >
and ldpl.brand_name like concat('%',#{param.brandName},'%')
</if>
<if test= "param.materialCode != null and param.materialCode != '' " >
and ldpl.material_code like concat('%',#{param.materialCode},'%')
</if>
<if test= "param.materialName != null and param.materialName != '' " >
and ldpl.material_name like concat('%',#{param.materialName},'%')
</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.date != null and param.date != '' " >
and ldl.create_time like concat(#{param.date},'%')
</if>
</where>
UNION ALL
SELECT
`ldpl`.`id` AS `id`,
`ldpl`.`tenant_id` AS `tenant_id`,
`ldpl`.`create_user` AS `create_user`,
`ldpl`.`create_time` AS `create_time`,
`ldpl`.`update_user` AS `update_user`,
`ldpl`.`update_time` AS `update_time`,
`ldpl`.`status` AS `status`,
`ldpl`.`is_deleted` AS `is_deleted`,
`ldpl`.`create_dept` AS `create_dept`,
`ldpl`.`reserve1` AS `reserve1`,
`ldpl`.`reserve2` AS `reserve2`,
`ldpl`.`reserve3` AS `reserve3`,
`ldpl`.`reserve4` AS `reserve4`,
`ldpl`.`reserve5` AS `reserve5`,
`ldpl`.`warehouse_id` AS `warehouse_id`,
`ldpl`.`warehouse` AS `warehouse`,
`ldpl`.`conditions` AS `conditions`,
`ldpl`.`order_package_code` AS `order_package_code`,
`ldpl`.`cargo_title` AS `cargo_title`,
`ldpl`.`shelf_title` AS `shelf_title`,
`ldpl`.`goods_allocation` AS `goods_allocation`,
`ldpl`.`pallet` AS `pallet`,
`ldpl`.`firsts` AS `firsts`,
`ldpl`.`second` AS `second`,
`ldpl`.`third_product` AS `third_product`,
`ldpl`.`quantity` AS `quantity`,
`ldpl`.`train_number` AS `train_number`,
`ldpl`.`stock_article_id` AS `stock_article_id`,
`ldpl`.`order_code` AS `order_code`,
`ldpl`.`service_number` AS `service_number`,
`ldpl`.`material_id` AS `material_id`,
`ldpl`.`material_name` AS `material_name`,
`ldpl`.`material_code` AS `material_code`,
`ldpl`.`material_unit` AS `material_unit`,
`ldpl`.`brand_id` AS `brand_id`,
`ldpl`.`brand_name` AS `brand_name`,
`ldpl`.`order_package_status` AS `order_package_status`,
`ldpl`.`order_package_freeze_status` AS `order_package_freeze_status`,
`ldpl`.`order_package_grounding_status` AS `order_package_grounding_status`,
`ldpl`.`order_package_stockup_status` AS `order_package_stockup_status`,
`ldpl`.`order_package_reservation_status` AS `order_package_reservation_status`,
`ldpl`.`order_package_loading_status` AS `order_package_loading_status`,
`ldpl`.`waybill_number` AS `waybill_number`,
`ldpl`.`waybill_id` AS `waybill_id`,
`ldpl`.`warehouse_entry_time_end` AS `warehouse_entry_time_end`,
`ldpl`.`dealer_name` AS `dealer_name`,
`ldpl`.`dealer_code` AS `dealer_code`,
`ldpl`.`send_warehouse_id` AS `send_warehouse_id`,
`ldpl`.`send_warehouse_name` AS `send_warehouse_name`,
`ldpl`.`accept_warehouse_id` AS `accept_warehouse_id`,
`ldpl`.`accept_warehouse_name` AS `accept_warehouse_name`,
`ldpl`.`order_package_delivery_status` AS `order_package_delivery_status`,
`ldl`.`update_time` AS `operatorTime`,
`ldl`.`create_user` AS `operatorId`,
'签收' AS `scanNodeType`,
'配送' AS `nodeName`
FROM
`logpm_distribution_parcel_list` `ldpl`
JOIN `logpm_distribution_loadscan` `ldl` ON
`ldpl`.`id` = `ldl`.`package_id`
AND `ldl`.`signfor_state` = 2
<where >
<if test= "param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)" >
and ldpl.warehouse_id in
<foreach collection= "param.warehouseIdList" item= "item" open= "(" close= ")" separator= "," >
#{item}
</foreach>
</if>
<if test= "param.orderCode != null and param.orderCode != '' " >
and ldpl.order_code like concat('%',#{param.orderCode},'%')
</if>
<if test= "param.orderPackageCode != null and param.orderPackageCode != '' " >
and ldpl.order_package_code like concat('%',#{param.orderPackageCode},'%')
</if>
<if test= "param.serviceNumber != null and param.serviceNumber != '' " >
and ldpl.service_number like concat('%',#{param.serviceNumber},'%')
</if>
<if test= "param.brandName != null and param.brandName != '' " >
and ldpl.brand_name like concat('%',#{param.brandName},'%')
</if>
<if test= "param.materialCode != null and param.materialCode != '' " >
and ldpl.material_code like concat('%',#{param.materialCode},'%')
</if>
<if test= "param.materialName != null and param.materialName != '' " >
and ldpl.material_name like concat('%',#{param.materialName},'%')
</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.date != null and param.date != '' " >
and ldl.update_time like concat(#{param.date},'%')
</if>
</where>
UNION ALL
SELECT
`ldpl`.`id` AS `id`,
`ldpl`.`tenant_id` AS `tenant_id`,
`ldpl`.`create_user` AS `create_user`,
`ldpl`.`create_time` AS `create_time`,
`ldpl`.`update_user` AS `update_user`,
`ldpl`.`update_time` AS `update_time`,
`ldpl`.`status` AS `status`,
`ldpl`.`is_deleted` AS `is_deleted`,
`ldpl`.`create_dept` AS `create_dept`,
`ldpl`.`reserve1` AS `reserve1`,
`ldpl`.`reserve2` AS `reserve2`,
`ldpl`.`reserve3` AS `reserve3`,
`ldpl`.`reserve4` AS `reserve4`,
`ldpl`.`reserve5` AS `reserve5`,
`ldpl`.`warehouse_id` AS `warehouse_id`,
`ldpl`.`warehouse` AS `warehouse`,
`ldpl`.`conditions` AS `conditions`,
`ldpl`.`order_package_code` AS `order_package_code`,
`ldpl`.`cargo_title` AS `cargo_title`,
`ldpl`.`shelf_title` AS `shelf_title`,
`ldpl`.`goods_allocation` AS `goods_allocation`,
`ldpl`.`pallet` AS `pallet`,
`ldpl`.`firsts` AS `firsts`,
`ldpl`.`second` AS `second`,
`ldpl`.`third_product` AS `third_product`,
`ldpl`.`quantity` AS `quantity`,
`ldpl`.`train_number` AS `train_number`,
`ldpl`.`stock_article_id` AS `stock_article_id`,
`ldpl`.`order_code` AS `order_code`,
`ldpl`.`service_number` AS `service_number`,
`ldpl`.`material_id` AS `material_id`,
`ldpl`.`material_name` AS `material_name`,
`ldpl`.`material_code` AS `material_code`,
`ldpl`.`material_unit` AS `material_unit`,
`ldpl`.`brand_id` AS `brand_id`,
`ldpl`.`brand_name` AS `brand_name`,
`ldpl`.`order_package_status` AS `order_package_status`,
`ldpl`.`order_package_freeze_status` AS `order_package_freeze_status`,
`ldpl`.`order_package_grounding_status` AS `order_package_grounding_status`,
`ldpl`.`order_package_stockup_status` AS `order_package_stockup_status`,
`ldpl`.`order_package_reservation_status` AS `order_package_reservation_status`,
`ldpl`.`order_package_loading_status` AS `order_package_loading_status`,
`ldpl`.`waybill_number` AS `waybill_number`,
`ldpl`.`waybill_id` AS `waybill_id`,
`ldpl`.`warehouse_entry_time_end` AS `warehouse_entry_time_end`,
`ldpl`.`dealer_name` AS `dealer_name`,
`ldpl`.`dealer_code` AS `dealer_code`,
`ldpl`.`send_warehouse_id` AS `send_warehouse_id`,
`ldpl`.`send_warehouse_name` AS `send_warehouse_name`,
`ldpl`.`accept_warehouse_id` AS `accept_warehouse_id`,
`ldpl`.`accept_warehouse_name` AS `accept_warehouse_name`,
`ldpl`.`order_package_delivery_status` AS `order_package_delivery_status`,
`lds`.`create_time` AS `operatorTime`,
`lds`.`create_user` AS `operatorId`,(
CASE
WHEN ( `lds`.`conditions` = 1 ) THEN
'配送备货'
WHEN ( `lds`.`conditions` = 2 ) THEN
'自提备货'
END
) AS `scanNodeType`,
'备货' AS `nodeName`
FROM
`logpm_distribution_parcel_list` `ldpl`
JOIN `logpm_distribution_stock` `lds` ON
`ldpl`.`id` = `lds`.`parcel_list_id`
<where >
<where >
vsr.is_deleted =0
<if test= "param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)" >
<if test= "param.nodeName !=null and param.nodeName != ''" >
and ldpl.warehouse_id in
and vsr.nodeName like concat('%',#{param.nodeName},'%')
<foreach collection= "param.warehouseIdList" item= "item" open= "(" close= ")" separator= "," >
#{item}
</foreach>
</if>
<if test= "param.orderCode != null and param.orderCode != '' " >
and ldpl.order_code like concat('%',#{param.orderCode},'%')
</if>
<if test= "param.orderPackageCode != null and param.orderPackageCode != '' " >
and ldpl.order_package_code like concat('%',#{param.orderPackageCode},'%')
</if>
<if test= "param.serviceNumber != null and param.serviceNumber != '' " >
and ldpl.service_number like concat('%',#{param.serviceNumber},'%')
</if>
<if test= "param.brandName != null and param.brandName != '' " >
and ldpl.brand_name like concat('%',#{param.brandName},'%')
</if>
<if test= "param.materialCode != null and param.materialCode != '' " >
and ldpl.material_code like concat('%',#{param.materialCode},'%')
</if>
<if test= "param.materialName != null and param.materialName != '' " >
and ldpl.material_name like concat('%',#{param.materialName},'%')
</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>
<if test= "param.date != null and param.date != '' " >
and lds.create_time like concat(#{param.date},'%')
</if>
</where>
UNION ALL
SELECT
`ldpl`.`id` AS `id`,
`ldpl`.`tenant_id` AS `tenant_id`,
`ldpl`.`create_user` AS `create_user`,
`ldpl`.`create_time` AS `create_time`,
`ldpl`.`update_user` AS `update_user`,
`ldpl`.`update_time` AS `update_time`,
`ldpl`.`status` AS `status`,
`ldpl`.`is_deleted` AS `is_deleted`,
`ldpl`.`create_dept` AS `create_dept`,
`ldpl`.`reserve1` AS `reserve1`,
`ldpl`.`reserve2` AS `reserve2`,
`ldpl`.`reserve3` AS `reserve3`,
`ldpl`.`reserve4` AS `reserve4`,
`ldpl`.`reserve5` AS `reserve5`,
`ldpl`.`warehouse_id` AS `warehouse_id`,
`ldpl`.`warehouse` AS `warehouse`,
`ldpl`.`conditions` AS `conditions`,
`ldpl`.`order_package_code` AS `order_package_code`,
`ldpl`.`cargo_title` AS `cargo_title`,
`ldpl`.`shelf_title` AS `shelf_title`,
`ldpl`.`goods_allocation` AS `goods_allocation`,
`ldpl`.`pallet` AS `pallet`,
`ldpl`.`firsts` AS `firsts`,
`ldpl`.`second` AS `second`,
`ldpl`.`third_product` AS `third_product`,
`ldpl`.`quantity` AS `quantity`,
`ldpl`.`train_number` AS `train_number`,
`ldpl`.`stock_article_id` AS `stock_article_id`,
`ldpl`.`order_code` AS `order_code`,
`ldpl`.`service_number` AS `service_number`,
`ldpl`.`material_id` AS `material_id`,
`ldpl`.`material_name` AS `material_name`,
`ldpl`.`material_code` AS `material_code`,
`ldpl`.`material_unit` AS `material_unit`,
`ldpl`.`brand_id` AS `brand_id`,
`ldpl`.`brand_name` AS `brand_name`,
`ldpl`.`order_package_status` AS `order_package_status`,
`ldpl`.`order_package_freeze_status` AS `order_package_freeze_status`,
`ldpl`.`order_package_grounding_status` AS `order_package_grounding_status`,
`ldpl`.`order_package_stockup_status` AS `order_package_stockup_status`,
`ldpl`.`order_package_reservation_status` AS `order_package_reservation_status`,
`ldpl`.`order_package_loading_status` AS `order_package_loading_status`,
`ldpl`.`waybill_number` AS `waybill_number`,
`ldpl`.`waybill_id` AS `waybill_id`,
`ldpl`.`warehouse_entry_time_end` AS `warehouse_entry_time_end`,
`ldpl`.`dealer_name` AS `dealer_name`,
`ldpl`.`dealer_code` AS `dealer_code`,
`ldpl`.`send_warehouse_id` AS `send_warehouse_id`,
`ldpl`.`send_warehouse_name` AS `send_warehouse_name`,
`ldpl`.`accept_warehouse_id` AS `accept_warehouse_id`,
`ldpl`.`accept_warehouse_name` AS `accept_warehouse_name`,
`ldpl`.`order_package_delivery_status` AS `order_package_delivery_status`,
`lwug`.`create_time` AS `operatorTime`,
`lwug`.`create_user` AS `operatorId`,
`lwug`.`remark` AS `scanNodeType`,
'上下架' AS `nodeName`
FROM
`logpm_distribution_parcel_list` `ldpl`
JOIN `logpm_warehouse_updown_goods_log` `lwug` ON
`ldpl`.`id` = `lwug`.`association_id`
<where >
<if test= "param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)" >
<if test= "param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)" >
and vsr.warehouse_id in
and ldpl .warehouse_id in
<foreach collection= "param.warehouseIdList" item= "item" open= "(" close= ")" separator= "," >
<foreach collection= "param.warehouseIdList" item= "item" open= "(" close= ")" separator= "," >
#{item}
#{item}
</foreach>
</foreach>
</if>
</if>
<if test= "param.scanNodeType != null and param.scanNodeType != '' " >
<if test= "param.orderCode != null and param.orderCode != '' " >
and vsr.scanNodeType like concat('%',#{param.scanNodeType},'%')
and ldpl.order_code like concat('%',#{param.orderCode},'%')
</if>
<if test= "param.orderPackageCode != null and param.orderPackageCode != '' " >
and ldpl.order_package_code like concat('%',#{param.orderPackageCode},'%')
</if>
<if test= "param.serviceNumber != null and param.serviceNumber != '' " >
and ldpl.service_number like concat('%',#{param.serviceNumber},'%')
</if>
<if test= "param.brandName != null and param.brandName != '' " >
and ldpl.brand_name like concat('%',#{param.brandName},'%')
</if>
<if test= "param.materialCode != null and param.materialCode != '' " >
and ldpl.material_code like concat('%',#{param.materialCode},'%')
</if>
<if test= "param.materialName != null and param.materialName != '' " >
and ldpl.material_name like concat('%',#{param.materialName},'%')
</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.date != null and param.date != '' " >
and lwug.create_time like concat(#{param.date},'%')
</if>
</where>
UNION ALL
SELECT
`ldpl`.`id` AS `id`,
`ldpl`.`tenant_id` AS `tenant_id`,
`ldpl`.`create_user` AS `create_user`,
`ldpl`.`create_time` AS `create_time`,
`ldpl`.`update_user` AS `update_user`,
`ldpl`.`update_time` AS `update_time`,
`ldpl`.`status` AS `status`,
`ldpl`.`is_deleted` AS `is_deleted`,
`ldpl`.`create_dept` AS `create_dept`,
`ldpl`.`reserve1` AS `reserve1`,
`ldpl`.`reserve2` AS `reserve2`,
`ldpl`.`reserve3` AS `reserve3`,
`ldpl`.`reserve4` AS `reserve4`,
`ldpl`.`reserve5` AS `reserve5`,
`ldpl`.`warehouse_id` AS `warehouse_id`,
`ldpl`.`warehouse` AS `warehouse`,
`ldpl`.`conditions` AS `conditions`,
`ldpl`.`order_package_code` AS `order_package_code`,
`ldpl`.`cargo_title` AS `cargo_title`,
`ldpl`.`shelf_title` AS `shelf_title`,
`ldpl`.`goods_allocation` AS `goods_allocation`,
`ldpl`.`pallet` AS `pallet`,
`ldpl`.`firsts` AS `firsts`,
`ldpl`.`second` AS `second`,
`ldpl`.`third_product` AS `third_product`,
`ldpl`.`quantity` AS `quantity`,
`ldpl`.`train_number` AS `train_number`,
`ldpl`.`stock_article_id` AS `stock_article_id`,
`ldpl`.`order_code` AS `order_code`,
`ldpl`.`service_number` AS `service_number`,
`ldpl`.`material_id` AS `material_id`,
`ldpl`.`material_name` AS `material_name`,
`ldpl`.`material_code` AS `material_code`,
`ldpl`.`material_unit` AS `material_unit`,
`ldpl`.`brand_id` AS `brand_id`,
`ldpl`.`brand_name` AS `brand_name`,
`ldpl`.`order_package_status` AS `order_package_status`,
`ldpl`.`order_package_freeze_status` AS `order_package_freeze_status`,
`ldpl`.`order_package_grounding_status` AS `order_package_grounding_status`,
`ldpl`.`order_package_stockup_status` AS `order_package_stockup_status`,
`ldpl`.`order_package_reservation_status` AS `order_package_reservation_status`,
`ldpl`.`order_package_loading_status` AS `order_package_loading_status`,
`ldpl`.`waybill_number` AS `waybill_number`,
`ldpl`.`waybill_id` AS `waybill_id`,
`ldpl`.`warehouse_entry_time_end` AS `warehouse_entry_time_end`,
`ldpl`.`dealer_name` AS `dealer_name`,
`ldpl`.`dealer_code` AS `dealer_code`,
`ldpl`.`send_warehouse_id` AS `send_warehouse_id`,
`ldpl`.`send_warehouse_name` AS `send_warehouse_name`,
`ldpl`.`accept_warehouse_id` AS `accept_warehouse_id`,
`ldpl`.`accept_warehouse_name` AS `accept_warehouse_name`,
`ldpl`.`order_package_delivery_status` AS `order_package_delivery_status`,
`lwtg`.`create_time` AS `operatorTime`,
`lwtg`.`create_user` AS `operatorId`,
`lwtg`.`remark` AS `scanNodeType`,
'打托' AS `nodeName`
FROM
`logpm_distribution_parcel_list` `ldpl`
JOIN `logpm_warehouse_tray_goods_log` `lwtg` ON
`ldpl`.`id` = `lwtg`.`association_id`
<where >
<if test= "param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)" >
and ldpl.warehouse_id in
<foreach collection= "param.warehouseIdList" item= "item" open= "(" close= ")" separator= "," >
#{item}
</foreach>
</if>
</if>
<if test= "param.orderCode != null and param.orderCode != '' " >
<if test= "param.orderCode != null and param.orderCode != '' " >
and vsr.order_code like concat('%',#{param.orderCode},'%')
and ldpl .order_code like concat('%',#{param.orderCode},'%')
</if>
</if>
<if test= "param.orderPackageCode != null and param.orderPackageCode != '' " >
<if test= "param.orderPackageCode != null and param.orderPackageCode != '' " >
and vsr.order_package_code like concat('%',#{param.orderPackageCode},'%')
and ldpl .order_package_code like concat('%',#{param.orderPackageCode},'%')
</if>
</if>
<if test= "param.serviceNumber != null and param.serviceNumber != '' " >
<if test= "param.serviceNumber != null and param.serviceNumber != '' " >
and vsr.service_number like concat('%',#{param.serviceNumber},'%')
and ldpl .service_number like concat('%',#{param.serviceNumber},'%')
</if>
</if>
<if test= "param.brandName != null and param.brandName != '' " >
<if test= "param.brandName != null and param.brandName != '' " >
and vsr.brand_name like concat('%',#{param.brandName},'%')
and ldpl .brand_name like concat('%',#{param.brandName},'%')
</if>
</if>
<if test= "param.materialCode != null and param.materialCode != '' " >
<if test= "param.materialCode != null and param.materialCode != '' " >
and vsr.material_code like concat('%',#{param.materialCode},'%')
and ldpl .material_code like concat('%',#{param.materialCode},'%')
</if>
</if>
<if test= "param.materialName != null and param.materialName != '' " >
<if test= "param.materialName != null and param.materialName != '' " >
and vsr.material_name like concat('%',#{param.materialName},'%')
and ldpl .material_name like concat('%',#{param.materialName},'%')
</if>
</if>
<if test= "param.firsts != null and param.firsts != '' " >
<if test= "param.firsts != null and param.firsts != '' " >
and vsr.firsts like concat('%',#{param.firsts},'%')
and ldpl .firsts like concat('%',#{param.firsts},'%')
</if>
</if>
<if test= "param.second != null and param.second != '' " >
<if test= "param.second != null and param.second != '' " >
and vsr.second like concat('%',#{param.second},'%')
and ldpl .second like concat('%',#{param.second},'%')
</if>
</if>
<if test= "param.thirdProduct != null and param.thirdProduct != '' " >
<if test= "param.thirdProduct != null and param.thirdProduct != '' " >
and vsr.third_product like concat('%',#{param.thirdProduct},'%')
and ldpl.third_product like concat('%',#{param.thirdProduct},'%')
</if>
<if test= "param.date != null and param.date != '' " >
and lwtg.create_time like concat(#{param.date},'%')
</if>
</if>
</where>
</where>
</select>
</select>
<!-- </select><select id="selectWarehouseStockPage" resultType="com.logpm.warehouse.vo.WarehouseScanRecordVO"> -->
<!-- select vsr.* from view_scan_record vsr -->
<!-- <where> -->
<!-- vsr.is_deleted =0 -->
<!-- <if test="param.nodeName !=null and param.nodeName != ''"> -->
<!-- and vsr.nodeName like concat('%',#{param.nodeName},'%') -->
<!-- </if> -->
<!-- <if test="param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)"> -->
<!-- and vsr.warehouse_id in -->
<!-- <foreach collection="param.warehouseIdList" item="item" open="(" close=")" separator=","> -->
<!-- #{item} -->
<!-- </foreach> -->
<!-- </if> -->
<!-- <if test="param.scanNodeType != null and param.scanNodeType != '' "> -->
<!-- and vsr.scanNodeType like concat('%',#{param.scanNodeType},'%') -->
<!-- </if> -->
<!-- <if test="param.orderCode != null and param.orderCode != '' "> -->
<!-- and vsr.order_code like concat('%',#{param.orderCode},'%') -->
<!-- </if> -->
<!-- <if test="param.orderPackageCode != null and param.orderPackageCode != '' "> -->
<!-- and vsr.order_package_code like concat('%',#{param.orderPackageCode},'%') -->
<!-- </if> -->
<!-- <if test="param.serviceNumber != null and param.serviceNumber != '' "> -->
<!-- and vsr.service_number like concat('%',#{param.serviceNumber},'%') -->
<!-- </if> -->
<!-- <if test="param.brandName != null and param.brandName != '' "> -->
<!-- and vsr.brand_name like concat('%',#{param.brandName},'%') -->
<!-- </if> -->
<!-- <if test="param.materialCode != null and param.materialCode != '' "> -->
<!-- and vsr.material_code like concat('%',#{param.materialCode},'%') -->
<!-- </if> -->
<!-- <if test="param.materialName != null and param.materialName != '' "> -->
<!-- and vsr.material_name like concat('%',#{param.materialName},'%') -->
<!-- </if> -->
<!-- <if test="param.firsts != null and param.firsts != '' "> -->
<!-- and vsr.firsts like concat('%',#{param.firsts},'%') -->
<!-- </if> -->
<!-- <if test="param.second != null and param.second != '' "> -->
<!-- and vsr.second like concat('%',#{param.second},'%') -->
<!-- </if> -->
<!-- <if test="param.thirdProduct != null and param.thirdProduct != '' "> -->
<!-- and vsr.third_product like concat('%',#{param.thirdProduct},'%') -->
<!-- </if> -->
<!-- </where> -->
<!-- </select> -->
<select id= "selectWarehouseStockInventoryPage" resultType= "com.logpm.warehouse.vo.WarehouseScanInventoryRecordVO" >
<select id= "selectWarehouseStockInventoryPage" resultType= "com.logpm.warehouse.vo.WarehouseScanInventoryRecordVO" >
</select>
</select>