outboundMoveTaskQuery.presto 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <script>
  2. SELECT
  3. move.MOVE_TASK_ID,
  4. move.warehouse_id,
  5. obill.CONSIGNORNAME ,
  6. bill.CONTACT_NAME,
  7. bill.CONSIGNOR_ID ,
  8. bill.SRC_CODE ,
  9. bill.wave_id,
  10. item.ITEM_NAME,
  11. item.CASE_UOM uom,
  12. item.PIECE_UOM ,
  13. move.ITEM_ID,
  14. move.SRC_WAREHOUSE_LOCATOR_NUM as SRC_LOCATOR_CODE,
  15. move.SRC_WAREHOUSE_AREA_NUM as SRC_WAREHOUSE_AREA_CODE,
  16. move.DEST_WAREHOUSE_AREA_NUM as dest_WAREHOUSE_AREA_CODE,
  17. move.DEST_WAREHOUSE_LOCATOR_NUM AS DEST_LOCATOR_CODE,
  18. move.MANUFACTURER_LOT_NUM manufacturer_Lot_num,
  19. SRCBLDG.BLDG_CODE src_bldg_code,
  20. destbldg.BLDG_CODE dest_bldg_code,
  21. move.QTY piece_qty,
  22. move.QTY /move.CONVERSION_RATE caseQty,
  23. item.SPECIFICATION,
  24. move.CONVERSION_RATE,
  25. move.OUTSTORE_WORKER_NAME,
  26. destbldg.BLDG_CODE,
  27. move.status,
  28. move.move_type,
  29. move.gmt_create
  30. FROM
  31. upcloud_base_wh_outbound.upcloud_biz_outbound.wms_move_task move
  32. LEFT JOIN upcloud_base_wh_outbound.upcloud_biz_outbound.wms_wave_bill bill ON move.bill_id = bill.id
  33. LEFT JOIN upcloud_base_wh_outbound.upcloud_biz_outbound.OMS_DO_BILL_H obill ON obill.BILLNO =bill.SRC_CODE
  34. LEFT JOIN upcloud_base_item.UPCLOUD_BASE_ITEM.BASE_MTL_ITEM_MST item ON MOVE.ITEM_ID = ITEM.ITEM_ID
  35. LEFT JOIN upcloud_base_wh.UPCLOUD_BASE_WAREHOUSE.BASE_WMS_WH_LOCATOR srcLOCATOR ON srcLOCATOR.WAREHOUSE_LOCATOR_ID = move.SRC_WAREHOUSE_LOCATOR_ID
  36. LEFT JOIN upcloud_base_wh.UPCLOUD_BASE_WAREHOUSE.BASE_WMS_WH_BLDG srcbldg ON srcbldg.BLDG_ID = srcLOCATOR.BLDG_ID
  37. LEFT JOIN upcloud_base_wh.UPCLOUD_BASE_WAREHOUSE.BASE_WMS_WH_LOCATOR destLocator ON destLocator.WAREHOUSE_LOCATOR_ID = move.dest_WAREHOUSE_LOCATOR_ID
  38. LEFT JOIN upcloud_base_wh.UPCLOUD_BASE_WAREHOUSE.BASE_WMS_WH_BLDG destbldg ON destbldg.BLDG_ID = destLocator.BLDG_ID
  39. where 1 = 1
  40. <if test="params.waveId != null and params.waveId != ''">
  41. and bill.wave_id = #{waveId}
  42. </if>
  43. <if test="params.warehouseId != null and params.warehouseId != ''">
  44. and bill.warehouse_id = #{warehouseId}
  45. </if>
  46. <if test="params.itemCode != null and params.itemCode != ''">
  47. and item.item_code = #{itemCode}
  48. </if>
  49. <if test="params.consignorId != null and params.consignorId != ''">
  50. and bill.CONSIGNOR_ID = #{consignorId}
  51. </if>
  52. <if test="params.billCode != null and params.billCode != ''">
  53. and bill.code = #{billCode}
  54. </if>
  55. <if test="params.srcBldgCode != null and params.srcBldgCode != ''">
  56. and SRCBLDG.BLDG_CODE = #{srcBldgCode}
  57. </if>
  58. <if test="params.destBldgCode != null and params.destBldgCode != ''">
  59. and destbldg.BLDG_CODE = #{destBldgCode}
  60. </if>
  61. <if test="params.workerNo != null and params.workerNo != ''">
  62. and move.OUTSTORE_WORKER_NAME = #{workerNo}
  63. </if>
  64. <if test="params.status != null and params.status != ''">
  65. and move.status = #{status}
  66. </if>
  67. order by move.gmt_create desc
  68. </script>