workstageQuery.presto 954 B

1234567891011121314151617181920212223242526272829303132
  1. <script>
  2. SELECT
  3. stage.id,
  4. stage.building_code,
  5. stage.stage_code,
  6. stage.stage_type,
  7. stage.case_qty,
  8. bill.warehouse_id,
  9. bill.CONTACT_NAME,
  10. bill.CONTACT_TEL,
  11. bill.SRC_CODE,
  12. bill.RECEIVE_ADDRESS,
  13. bill.ship_line_id,
  14. stage.bill_group_id,
  15. omsBill.CONSIGNORNAME
  16. FROM
  17. upcloud_base_wh_outbound.upcloud_biz_outbound.wms_work_stage_runtime stage
  18. LEFT JOIN upcloud_base_wh_outbound.upcloud_biz_outbound.wms_wave_bill bill ON stage.bill_group_id = bill.BILL_GROUP_ID
  19. left join upcloud_base_wh_outbound.upcloud_biz_outbound.OMS_DO_BILL_H omsBill on omsbill.billno=bill.src_code
  20. where 1 = 1
  21. <if test="params.waveId != null and params.waveId != ''">
  22. and bill.wave_id = #{waveId}
  23. </if>
  24. <if test="params.warehouseId != null and params.warehouseId != ''">
  25. and bill.warehouse_id = #{warehouseId}
  26. </if>
  27. <if test="params.billCode != null and params.billCode != ''">
  28. and bill.src_code = #{billCode}
  29. </if>
  30. order by bill.src_code
  31. </script>