单次解算记录持久化写入数据库
- 新增单次解析实体类与 Mapper
This commit is contained in:
parent
9511027878
commit
27783443c2
@ -0,0 +1,44 @@
|
|||||||
|
package com.imdroid.secapi.dto;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName(value = "gnssdevicesinglerecords")
|
||||||
|
public class GnssSingleData {
|
||||||
|
public static final short MODEL_G505 = 0; //F9P
|
||||||
|
public static final short MODEL_G510 = 1; //博通
|
||||||
|
|
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
@ExcelIgnore
|
||||||
|
Long id;
|
||||||
|
@ExcelProperty("设备编号")
|
||||||
|
String deviceid;
|
||||||
|
|
||||||
|
@ExcelProperty("记录时间")
|
||||||
|
LocalDateTime createtime;
|
||||||
|
|
||||||
|
// 博通的 GGA 经纬度数据
|
||||||
|
// F9P 的私有格式 B562 的 ECEF 数据
|
||||||
|
@ExcelProperty("型号")
|
||||||
|
Short model;
|
||||||
|
|
||||||
|
@ExcelProperty("东")
|
||||||
|
double x; // GGA时是 latitude, ECEF时是 x
|
||||||
|
@ExcelProperty("北")
|
||||||
|
double y; // GGA时是 longitude, ECEF时是 y
|
||||||
|
@ExcelProperty("天")
|
||||||
|
double z; // GGA时是 altitude, ECEF时是 z
|
||||||
|
|
||||||
|
// GGA 时 GPS状态,0初始化,1单点定位,2码差分,3无效PPS,4固定解,5浮点解,6正在估算7,人工输入固定值,8模拟模式,9WAAS差分
|
||||||
|
// ECEF 时 0无B562,1 浮点解,2 固定解
|
||||||
|
@ExcelProperty("状态")
|
||||||
|
int status;
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package com.imdroid.secapi.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
@Mapper
|
||||||
|
public interface GnssSingleDataMapper extends MPJBaseMapper<GnssSingleData> {
|
||||||
|
Page<GnssSingleData> queryByDeviceId(@Param("page") IPage page, @Param("deviceId") String deviceId,
|
||||||
|
@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("count") Integer count);
|
||||||
|
}
|
||||||
18
sec-api/src/main/resources/mapper/GnssSingleDataMapper.xml
Normal file
18
sec-api/src/main/resources/mapper/GnssSingleDataMapper.xml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?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.imdroid.secapi.dto.GnssSingleDataMapper">
|
||||||
|
|
||||||
|
<select id="queryByDeviceId" resultType="com.imdroid.secapi.dto.GnssSingleData">
|
||||||
|
select c.* from (select @n:=@n+1 as n, a.* from (select * from gnssdevicesinglerecords
|
||||||
|
<where>
|
||||||
|
deviceid = #{deviceId}
|
||||||
|
<if test="beginTime != null and beginTime != ''">
|
||||||
|
and createtime >= #{beginTime}
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null and endTime != ''">
|
||||||
|
and createtime <= #{endTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by createtime desc)a,(select @n:=0)b)c where c.n%#{count}=1
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@ -35,6 +35,7 @@ public class Device {
|
|||||||
private String fwdId;
|
private String fwdId;
|
||||||
|
|
||||||
private Integer deviceType;
|
private Integer deviceType;
|
||||||
|
private Short model;
|
||||||
|
|
||||||
private Integer calcGroupId;
|
private Integer calcGroupId;
|
||||||
private Short opMode;
|
private Short opMode;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user