您的位置:首页 > 编程语言 > Java开发

Java 基于Spring、MyBatis使用HashMap嵌套列表统计不同国家、指定类型船舶指定时间段在某区域进出量计算方法

2017-06-08 16:00 966 查看

1.需求

已知全球船舶历史轨迹点,计算某特定区域的船舶进出量,包含不同的国家、不同的船舶类型



2.思路

1.获取指定时间段,在该指定区域有点的船舶的目标ID(唯一标识号)在该指定时间段的轨迹信息,使用MySql子查询,语句:

SELECT
Target_ID AS msi,
Record_UTC_Time AS ti,
Longitude AS lo,
Latitude AS la,
Aggregated_AIS_Ship_Type_ID AS ast,
Country_Name as cou
FROM
l1_target_history_positions_TimeSpaceKey_2017
WHERE
Target_ID IN (
SELECT
Target_ID
FROM
l1_target_history_positions_ShipIDKey_2017
WHERE Longitude>#{areaParam.ldlon}
and #{areaParam.urlon}>Longitude
and Latitude>#{areaParam.ldlat}
and #{areaParam.urlat}>Latitude
and Record_UTC_Time>#{areaParam.startTime}
and #{areaParam.endTime}>Record_UTC_Time
GROUP BY
Target_ID
)
and Record_UTC_Time>#{areaParam.startTime}
and #{areaParam.endTime}>Record_UTC_Time
ORDER by Record_UTC_Time ASC


2.符合这些条件的点根据目标进行分类,一个目标一个List,List存放该目标的轨迹信息,使用HashMap实现(在对目标轮询筛选的时候可以用key标识该目标是否存在,没有可以新建,有就可以获取该key对应的Value,即该目标的轨迹List)

3.对存放每一个目标点的List轨迹信息进行进出计算(根据时间递增,目标位置在区域内外信息的变化),得到每一个目标的进出次数并且含有该目标国别、船舶类型、Id等静态信息

4.将含有该目标进出次数且包含国别、船舶类型信息的目标对象加入列表轮询,进行不同国别不同类型进出次数计算,使用HashMap,以国别为key,不同类型驶入次数对象为Value,对每一个包含船舶类型、国别信息、进出次数的目标进行国别判断、类别判断在其对应类型成员属性上进行追加计算,得到不同国家不同类型驶入和驶出情况列表,同时计算出驶入、驶出总次数。

5.新建新的List加入驶入总次数、驶出总次数、不同国家不同类型驶入情况列表、不同国家不同类型驶出情况列表,作为Service提供调用和返回

3.代码实现

(1)Service层

package com.ict.service;

import com.ict.common.ShipType;
import com.ict.dao.IHistoryServiceDao;
import com.ict.dto.AreaParams;
import com.ict.dto.ResultObjWithCount;
import com.ict.model.*;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class HistoryAnalysisService {
@Resource
IHistoryServiceDao iHistoryServiceDao;

/**
* 区域流量分析——陈龙
* @param areaParams
* @return
*/
public ResultObjWithCount getAnalysis(AreaParams areaParams,int mode){
ResultObjWithCount resultObj=new ResultObjWithCount();
try{
List<Analysis> analysisList;
//mode;0:综合模式;1:原始模式
if(mode==0){
analysisList=iHistoryServiceDao.getFuseAnalysis(areaParams);
}else{
analysisList=iHistoryServiceDao.getOrigAnalysis(areaParams);
}

String msi;
//新建不同目标为key,该目标轨迹点为Value的Map
Map<String,ArrayList<Analysis>> map2=new HashMap<String,ArrayList<Analysis>>();
for(int i=0;i<analysisList.size();i++){
msi=analysisList.get(i).getMsi()+"";
Analysis analysis=analysisList.get(i);
//==================1.对指定时间段内点的轨迹进行按不同目标列表分类
putAddAnalysis(map2,msi,analysis);
}

//新建包括每个目标进出次数对象的列表
List<MmsiIOCountWithStaticInfo> mmsiIOCountWithStaticInfoList=new ArrayList<MmsiIOCountWithStaticInfo>();
//==================2.对分类的目标列表进行进出次数计算
for(Map.Entry<String,ArrayList<Analysis>> entry:map2.entrySet()){
Integer.parseInt(entry.getKey());
List<Analysis> analysisList1=entry.getValue();
MmsiIOCountWithStaticInfo mmsiIOCountWithStaticInfo=IOAnalysis(analysisList1,areaParams);
mmsiIOCountWithStaticInfoList.add(mmsiIOCountWithStaticInfo);
}

//对进出目标次数进行分类和总数叠加计算
String countryKey;
int countDstSum=0;//驶入总次数
int countSrcSum=0;//驶出总次数

//新建返回对象,包括驶入总此时、驶出总次数、各个国家各种类型驶入列表、各个国家各种类型驶出列表
ListShipDataReturn listShipDataReturn=new ListShipDataReturn();

Map<String,ShipDataReturn> mapDst=new HashMap<String, ShipDataReturn>();//不同国家不同类型驶入次数记录Map,国家为Key,各类型进出次数对象为Value
Map<String,ShipDataReturn> mapSrc=new HashMap<String, ShipDataReturn>();//不同国家不同类型驶出次数记录Map,国家为Key,各类型进出次数对象为Value
for(int j=0;j<mmsiIOCountWithStaticInfoList.size();j++){
//获取国家,作为Map的key
countryKey=mmsiIOCountWithStaticInfoList.get(j).getCou();

/**
货船 :1
油轮: 3
拖船 :6
拖轮 :4
搜救船 :2
客船 :7
渔船:5
军事船:8
*/

countDstSum=countDstSum+mmsiIOCountWithStaticInfoList.get(j).getDstSum();
countSrcSum=countSrcSum+mmsiIOCountWithStaticInfoList.get(j).getSrcSum();

shipIOAnalysis(mapDst,mapSrc,countryKey,mmsiIOCountWithStaticInfoList.get(j));
}

//从Map中获取不同国家,指定类型船的驶入列表
List<ShipDataReturn> shipDst=new ArrayList<ShipDataReturn>();
for(Map.Entry<String,ShipDataReturn> entryDst:mapDst.entrySet()){
shipDst.add(entryDst.getValue());
}

//从Map中获取不同国家,指定类型船的驶出列表
List<ShipDataReturn> shipSrc=new ArrayList<ShipDataReturn>();
for(Map.Entry<String,ShipDataReturn> entrySrc:mapSrc.entrySet()){
shipSrc.add(entrySrc.getValue());
}

//添加到总List
listShipDataReturn.setSrcSum(countSrcSum);
listShipDataReturn.setDstSum(countDstSum);
listShipDataReturn.setShipDst(shipDst);
listShipDataReturn.setShipSrc(shipSrc);

resultObj.setState(1);
resultObj.setObj(listShipDataReturn);
4000
return resultObj;
}catch (Exception e){
resultObj.setState(-1);
System.out.println("数据库操作失败:"+e);
return resultObj;
}
}

/**
* 对不同国家指定类型的船舶进出进行列表计算
* @param mapDst 不同国家,不同船舶类型船舶驶入map
* @param mapSrc 不同国家,不同船舶类型船舶驶出map
* @param key 国家作为key,有则更新,无则新建并且更新
* @param mmsiIOCountWithStaticInfo 船舶的进出次数对象,包括该船舶的静态信息
*/
public void shipIOAnalysis(Map<String,ShipDataReturn> mapDst,Map<String,ShipDataReturn> mapSrc,String key,MmsiIOCountWithStaticInfo mmsiIOCountWithStaticInfo){
//驶入
if(mmsiIOCountWithStaticInfo.getDstSum()>0){
ShipDataReturn shipDataReturnDst;

//国家作为key,有则更新,无则新建并且更新
if(!mapDst.containsKey(key)){
shipDataReturnDst=new ShipDataReturn();
mapDst.put(key, shipDataReturnDst);
}
shipDataReturnDst=mapDst.get(key);

//设置赋予国家属性给该对象
shipDataReturnDst.setCountryCn(mmsiIOCountWithStaticInfo.getCou());

//获取该船舶静态信息中的船舶类型,对该类型的进出次数属性进行追加
switch (DealAisShipType(mmsiIOCountWithStaticInfo.getAst())){
case ShipType.AIS_HUOCHUAN:
shipDataReturnDst.setShiphuo(shipDataReturnDst.getShiphuo()+mmsiIOCountWithStaticInfo.getDstSum());
break;
case ShipType.AIS_YOULUN:
shipDataReturnDst.setShipyou(shipDataReturnDst.getShipyou()+mmsiIOCountWithStaticInfo.getDstSum());
break;
case ShipType.AIS_TUOCHUAN:
shipDataReturnDst.setShiptuo(shipDataReturnDst.getShiptuo()+mmsiIOCountWithStaticInfo.getDstSum());
break;
case ShipType.AIS_YUCHUAN:
shipDataReturnDst.setShipyu(shipDataReturnDst.getShipyu()+mmsiIOCountWithStaticInfo.getDstSum());
break;
case ShipType.AIS_KECHUAN:
shipDataReturnDst.setShipke(shipDataReturnDst.getShipke()+mmsiIOCountWithStaticInfo.getDstSum());
break;
case ShipType.AIS_TUOLUN:
shipDataReturnDst.setShiptl(shipDataReturnDst.getShiptl()+mmsiIOCountWithStaticInfo.getDstSum());
break;
case ShipType.AIS_SOUJIUCHUAN:
shipDataReturnDst.setShipsj(shipDataReturnDst.getShipsj()+mmsiIOCountWithStaticInfo.getDstSum());
break;
case ShipType.AIS_JUNSHICHUAN:
shipDataReturnDst.setShipjun(shipDataReturnDst.getShipjun()+mmsiIOCountWithStaticInfo.getDstSum());
break;
default:
shipDataReturnDst.setShipother(shipDataReturnDst.getShipother()+mmsiIOCountWithStaticInfo.getDstSum());
break;
}
}

//驶出
if(mmsiIOCountWithStaticInfo.getSrcSum()>0){
ShipDataReturn shipDataReturnSrc;

//国家作为key,有则更新,无则新建并且更新
if(!mapSrc.containsKey(key)){
shipDataReturnSrc=new ShipDataReturn();
mapSrc.put(key, shipDataReturnSrc);
}
shipDataReturnSrc=mapSrc.get(key);

//设置赋予国家属性给该对象
shipDataReturnSrc.setCountryCn(mmsiIOCountWithStaticInfo.getCou());

//获取该船舶静态信息中的船舶类型,对该类型的进出次数属性进行追加
switch (DealAisShipType(mmsiIOCountWithStaticInfo.getAst())){
case ShipType.AIS_HUOCHUAN:
shipDataReturnSrc.setShiphuo(shipDataReturnSrc.getShiphuo()+mmsiIOCountWithStaticInfo.getSrcSum());
break;
case ShipType.AIS_YOULUN:
shipDataReturnSrc.setShipyou(shipDataReturnSrc.getShipyou()+mmsiIOCountWithStaticInfo.getSrcSum());
break;
case ShipType.AIS_TUOCHUAN:
shipDataReturnSrc.setShiptuo(shipDataReturnSrc.getShiptuo()+mmsiIOCountWithStaticInfo.getSrcSum());
break;
case ShipType.AIS_YUCHUAN:
shipDataReturnSrc.setShipyu(shipDataReturnSrc.getShipyu()+mmsiIOCountWithStaticInfo.getSrcSum());
break;
case ShipType.AIS_KECHUAN:
shipDataReturnSrc.setShipke(shipDataReturnSrc.getShipke()+mmsiIOCountWithStaticInfo.getSrcSum());
break;
case ShipType.AIS_TUOLUN:
shipDataReturnSrc.setShiptl(shipDataReturnSrc.getShiptl()+mmsiIOCountWithStaticInfo.getSrcSum());
break;
case ShipType.AIS_SOUJIUCHUAN:
shipDataReturnSrc.setShipsj(shipDataReturnSrc.getShipsj()+mmsiIOCountWithStaticInfo.getSrcSum());
break;
case ShipType.AIS_JUNSHICHUAN:
shipDataReturnSrc.setShipjun(shipDataReturnSrc.getShipjun()+mmsiIOCountWithStaticInfo.getSrcSum());
break;
default:
shipDataReturnSrc.setShipother(shipDataReturnSrc.getShipother()+mmsiIOCountWithStaticInfo.getSrcSum());
break;
}
}
}

//将需要进入循环的变量取出设置(节省内存)
private int posLon=0;
private int posLat=0;
//标志,1:在区域内,-1:不在区域内
private int flag;
int inCount;//流入次数
int outCount;//流出次数

/**
* 对每个目标轨迹列表进行进出量分析计算
* @param analysisList 目标轨迹列表
* @param areaParams 区域参数对象
* @return 返回每艘船的进出次数,包含该搜船的国家、类型、MMSI等静态信息
*/
public MmsiIOCountWithStaticInfo IOAnalysis(List<Analysis> analysisList, AreaParams areaParams){
inCount=0;//流入次数
outCount=0;//流出次数
flag=0;//1:在区域内;2:不在区域内

MmsiIOCountWithStaticInfo mmsiIOCountWithStaticInfo=new MmsiIOCountWithStaticInfo();
for(int i=0;i<analysisList.size();i++){
posLon=analysisList.get(i).getLo();
posLat=analysisList.get(i).getLa();
//对其他每个点进行判断是否在指定区域内
if(posLon>areaParams.getLdlon()&&posLon<areaParams.getUrlon()&&posLat>areaParams.getLdlat()&&posLat<areaParams.getUrlat())
{
//目标点在该区域,如果一开始不在该区域,那么记录驶入追加一次,并且状态设置为1(进入)
if (flag==-1){
inCount=inCount+1;
}
flag=1;
}else {
//目标点不在该区域,如果一开始在该区域,那么记录驶出追加一次,并且状态设置为-1(驶出)
if (flag==1){
outCount=outCount+1;
}
flag=-1;
}
}

//船舶静态信息,国家名、船舶类型、MMSI
mmsiIOCountWithStaticInfo.setAst(analysisList.get(0).getAst());
mmsiIOCountWithStaticInfo.setCou(analysisList.get(0).getCou());
mmsiIOCountWithStaticInfo.setMmsi(analysisList.get(0).getMsi());
//将该搜船的进出信息存入该对象
mmsiIOCountWithStaticInfo.setDstSum(inCount);
mmsiIOCountWithStaticInfo.setSrcSum(outCount);
return mmsiIOCountWithStaticInfo;
}

/**
* 对目标进行目标列表分类,一个目标一个List
* @param map 存储各个目标轨迹列表的Map,以目标ID为Key,目标列表为Value
* @param key 目标id
* @param analysis 目标对象信息,包括船舶经度、纬度、船舶类型,国别、ID号等
*/
public void putAddAnalysis(Map<String,ArrayList<Analysis>> map, String key, Analysis analysis){
if(!map.containsKey(key)){
map.put(key, new ArrayList<Analysis>());
}
map.get(key).add(analysis);
}

/**
* AIS船舶类型需要经过处理才好在程序里面进行判断
*货船 :70-79
油轮: 80-89
拖船 :31-32
拖轮 :52
搜救船 :51
客船 :60-69
渔船:30
军事船:34
* @param shipType
* @return
*/
private int DealAisShipType(int shipType){
if(shipType>70&&shipType<80){
return 70;
}else if(shipType>80&&shipType<90){
return 80;
}else if(shipType>60&&shipType<70){
return 60;
}else if(shipType==32){
return 31;
}
else{
return shipType;
}
}
}


(2)定义类存指定船舶类型对应int值

package com.ict.common;

/**
* Created by chenlong on 2017/4/19.
*/
public class ShipType {
/**
货船 :1
油轮: 3
拖船 :6
拖轮 :4
搜救船 :2
客船 :7
渔船:5
军事船:8
*/

//AIS货船
public static final int AIS_HUOCHUAN=1;
//AIS油轮
public static final int AIS_YOULUN=3;
//AIS拖船
public static final int AIS_TUOCHUAN=6;
//AIS渔船
public static final int AIS_YUCHUAN=5;
//AIS客船
public static final int AIS_KECHUAN=7;
//AIS拖轮
public static final int AIS_TUOLUN=4;
//AIS搜救船
public static final int AIS_SOUJIUCHUAN=2;
//AIS军事船
public static final int AIS_JUNSHICHUAN=8;
}


(3)Model层
package com.ict.model;

/**
* Created by chenlong on 2017/4/18.
*/

public class Analysis {
public int msi;
public int lo;
public int la;
public String cou;
public int ast;
public int ti;

public int getTi() {
return ti;
}

public void setTi(int ti) {
this.ti = ti;
}

public int getMsi() {
return msi;
}

public void setMsi(int msi) {
this.msi = msi;
}

public int getLo() {
return lo;
}

public void setLo(int lo) {
this.lo = lo;
}

public int getLa() {
return la;
}

public void setLa(int la) {
this.la = la;
}

public String getCou() {
return cou;
}

public void setCou(String cou) {
this.cou = cou;
}

public int getAst() {
return ast;
}

public void setAst(int ast) {
this.ast = ast;
}
}


package com.ict.model;

/**
* Created by FCC on 2017/3/1.
* 用于返回船舶的数量
*/
public class ShipDataReturn {
public String countryCn;//国家中文名
//    public String countryEn;//国家英文名
public int shiphuo;//货船数量
public int shipyou;//油轮数量
public int shiptuo;//拖船数量
public int shipyu;//渔船数量
public int shipke;//客船船数量
public int shipjun;//军事船数量
public int shipother;//其他船数量
public int shiptl;//拖轮
public int shipsj;//搜救船

public int getShiptl() {
return shiptl;
}

public void setShiptl(int shiptl) {
this.shiptl = shiptl;
}

public int getShipsj() {
return shipsj;
}

public void setShipsj(int shipsj) {
this.shipsj = shipsj;
}

public String getCountryCn() {
return countryCn;
}

public void setCountryCn(String countryCn) {
this.countryCn = countryCn;
}

public int getShiphuo() {
return shiphuo;
}

public void setShiphuo(int shiphuo) {
this.shiphuo = shiphuo;
}

public int getShipyou() {
return shipyou;
}

public void setShipyou(int shipyou) {
this.shipyou = shipyou;
}

public int getShiptuo() {
return shiptuo;
}

public void setShiptuo(int shiptuo) {
this.shiptuo = shiptuo;
}

public int getShipyu() {
return shipyu;
}

public void setShipyu(int shipyu) {
this.shipyu = shipyu;
}

public int getShipke() {
return shipke;
}

public void setShipke(int shipke) {
this.shipke = shipke;
}

public int getShipjun() {
return shipjun;
}

public void setShipjun(int shipjun) {
this.shipjun = shipjun;
}

public int getShipother() {
return shipother;
}

public void setShipother(int shipother) {
this.shipother = shipother;
}
}


package com.ict.model;

import java.util.List;

/**
* Created by chenlong on 2017/4/19.
*/
public class ListShipDataReturn {
private int dstSum;
private int srcSum;
List<ShipDataReturn> shipDst;
List<ShipDataReturn> shipSrc;

public int getDstSum() {
return dstSum;
}

public void setDstSum(int dstSum) {
this.dstSum = dstSum;
}

public int getSrcSum() {
return srcSum;
}

public void setSrcSum(int srcSum) {
this.srcSum = srcSum;
}

public List<ShipDataReturn> getShipDst() {
return shipDst;
}

public void setShipDst(List<ShipDataReturn> shipDst) {
this.shipDst = shipDst;
}

public List<ShipDataReturn> getShipSrc() {
return shipSrc;
}

public void setShipSrc(List<ShipDataReturn> shipSrc) {
this.shipSrc = shipSrc;
}
}


(4)dto层
package com.ict.dto;

/**
* Created by chenlong on 2017/3/24.
*/

/**
* 当Service层在查询某个对象或者对象列表时,查询操作正确,但是返回的结果为空时,
* 直接返回空对象或者返回空List在处理的时候把空List当做正确结果、把空对象当做错误结果笼统提示使前端在提示上不细致不友好,
* 所以使用该对象封装state为状态码(可以包含返回为空(0)、数据库操作失败(-1)、正确返回(1))
* obj为返回对象的内容(可以为单个对象或者List等)
*/
public class ResultObjWithCount {
private int state;
private Object obj;

public int shipcount;
public int pointcount;

public int getState() {
return state;
}

public void setState(int state) {
this.state = state;
}

public Object getObj() {
return obj;
}

public void setObj(Object obj) {
this.obj = obj;
}

public int getShipcount() {
return shipco
c1ee
unt;
}

public void setShipcount(int shipcount) {
this.shipcount = shipcount;
}

public int getPointcount() {
return pointcount;
}

public void setPointcount(int pointcount) {
this.pointcount = pointcount;
}
}


(5)dao层

package com.ict.dao;

import com.ict.dto.AreaParams;
import com.ict.model.Analysis;
import com.ict.model.AreaPlayBack;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* Created by chenlong on 2016/6/21.
*/
@Repository
public interface IHistoryServiceDao {
List<AreaPlayBack> getFuseHistoryDegInfo(@Param("areaParam") AreaParams areaParam);
List<AreaPlayBack> getOrigHistoryDegInfo(@Param("areaParam") AreaParams areaParam);

List<Analysis> getFuseAnalysis(@Param("areaParam") AreaParams areaParam);
List<Analysis> getOrigAnalysis(@Param("areaParam") AreaParams areaParam);
}


(6)mapper

<?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">
<!-- namespace必须指向Dao接口 -->
<mapper namespace="com.ict.dao.IHistoryServiceDao">
<select id="getFuseHistoryDegInfo" parameterType="com.ict.dto.AreaParams" resultType="com.ict.model.AreaPlayBack">
SELECT
Target_ID as tid,
Record_UTC_Time as ti,
Longitude as lo,
Latitude as la,
Direction as co,
Heading as he,
Speed as sp
from l1_target_history_positions_TimeSpaceKey_2017
WHERE Longitude>#{areaParam.ldlon} and #{areaParam.urlon}>Longitude and Latitude>#{areaParam.ldlat}
and #{areaParam.urlat}>Latitude
and Record_UTC_Time>#{areaParam.startTime}
and #{areaParam.endTime}>Record_UTC_Time
ORDER by Record_UTC_Time ASC
limit #{areaParam.lim}
</select>

<select id="getOrigHistoryDegInfo" parameterType="com.ict.dto.AreaParams" resultType="com.ict.model.AreaPlayBack">
SELECT
Target_ID_Orig as tid,
Record_UTC_Time as ti,
Longitude as lo,
Latitude as la,
Direction as co,
Heading as he,
Speed as sp
from l1_target_history_positions_TimeSpaceKey_2017
WHERE Longitude>#{areaParam.ldlon} and #{areaParam.urlon}>Longitude and Latitude>#{areaParam.ldlat}
and #{areaParam.urlat}>Latitude
and Record_UTC_Time>#{areaParam.startTime}
and #{areaParam.endTime}>Record_UTC_Time
ORDER by Record_UTC_Time ASC
limit #{areaParam.lim}
</select>

<select id="getFuseAnalysis" parameterType="com.ict.dto.AreaParams" resultType="com.ict.model.Analysis">
SELECT Target_ID AS msi, Record_UTC_Time AS ti, Longitude AS lo, Latitude AS la, Aggregated_AIS_Ship_Type_ID AS ast, Country_Name as cou FROM l1_target_history_positions_TimeSpaceKey_2017 WHERE Target_ID IN ( SELECT Target_ID FROM l1_target_history_positions_ShipIDKey_2017 WHERE Longitude>#{areaParam.ldlon} and #{areaParam.urlon}>Longitude and Latitude>#{areaParam.ldlat} and #{areaParam.urlat}>Latitude and Record_UTC_Time>#{areaParam.startTime} and #{areaParam.endTime}>Record_UTC_Time GROUP BY Target_ID ) and Record_UTC_Time>#{areaParam.startTime} and #{areaParam.endTime}>Record_UTC_Time ORDER by Record_UTC_Time ASC
</select>

<select id="getOrigAnalysis" parameterType="com.ict.dto.AreaParams" resultType="com.ict.model.Analysis">
SELECT
Target_ID_Orig AS msi,
Record_UTC_Time AS ti,
Longitude AS lo,
Latitude AS la,
AIS_Ship_Type AS ast,
Country_Name as cou
FROM
l1_target_history_positions_TimeSpaceKey_2017
WHERE
Target_ID_Orig IN (
SELECT
Target_ID_Orig
FROM
l1_target_history_positions_ShipIDKey_2017
WHERE Longitude>#{areaParam.ldlon}
and #{areaParam.urlon}>Longitude
and Latitude>#{areaParam.ldlat}
and #{areaParam.urlat}>Latitude
and Record_UTC_Time>#{areaParam.startTime}
and #{areaParam.endTime}>Record_UTC_Time
GROUP BY
Target_ID_Orig
)
and Record_UTC_Time>#{areaParam.startTime}
and #{areaParam.endTime}>Record_UTC_Time
ORDER by Record_UTC_Time ASC
</select>
</mapper>



4.模拟数据验证

模拟几条船舶,在不同情形(包括驶入、驶出、无驶入驶出记录和返回驶入驶出记录),随着时间段进入和出来的场景的数据,得出结果与模拟预期结果一致
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐