|
@@ -21,29 +21,12 @@
|
|
RMT.MATERIAL_TYPE_NAME "materialTypeName",
|
|
RMT.MATERIAL_TYPE_NAME "materialTypeName",
|
|
RMT.MATERIAL_TYPE_ID "materialTypeId",
|
|
RMT.MATERIAL_TYPE_ID "materialTypeId",
|
|
OSI.INSTRUCTIONS_STATUS "instructionStatus"
|
|
OSI.INSTRUCTIONS_STATUS "instructionStatus"
|
|
- from DIL_BATCH_INFACOTRY DBI2
|
|
|
|
|
|
+ from AMSSHIP_DELIVERY_NOTICE adn
|
|
|
|
+ LEFT JOIN DIL_BATCH_INFACOTRY DBI2 on adn.batch_id=DBI2.BATCH_INFACOTRY_ID
|
|
JOIN DIL_BATCH DB ON DBI2.BATCH_ID=DB.BATCH_ID
|
|
JOIN DIL_BATCH DB ON DBI2.BATCH_ID=DB.BATCH_ID
|
|
join rms_material rm on db.material_id=rm.material_id
|
|
join rms_material rm on db.material_id=rm.material_id
|
|
- left join AMSSHIP_DELIVERY_NOTICE adn on adn.batch_id=DBI2.BATCH_INFACOTRY_ID
|
|
|
|
left join rms_port rp on rp.port_id=adn.port_id
|
|
left join rms_port rp on rp.port_id=adn.port_id
|
|
- left join (select * from WMSH_GRID_MATERIAL wgm where wgm.GM_ID in
|
|
|
|
- (SELECT
|
|
|
|
- wgm.GM_ID
|
|
|
|
- FROM
|
|
|
|
- (
|
|
|
|
- SELECT
|
|
|
|
- wgm.GM_ID,
|
|
|
|
- wgm.BATCH_ID,
|
|
|
|
- wgm.INSERT_TIME,
|
|
|
|
- ROW_NUMBER () OVER (
|
|
|
|
- PARTITION BY wgm.BATCH_ID
|
|
|
|
- ORDER BY wgm.INSERT_TIME DESC
|
|
|
|
- ) AS rn
|
|
|
|
- FROM
|
|
|
|
- WMSH_GRID_MATERIAL wgm
|
|
|
|
- ) wgm
|
|
|
|
- WHERE
|
|
|
|
- rn = 1)) wgm on wgm.batch_id = DB.BATCH_ID
|
|
|
|
|
|
+ left join WMSH_GRID_MATERIAL wgm on wgm.batch_id = DB.BATCH_ID AND ADN.PORT_ID=WGM.PORT_ID
|
|
left join TMSSHIP_LOAD_SHIP_RESULT tlsr on DBI2.BATCH_INFACOTRY_ID=tlsr.batch_id
|
|
left join TMSSHIP_LOAD_SHIP_RESULT tlsr on DBI2.BATCH_INFACOTRY_ID=tlsr.batch_id
|
|
left join tmsship_total_result ttr on ttr.result_id=tlsr.TOTAL_RESULT_ID
|
|
left join tmsship_total_result ttr on ttr.result_id=tlsr.TOTAL_RESULT_ID
|
|
left join omsship_instructions_capacity oic on ttr.order_id=oic.instructions_capacity_id
|
|
left join omsship_instructions_capacity oic on ttr.order_id=oic.instructions_capacity_id
|