123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384 |
- <?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.shanghaichengdi.ghjgitem.mapper.CommonMapper">
- <select id="selectAisRealTimeXYList" resultType="com.shanghaichengdi.ghjgitem.vo.BoatAISVo">
- select k.DEVICEID,i.SHIP_NAME_CN BOATNAME,i.SHIP_NAME_EN
- boatNameEn,i.SHIP_LENGTH,i.SHIP_BREADTH,i.SHIP_DEPTH,
- k.VELOCITY,k.DIRECTION,k.GPSTIME,k.LATITUDE,k.LONGITUDE,k.mapx,k.mapy
- from GHJG_DYNAMIC.VW_GPSINFO_REALTIME k
- left join ghjg_basics.mvw_boat_info i on i.mmsi = k.DEVICEID
- where 1=1
- <if test="deviceId != '' and deviceId != null">
- and k.DEVICEID = #{deviceId}
- </if>
- <if test="startTime != '' and startTime != null and endTime != '' and endTime != null">
- and k.GPSTIME >= to_date(#{startTime},'yyyy-mm-dd hh24:mi:ss')
- and k.GPSTIME <= to_date(#{endTime},'yyyy-mm-dd hh24:mi:ss')
- </if>
- and k.mapx > #{minX} and k.mapx < #{maxX}
- and k.mapy > #{minY} and k.mapy < #{maxY}
- order by k.GPSTIME desc
- </select>
- <select id="getLastInformNo" resultType="String">
- select max(t.docnumber) code
- from GHJG_DYNAMIC.BUSINESS_SUPERVISION_INFORM t
- where t.docnumber like #{rules} || '%'
- </select>
- <select id="getLastRecordNo" resultType="String">
- select max(t.supervisionnumber) code
- from GHJG_DYNAMIC.BUSINESS_SUPERVISION_record t
- where t.supervisionnumber like #{rules} || '%'
- </select>
- <select id="selectCargoDeclareInfo"
- resultType="com.shanghaichengdi.ghjgitem.vo.CCbCargoDeclareRecVo">
- select t.goods_id goodsId,
- t.specific_name specificName,
- t.actual_carrying_capacity actualCarryingCapacity,
- t.port_cargo portCargo,
- t.is_dangerous_goods isDangerousGoods
- from GHJG_BASICS.C_CB_CARGO_DECLARE_REC t
- where t.REPORT_ID = #{reportId}
- </select>
- <select id="selectShipCrewInfo" resultType="com.shanghaichengdi.ghjgitem.vo.CCbOnShipCrewRecVo">
- select t.crew_id crewId, t.name name
- from GHJG_BASICS.C_CB_ON_SHIP_CREW_REC t
- where t.REPORT_ID = #{reportId}
- </select>
- <select id="selectInfoList" resultType="com.shanghaichengdi.ghjgitem.vo.VwCertInfoSelfAllVo">
- select *
- from (select distinct infoall.CODE code,
- infoall.CRET_TYPE cretType,
- infoall.FZJG fzjg,
- infoall.CRET_NUMER cretNumer,
- infoall.CNAME cname,
- infoall.JUDGMENT judgment,
- to_char(infoall.BUSINESS_TYPE) businessType,
- '' bz,
- '' baseid,
- 2 infoSource,
- '' infoStats,
- infoall.CRE_DATE creDate,
- infoall.EFFECTIVESTARTDATE effectivestartdate,
- infoall.EFFECTIVEENDDATE effectiveenddate,
- t2.TAXLICENSE taxlicense,
- t2.CNNAME enterpriseName,
- t2.ENNAME enterpriseEnName,
- t2.MANAGECLASS manageClass,
- t2.LEGALPERSON legalPerson,
- t2.LEGALPERSONDOCUMENTTYPE legalPersonDocumentType,
- t2.LEGALPERSONDOCUMENTNUM legalPersonDocumentNum,
- t2.LEGALPERSONPHONE legalPersonPhone,
- t2.PHONENUMBER phoneNumber,
- t2.EMAIL email,
- t2.BUSINESSLICENSE businessLicense,
- t2.REGISTEREDDISTRICT registeredDistrict,
- t2.REGISTEREDADDRESS registeredAddress,
- t2.LICENSENUMBER licenseNumber,
- t2.CANCELLATIONDATE cancellationDate,
- ss.ECONOMIC_TYPE,
- ss.BUSINESS_SCOPE,
- row_number() over (partition by infoall.cname ORDER BY infoall.EFFECTIVESTARTDATE desc) rn
- from GHJG_BASICS.Vw_Cret_Info_Self_All infoall
- left join GHJG_BASICS.TOBJ_ENTERPRISE_BASIC t2 on infoall.cname = t2.cnname
- left join GHJG_PORT_MANAGE.SY_INSPECT ss
- on ss.LICENSE_NUMBER = infoall.CRET_NUMER
- where (infoall.JUDGMENT like '%上海市浦东新区建设和交通委员会%')
- and infoall.cname not in ('上海新洋山集装箱运输有限公司'))
- where rn = 1
- </select>
- <select id="selectBoatInfoList" resultType="com.shanghaichengdi.ghjgitem.vo.ShipDataVo">
- select T.SHIP_REG_NO shipRegNo,
- T.SHIP_ID shipId,
- T.SHIP_NAME_CN shipNameCn,
- T.SHIP_IMO shipImo,
- T.MMSI mmsi,
- T.REGPORT_CODE regportCode,
- T.SHIP_ROUTE_CODE shipRouteCode,
- T.SHIP_TYPE_CODE shipTypeCode,
- T.SHIP_SUMMER_DRAFT shipSummerDraft,
- T.SHIP_WIND_LEVEL shipWindLevel,
- T.SHIP_MINIMUM_FREEBOARD shipMinimumFreeboard,
- T.SHIP_CONTAINER_NUM shipContainerNum,
- T.SHIP_PARKING_NUM shipParkingNum,
- T.SHIP_PASSENGER_NUM shipPassengerNum,
- T.REMARK remark,
- T.SHIP_INSPECT_NO shipInspectNo,
- T.SHIP_CALLSIGN shipCallsign,
- T.SAILINGAREA_CODE sailingareaCode,
- T.SHIP_BUILT_DATE shipBuiltDate,
- T.SHIPYARD_CN shipyardCn,
- T.SHIP_BUILT_ADDR_CN shipBuiltAddrCn,
- T.SHIP_LENGTH shipLength,
- T.SHIP_BREADTH shipBreadth,
- T.SHIP_DEPTH shipDepth,
- T.SHIP_GROSSTON shipGrosston,
- T.SHIP_NETTON shipNetton,
- T.SHIP_DWT shipDwt,
- T.SHIP_ENGINE_POWER shipEnginePower,
- T.SHIP_REGION_TYPE shipRegionType,
- T.SHIP_REBUILT_DATE shipRebuiltDate,
- T.ORG_CODE orgCode,
- T.CREATE_TIME createTime,
- T.LAST_UPDATE_DATE lastUpdateDate,
- T.DELETE_FLAG deleteFlag,
- T.SHIP_OWNER_ADDR_CN shipOwnerAddrCn,
- T.OWNER_LEGAL_PERSON ownerLegalPerson,
- T.OWNER_CONTACT_PHONE ownerContactPhone,
- T.SHIP_TYPE_NAME shipTypeName,
- T.REGPORT_NAME regportName,
- T.SHIP_ROUTE_NAME shipRouteName
- from GHJG_BASICS.MVW_BOAT_INFO T
- <where>
- <if test="shipId != null and shipId != ''">
- and T.SHIP_ID = #{shipId}
- </if>
- <if test="mmsi != null and mmsi != ''">
- and T.MMSI like #{mmsi} || '%'
- </if>
- <if test="shipTypeName != null and shipTypeName != ''">
- and T.SHIP_TYPE_NAME = #{shipTypeName}
- </if>
- <if test="shipNameCn != null and shipNameCn != ''">
- and T.SHIP_NAME_CN = #{shipNameCn}
- </if>
- </where>
- </select>
- <select id="obscureSelectBoatInfoList" resultType="com.shanghaichengdi.ghjgitem.vo.ShipDataVo">
- select *
- from (select T.SHIP_NAME_CN shipNameCn,
- T.SHIP_NAME_EN shipNameEn,
- T.MMSI mmsi,
- T.SHIP_TYPE_CODE shipTypeCode,
- T.SHIP_TYPE_NAME shipTypeName,
- T.LAST_UPDATE_DATE lastUpdateDate,
- T.SHIP_IMO shipImo,
- T.SHIP_CALLSIGN shipCallsign,
- T1.LATITUDE latitude,
- T1.LONGITUDE longtitude,
- T1.DIRECTION direction,
- T1.VELOCITY velocity,
- T1.SHIPSTATE shipState,
- row_number() over (partition by T1.DEVICEID order by T1.GPSTIME desc) rn
- from GHJG_BASICS.MVW_BOAT_INFO T
- left join GHJG_DYNAMIC.VW_GPSINFO_REALTIME T1 on T.MMSI = T1.DEVICEID
- where T.SHIP_NAME_CN like '%' || #{keyWord} || '%' or
- T.MMSI like #{keyWord} || '%')
- where rn = 1
- </select>
- <select id="selectBoatReportInfoList" resultType="com.shanghaichengdi.ghjgitem.vo.BoatReportInfoVo">
- select t.REPORT_ID reportId,
- t.SHIP_ID shipId,
- t.REPORT_NO reportNo,
- t.ORG_CODE orgCode,
- t.REPORT_PORT_NAME reportPortName,
- t.REPORT_PORT_CODE reportPortCode,
- t.ARRIVAL_OR_LEAVE arrivalOrLeave,
- t.ARRIVAL_REPORT_ID arrivalReportId,
- t.NEXT_PORT_NAME nextPortName,
- t.NEXT_PORT_CODE nextPortCode,
- t.REPORT_TIME reportTime,
- t.EXPECT_TIME expectTime,
- t.IF_ANCHORED ifAnchored,
- t.DRAFT_FORWARD draftForward,
- t.AFT_DRAFT aftDraft,
- t.BERTH_CODE berthCode,
- t.BERTH_NAME berthName,
- t.ACTUAL_CARRYING_CAPACITY actualCarryingCapacity,
- t.PORT_CARGO portCargo,
- t.REAL_DANGER_CARGO realDangerCargo,
- t.PORT_DANGER_CARGO portDangerCargo,
- t.ACTUAL_CAPACITY actualCapacity,
- t.PORT_PASSENGER portPassenger,
- t.REAL_VEHICLE realVehicle,
- t.PORT_VEHICLE portVehicle,
- t.NUM_OF_BARGE numOfBarge,
- t.PORT_BARGE portBarge,
- t.REAL_CONTAINER_QAY realContainerQay,
- t.PORT_CONTAINER_QAY portContainerQay,
- t.IF_REVOKE ifRevoke,
- t.VOYAGE_REPORT voyageReport,
- t.FREQUENCY frequency,
- t.NAVIGATION_SECTION navigationSection,
- t.PRE_PORT_NAME prePortName,
- t.PRE_PORT_CODE prePortCode,
- t.SHIP_NAME_CN shipName,
- t.MMSI mmsi,
- t.BID_NAME bidName,
- t.MOBILE_PHONE mobilePhone
- from GHJG_BASICS.c_cb_ship_eep_report_rec partition(${partition}) t
- left join ghjg_basics.dict_district_port p on p.berthname = t.berth_name and p.valid = '有效'
- and p.lochus != '注销'
- where 1 = 1
- and (REPORT_PORT_CODE like '31%'
- or NEXT_PORT_CODE like '31%'
- or PRE_PORT_CODE like '31%')
- and p.team = '浦东新区'
- <if test="reportId != '' and reportId != null">
- and t.REPORT_ID = #{reportId}
- </if>
- <if test="shipId != '' and shipId != null">
- and t.SHIP_ID = #{shipId}
- </if>
- <if test="startTime != null and endTime != null and endTime != '' and startTime != ''">
- and REPORT_TIME >= to_date(#{startTime},'yyyy-mm-dd hh24:mi:ss')
- and REPORT_TIME <= to_date(#{endTime},'yyyy-mm-dd hh24:mi:ss')
- </if>
- <if test="reportNo != '' and reportNo != null">
- and t.REPORT_NO = #{reportNo}
- </if>
- order by t.REPORT_TIME desc
- </select>
- <select id="selectCountByRange" resultType="com.shanghaichengdi.ghjgitem.vo.CountVo">
- select count(1) count
- from GHJG_DYNAMIC.VW_GPSINFO_REALTIME t
- where t.LATITUDE >= #{minLat}
- and t.LATITUDE <= #{maxLat}
- and t.LONGITUDE >= #{minLon}
- and t.LONGITUDE <= #{maxLon}
- </select>
- <select id="selectBoatInfoByRange" resultType="com.shanghaichengdi.ghjgitem.vo.ShipDataVo">
- select *
- from (select T.MMSI mmsi,
- T1.DIRECTION direction,
- T1.VELOCITY velocity,
- T.LAST_UPDATE_DATE lastUpdateDate,
- T1.LATITUDE latitude,
- T1.LONGITUDE longtitude,
- T.SHIP_NAME_EN shipNameEn,
- T.SHIP_NAME_CN shipNameCn,
- T.SHIP_LENGTH shipLength,
- T.SHIP_BREADTH shipBreadth,
- T1.SHIPSTATE shipState,
- T.SHIP_SUMMER_DRAFT shipSummerDraft,
- T.SHIP_IMO shipImo,
- T.SHIP_TYPE_CODE shipTypeCode,
- T.SHIP_TYPE_NAME shipTypeName,
- T.SHIP_CALLSIGN shipCallsign,
- T.SHIP_BUILT_DATE shipBuiltDate,
- T.SHIP_DWT shipDwt,
- row_number() over (partition by T1.DEVICEID order by T1.GPSTIME desc) rn
- from GHJG_BASICS.MVW_BOAT_INFO T
- left join GHJG_DYNAMIC.VW_GPSINFO_REALTIME T1 on T.MMSI = T1.DEVICEID
- where t1.LATITUDE >= #{minLat}
- and t1.LATITUDE <= #{maxLat}
- and t1.LONGITUDE >= #{minLon}
- and t1.LONGITUDE <= #{maxLon})
- and t1.gpstime > sysdate - 30/24/60
- where rn = 1
- </select>
- <select id="selectBoatInfoByMmsi" resultType="com.shanghaichengdi.ghjgitem.vo.ShipDataVo">
- select *
- from (select T.LAST_UPDATE_DATE lastUpdateDate,
- T1.LATITUDE latitude,
- T1.LONGITUDE longtitude,
- T1.DIRECTION direction,
- T1.VELOCITY velocity,
- T.SHIP_SUMMER_DRAFT shipSummerDraft,
- T.MMSI mmsi,
- T.SHIP_IMO shipImo,
- T.SHIP_CALLSIGN shipCallsign,
- T.SHIP_NAME_EN shipNameEn,
- T.SHIP_NAME_CN shipNameCn,
- T.SHIP_TYPE_CODE shipTypeCode,
- T.SHIP_TYPE_NAME shipTypeName,
- T.SHIP_LENGTH shipLength,
- T.SHIP_BREADTH shipBreadth,
- T1.SHIPSTATE shipState,
- T.SHIP_BUILT_DATE shipBuiltDate,
- T.SHIP_DWT shipDwt,
- T.REGPORT_CODE regportCode,
- T.REGPORT_NAME regportName,
- decode(T2.ARRIVAL_OR_LEAVE,0,T2.REPORT_PORT_NAME,1,T2.NEXT_PORT_NAME) destination,
- T2.EXPECT_TIME expectTime,
- row_number() over (partition by T1.DEVICEID order by T1.GPSTIME desc) rn
- from GHJG_BASICS.MVW_BOAT_INFO T
- left join GHJG_DYNAMIC.VW_GPSINFO_REALTIME T1 on T.MMSI = T1.DEVICEID
- left join (select
- a.SHIP_ID,a.REPORT_PORT_NAME,a.NEXT_PORT_NAME,a.ARRIVAL_OR_LEAVE,a.EXPECT_TIME
- from (
- <foreach item="item" collection="tableNameList" separator="union">
- select SHIP_ID,REPORT_PORT_NAME,NEXT_PORT_NAME,ARRIVAL_OR_LEAVE,EXPECT_TIME from
- ${item}
- </foreach>
- ) a
- ) T2 on T.SHIP_ID is not null and T.SHIP_ID = T2.SHIP_ID
- where T.MMSI = #{mmsi})
- where rn = 1
- </select>
- <select id="selectBoatPathFromMvwHistory" resultType="com.shanghaichengdi.ghjgitem.vo.BoatPathVo">
- select t.deviceid mmsi, t.VELOCITY,t.DIRECTION,t.LONGITUDE,t.LATITUDE,
- to_char(t.GPSTIME,'yyyy-mm-dd hh24:mi:ss') time
- from GHJG_DYNAMIC.VW_GPSINFO_HISTORY t
- where t.deviceid = #{mmsi}
- and t.gpstime >= to_date(#{startTime}, 'yyyy-mm-dd hh24:mi:ss')
- and to_date(#{endTime}, 'yyyy-mm-dd hh24:mi:ss') >= t.gpstime
- </select>
- <select id="selectBoatInfoByShipId" resultType="com.shanghaichengdi.ghjgitem.vo.ShipInfoForShipLockVo">
- select t.SHIP_ID,
- t.SHIP_NAME_CN shipName,
- t.SHIP_TYPE_CODE shipTypeCode,
- t.SHIP_TYPE_NAME shipTypeName,
- t.SHIP_LENGTH shipLength,
- t.MMSI,
- t.SHIP_DEPTH shipLength,
- t.SHIP_DWT shipDwt,
- t.SHIP_BREADTH shipWidth
- from GHJG_BASICS.MVW_BOAT_INFO t
- where SHIP_ID = #{shipId}
- </select>
- <select id="selectCargoDeclareInfoByShipId"
- resultType="com.shanghaichengdi.ghjgitem.vo.CargoInfoForShipLockVo">
- <foreach collection="list" item="item" index="index" separator="union all">
- select c.ship_id shipId,
- c.SHIP_NAME_CN shipName,
- c.mmsi mmsi,
- r.type_code pCargoCode,
- d.ITEM_NAME_CN pCargoName,
- r.GOODS_CODE cargoCode,
- r.specific_name cargoName,
- c.actual_carrying_capacity actualLoad,
- c.PRE_PORT_NAME startPort,
- c.pre_port_code startPortCode,
- c.next_port_code nextPortCode,
- c.next_port_name nextPort,
- c.LAST_UPDATE_DATE lastUpdateDate
- from ghjg_basics.c_cb_ship_eep_report_rec partition(${item}) c
- left join ghjg_basics.c_cb_cargo_declare_rec r
- on c.report_id = r.report_id
- left join ghjg_basics.d_cb_cargo_type d on r.type_code = d.code
- where c.SHIP_ID = #{shipId}
- </foreach>
- </select>
- <select id="getPdShipCountByMmsi" resultType="java.lang.Integer">
- select count(1) from ghjg_dynamic.vw_gpsinfo_realtime t
- where t.deviceid = #{mmsi}
- and t.GPSTIME > sysdate - 1/24
- and t.MAPX > -2000 and t.MAPX < 48000
- and t.MAPY > -48000 and t.MAPY < 18000
- </select>
- <select id="getPdShipCountByShipId" resultType="java.lang.Integer">
- select count(1) from ghjg_dynamic.vw_gpsinfo_realtime t
- left join ghjg_basics.mvw_boat_info b on t.deviceid = b.mmsi
- where b.ship_id = #{shipId}
- and t.GPSTIME > sysdate - 1/24
- and t.MAPX > -2000 and t.MAPX < 48000
- and t.MAPY > -48000 and t.MAPY < 18000
- </select>
- </mapper>
|