|
@@ -3,63 +3,65 @@
|
|
|
<mapper namespace="com.steerinfo.dil.mapper.ShipDynamicsMapper">
|
|
|
<!-- 获取数据 -->
|
|
|
<select id="selectAll" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
- select *
|
|
|
- from (
|
|
|
- select db.BATCH_ID "batchId",
|
|
|
- db.result_foreign_ship_name "shipName",
|
|
|
- rm.material_name "materialName",
|
|
|
- actr.result_date_of_loans "tonnage",
|
|
|
- actr.RESULT_NUMBER_OF_LOANS "dateOfLoans",
|
|
|
- rp.port_name "numberOfLoans",
|
|
|
- wgm.gm_tonnage "portName",
|
|
|
- rc.capacity_number "capacity",
|
|
|
- tlsr.RESULT_ACTUAL_INSTALLATIONS "capacityNumber",
|
|
|
- tlsr.RESULT_OUT_PORT_TIME "outPortTime",
|
|
|
- tsl.LOCATION_STATUS "locationStatus",
|
|
|
- tsl.LOCATION_VALUE "locationValue",
|
|
|
- tsl.LOCATION_ROUTE_TIME "localtionRouteTime"
|
|
|
- from DIL_BATCH db
|
|
|
- join rms_material rm on db.material_id = rm.material_id
|
|
|
- left join AMSSHIP_CARGO_TRANSFER_RESULT actr on db.batch_id = actr.batch_id
|
|
|
- left join AMSSHIP_DELIVERY_NOTICE adn on adn.batch_id = db.batch_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 TMSSHIP_LOAD_SHIP_RESULT tlsr on db.batch_id = tlsr.batch_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 rms_capacity rc on oic.capacity_id = rc.capacity_id
|
|
|
- left join (select *
|
|
|
- from tmsship_ship_location t
|
|
|
- where t.location_id in
|
|
|
- (SELECT t.location_id
|
|
|
- FROM (
|
|
|
- SELECT t.location_id,
|
|
|
- t.total_result_id,
|
|
|
- t.location_route_time,
|
|
|
- ROW_NUMBER() OVER (
|
|
|
- PARTITION BY t.total_result_id
|
|
|
- ORDER BY t.location_route_time DESC
|
|
|
- ) AS rn
|
|
|
- FROM tmsship_ship_location t
|
|
|
- ) t
|
|
|
- WHERE rn = 1)) tsl on tsl.total_result_id = ttr.result_id
|
|
|
- where ttr.ship_status = 0
|
|
|
- )
|
|
|
- where "locationValue" is not null
|
|
|
+ select db.BATCH_ID "batchId",
|
|
|
+ db.result_foreign_ship_name "shipName",
|
|
|
+ rm.material_name "materialName",
|
|
|
+ actr.result_date_of_loans "dateOfLoans",
|
|
|
+ actr.RESULT_NUMBER_OF_LOANS "numberOfLoans",
|
|
|
+ rp.port_name "portName",
|
|
|
+ wgm.gm_tonnage "tonnage",
|
|
|
+ rc.capacity_number "capacity",
|
|
|
+ tlsr.RESULT_ACTUAL_INSTALLATIONS "capacityNumber",
|
|
|
+ tlsr.RESULT_OUT_PORT_TIME "outPortTime",
|
|
|
+ tsl.LOCATION_STATUS "locationStatus",
|
|
|
+ tsl.LOCATION_VALUE "locationValue",
|
|
|
+ tsl.LOCATION_ROUTE_TIME
|
|
|
+ from DIL_BATCH db
|
|
|
+ join rms_material rm on db.material_id=rm.material_id
|
|
|
+ left join AMSSHIP_CARGO_TRANSFER_RESULT actr on db.batch_id=actr.batch_id
|
|
|
+ left join AMSSHIP_DELIVERY_NOTICE adn on adn.batch_id=db.batch_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 TMSSHIP_LOAD_SHIP_RESULT tlsr on db.batch_id=tlsr.batch_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 rms_capacity rc on oic.capacity_id=rc.capacity_id
|
|
|
+ left join (select * from tmsship_ship_location t where t.location_id in
|
|
|
+ (SELECT
|
|
|
+ t.location_id
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ t.location_id,
|
|
|
+ t.total_result_id,
|
|
|
+ t.location_route_time,
|
|
|
+ ROW_NUMBER () OVER (
|
|
|
+ PARTITION BY t.total_result_id
|
|
|
+ ORDER BY t.location_route_time DESC
|
|
|
+ ) AS rn
|
|
|
+ FROM
|
|
|
+ tmsship_ship_location t
|
|
|
+ ) t
|
|
|
+ WHERE
|
|
|
+ rn = 1)) tsl on tsl.total_result_id=ttr.result_id
|
|
|
+ where ttr.ship_status = 0 and tsl.LOCATION_STATUS is not null
|
|
|
</select>
|
|
|
<select id="selectByshipName" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
select sd.GM_TONNAGE as "tonnage",
|