12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <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>
- <select id="selectByshipName" resultType="java.util.Map" parameterType="java.util.Map">
- select sd.GM_TONNAGE as "tonnage",
- sd.RESULT_DATE_OF_LOANS as "dateOfLoans",
- sd.RESULT_NUMBER_OF_LOANS as "numberOfLoans",
- sd.PORT_NAME as "portName",
- sd.CAPACITY_NUMBER as "capacity",
- sd.RESULT_ACTUAL_INSTALLATIONS as "capacityNumber",
- sd.RESULT_OUT_PORT_TIME as "outPortTime",
- sd.LOCATION_VALUE as "locationValue",
- sd.LOCATION_STATUS as "locationStatus"
- from SHIP_DYNAMICS sd where sd.RESULT_FOREIGN_SHIP_NAME=#{shipName} and sd.MATERIAL_NAME=#{materialName} and sd.LOCATION_STATUS is not null
- </select>
- </mapper>
|