From a549d6bbd7cb6f2a0dda1234c1b4df072a9e1d61 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期一, 18 十月 2021 09:34:05 +0800 Subject: [PATCH] 1. 新增车载、无人机和网格化三个单独的实时数据存储表 2. 新增数据转存方法,后续待补充转换中的数据预处理逻辑 --- src/main/kotlin/com/flightfeather/uav/domain/entity/RealTimeDataVehicle.java | 9 + src/main/resources/mapper/RealTimeDataVehicleMapper.xml | 39 +++++ src/main/kotlin/com/flightfeather/uav/repository/impl/AirDataRepositoryImpl.kt | 128 +++++++++++++++++ src/main/kotlin/com/flightfeather/uav/socket/processor/UnderwayProcessor.kt | 6 src/main/kotlin/com/flightfeather/uav/domain/mapper/RealTimeDataVehicleMapper.kt | 8 + src/main/kotlin/com/flightfeather/uav/socket/eunm/UWDeviceType.kt | 22 +++ src/main/kotlin/com/flightfeather/uav/domain/entity/RealTimeDataGrid.java | 9 + src/main/resources/generator/generatorConfig.xml | 5 src/main/kotlin/com/flightfeather/uav/domain/entity/RealTimeDataUav.java | 9 + src/main/kotlin/com/flightfeather/uav/domain/mapper/RealTimeDataUavMapper.kt | 8 + src/main/resources/mapper/RealTimeDataGridMapper.xml | 39 +++++ src/main/kotlin/com/flightfeather/uav/domain/entity/BaseRealTimeData.kt | 70 ++++++++++ src/main/kotlin/com/flightfeather/uav/repository/AirDataRepository.kt | 12 + src/main/kotlin/com/flightfeather/uav/domain/mapper/RealTimeDataGridMapper.kt | 8 + src/main/resources/mapper/RealTimeDataUavMapper.xml | 39 +++++ src/main/kotlin/com/flightfeather/uav/socket/DeviceSession.kt | 6 16 files changed, 406 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/com/flightfeather/uav/domain/entity/BaseRealTimeData.kt b/src/main/kotlin/com/flightfeather/uav/domain/entity/BaseRealTimeData.kt new file mode 100644 index 0000000..1255efa --- /dev/null +++ b/src/main/kotlin/com/flightfeather/uav/domain/entity/BaseRealTimeData.kt @@ -0,0 +1,70 @@ +package com.flightfeather.uav.domain.entity + +import java.math.BigDecimal +import java.util.* +import javax.persistence.Column +import javax.persistence.Id + +/** + * 瀹炴椂鐩戞祴鏁版嵁鍩虹被 + */ +open class BaseRealTimeData { + @Id + var id: Int? = null + + @Column(name = "device_code") + var deviceCode: String? = null + + var latitude: BigDecimal? = null + + var longitude: BigDecimal? = null + + var altitude: Float? = null + + @Column(name = "data_time") + var dataTime: Date? = null + + @Column(name = "create_time") + var createTime: Date? = null + + @Column(name = "NO2") + var no2: Float? = null + + @Column(name = "CO") + var co: Float? = null + + @Column(name = "H2S") + var h2s: Float? = null + + @Column(name = "SO2") + var so2: Float? = null + + @Column(name = "O3") + var o3: Float? = null + + @Column(name = "PM25") + var pm25: Float? = null + + @Column(name = "PM10") + var pm10: Float? = null + + var temperature: Float? = null + + var humidity: Float? = null + + @Column(name = "VOC") + var voc: Float? = null + + @Column(name = "NOI") + var noi: Float? = null + + var velocity: Float? = null + + @Column(name = "wind_speed") + var windSpeed: Float? = null + + @Column(name = "wind_direction") + var windDirection: Float? = null + + var height: Float? = null +} \ No newline at end of file diff --git a/src/main/kotlin/com/flightfeather/uav/domain/entity/RealTimeDataGrid.java b/src/main/kotlin/com/flightfeather/uav/domain/entity/RealTimeDataGrid.java new file mode 100644 index 0000000..38cbd30 --- /dev/null +++ b/src/main/kotlin/com/flightfeather/uav/domain/entity/RealTimeDataGrid.java @@ -0,0 +1,9 @@ +package com.flightfeather.uav.domain.entity; + +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.*; + +@Table(name = "real_time_data_grid") +public class RealTimeDataGrid extends BaseRealTimeData { +} \ No newline at end of file diff --git a/src/main/kotlin/com/flightfeather/uav/domain/entity/RealTimeDataUav.java b/src/main/kotlin/com/flightfeather/uav/domain/entity/RealTimeDataUav.java new file mode 100644 index 0000000..09ef198 --- /dev/null +++ b/src/main/kotlin/com/flightfeather/uav/domain/entity/RealTimeDataUav.java @@ -0,0 +1,9 @@ +package com.flightfeather.uav.domain.entity; + +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.*; + +@Table(name = "real_time_data_uav") +public class RealTimeDataUav extends BaseRealTimeData { +} \ No newline at end of file diff --git a/src/main/kotlin/com/flightfeather/uav/domain/entity/RealTimeDataVehicle.java b/src/main/kotlin/com/flightfeather/uav/domain/entity/RealTimeDataVehicle.java new file mode 100644 index 0000000..d22d2b9 --- /dev/null +++ b/src/main/kotlin/com/flightfeather/uav/domain/entity/RealTimeDataVehicle.java @@ -0,0 +1,9 @@ +package com.flightfeather.uav.domain.entity; + +import java.math.BigDecimal; +import java.util.Date; +import javax.persistence.*; + +@Table(name = "real_time_data_vehicle") +public class RealTimeDataVehicle extends BaseRealTimeData { +} \ No newline at end of file diff --git a/src/main/kotlin/com/flightfeather/uav/domain/mapper/RealTimeDataGridMapper.kt b/src/main/kotlin/com/flightfeather/uav/domain/mapper/RealTimeDataGridMapper.kt new file mode 100644 index 0000000..eeb7f35 --- /dev/null +++ b/src/main/kotlin/com/flightfeather/uav/domain/mapper/RealTimeDataGridMapper.kt @@ -0,0 +1,8 @@ +package com.flightfeather.uav.domain.mapper + +import com.flightfeather.uav.domain.MyMapper +import com.flightfeather.uav.domain.entity.RealTimeDataGrid +import org.apache.ibatis.annotations.Mapper + +@Mapper +interface RealTimeDataGridMapper : MyMapper<RealTimeDataGrid?> \ No newline at end of file diff --git a/src/main/kotlin/com/flightfeather/uav/domain/mapper/RealTimeDataUavMapper.kt b/src/main/kotlin/com/flightfeather/uav/domain/mapper/RealTimeDataUavMapper.kt new file mode 100644 index 0000000..0fff5e3 --- /dev/null +++ b/src/main/kotlin/com/flightfeather/uav/domain/mapper/RealTimeDataUavMapper.kt @@ -0,0 +1,8 @@ +package com.flightfeather.uav.domain.mapper + +import com.flightfeather.uav.domain.MyMapper +import com.flightfeather.uav.domain.entity.RealTimeDataUav +import org.apache.ibatis.annotations.Mapper + +@Mapper +interface RealTimeDataUavMapper : MyMapper<RealTimeDataUav?> \ No newline at end of file diff --git a/src/main/kotlin/com/flightfeather/uav/domain/mapper/RealTimeDataVehicleMapper.kt b/src/main/kotlin/com/flightfeather/uav/domain/mapper/RealTimeDataVehicleMapper.kt new file mode 100644 index 0000000..6d8175b --- /dev/null +++ b/src/main/kotlin/com/flightfeather/uav/domain/mapper/RealTimeDataVehicleMapper.kt @@ -0,0 +1,8 @@ +package com.flightfeather.uav.domain.mapper + +import com.flightfeather.uav.domain.MyMapper +import com.flightfeather.uav.domain.entity.RealTimeDataVehicle +import org.apache.ibatis.annotations.Mapper + +@Mapper +interface RealTimeDataVehicleMapper : MyMapper<RealTimeDataVehicle?> \ No newline at end of file diff --git a/src/main/kotlin/com/flightfeather/uav/repository/AirDataRepository.kt b/src/main/kotlin/com/flightfeather/uav/repository/AirDataRepository.kt index aa21e0b..94e3556 100644 --- a/src/main/kotlin/com/flightfeather/uav/repository/AirDataRepository.kt +++ b/src/main/kotlin/com/flightfeather/uav/repository/AirDataRepository.kt @@ -1,5 +1,6 @@ package com.flightfeather.uav.repository +import com.flightfeather.uav.domain.entity.RealTimeData import com.flightfeather.uav.socket.bean.AirDataPackage /** @@ -8,5 +9,16 @@ */ interface AirDataRepository { + /** + * 鍘熷鏁版嵁浠son鏍煎紡瀛樺偍 + */ fun saveAirData(dataPackage: AirDataPackage): Int + + /** + * 瀛樺偍棰勫鐞嗗悗鐨勬暟鎹� + */ + fun savePrepData(dataPackage: AirDataPackage): Int + + fun savePrepData(dataList: List<RealTimeData>): Int + } \ No newline at end of file diff --git a/src/main/kotlin/com/flightfeather/uav/repository/impl/AirDataRepositoryImpl.kt b/src/main/kotlin/com/flightfeather/uav/repository/impl/AirDataRepositoryImpl.kt index 34532fc..68975de 100644 --- a/src/main/kotlin/com/flightfeather/uav/repository/impl/AirDataRepositoryImpl.kt +++ b/src/main/kotlin/com/flightfeather/uav/repository/impl/AirDataRepositoryImpl.kt @@ -1,22 +1,33 @@ package com.flightfeather.uav.repository.impl -import com.flightfeather.uav.domain.entity.RealTimeData +import com.flightfeather.uav.common.utils.GsonUtils +import com.flightfeather.uav.domain.MyMapper +import com.flightfeather.uav.domain.entity.* +import com.flightfeather.uav.domain.mapper.RealTimeDataGridMapper import com.flightfeather.uav.domain.mapper.RealTimeDataMapper +import com.flightfeather.uav.domain.mapper.RealTimeDataUavMapper +import com.flightfeather.uav.domain.mapper.RealTimeDataVehicleMapper +import com.flightfeather.uav.lightshare.bean.DataVo import com.flightfeather.uav.repository.AirDataRepository import com.flightfeather.uav.socket.bean.AirData import com.flightfeather.uav.socket.bean.AirDataPackage import com.flightfeather.uav.socket.eunm.FactorType +import com.flightfeather.uav.socket.eunm.UWDeviceType import com.google.gson.Gson import org.springframework.stereotype.Repository import java.text.SimpleDateFormat -import java.util.* /** * @author riku * Date: 2020/6/11 */ @Repository -class AirDataRepositoryImpl(private val realTimeDataMapper: RealTimeDataMapper): AirDataRepository { +class AirDataRepositoryImpl( + private val realTimeDataMapper: RealTimeDataMapper, + private val realTimeDataVehicleMapper: RealTimeDataVehicleMapper, + private val realTimeDataUavMapper: RealTimeDataUavMapper, + private val realTimeDataGridMapper: RealTimeDataGridMapper +): AirDataRepository { override fun saveAirData(dataPackage: AirDataPackage): Int { val data = RealTimeData().apply { @@ -45,10 +56,117 @@ } } } - - realTimeDataMapper.insert(data) return 0 } + + override fun savePrepData(dataPackage: AirDataPackage): Int { + var mapper: MyMapper<out BaseRealTimeData?>? = null + when (UWDeviceType.getType(dataPackage.deviceCode)) { + UWDeviceType.VEHICLE -> { + mapper = realTimeDataVehicleMapper + RealTimeDataVehicle() + } + UWDeviceType.UAV -> { + mapper = realTimeDataUavMapper + RealTimeDataUav() + } + UWDeviceType.GRID -> { + mapper = realTimeDataGridMapper + RealTimeDataGrid() + } + else -> null + }?.run { + deviceCode = dataPackage.deviceCode + dataPackage.dataUnit.forEach { + if (it is AirData) { + when (it.factorId?.toInt()) { + FactorType.NO2.value -> no2 = it.factorData?.toFloat() + FactorType.CO.value -> co = it.factorData?.toFloat() + FactorType.H2S.value -> h2s = it.factorData?.toFloat() + FactorType.SO2.value -> so2 = it.factorData?.toFloat() + FactorType.O3.value -> o3 = it.factorData?.toFloat() + FactorType.PM25.value -> pm25 = it.factorData?.toFloat() + FactorType.PM10.value -> pm10 = it.factorData?.toFloat() + FactorType.TEMPERATURE.value -> temperature = it.factorData?.toFloat() + FactorType.HUMIDITY.value -> humidity = it.factorData?.toFloat() + FactorType.VOC.value -> voc = it.factorData?.toFloat() + FactorType.NOI.value -> noi = it.factorData?.toFloat() + FactorType.VELOCITY.value -> velocity = it.factorData?.toFloat() + FactorType.WIND_SPEED.value -> windSpeed = it.factorData?.toFloat() + FactorType.WIND_DIRECTION.value -> windDirection = it.factorData?.toFloat() + FactorType.HEIGHT.value -> height = it.factorData?.toFloat() + + FactorType.LAT.value -> latitude = it.factorData?.toBigDecimal() + FactorType.LNG.value -> longitude = it.factorData?.toBigDecimal() + FactorType.TIME.value -> it.statusList?.takeIf { l -> l.isNotEmpty() }?.get(0)?.let { d -> + dataTime = SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(d) + } + } + } + } + +// mapper?.insert(this) + return 1 + } + return 0 + } + + override fun savePrepData(dataList: List<RealTimeData>): Int { + var count = 0 + dataList.forEach {vo -> + when (UWDeviceType.getType(vo.deviceCode)) { + UWDeviceType.VEHICLE -> { + val d = RealTimeDataVehicle() + dataTransform(vo, d) + realTimeDataVehicleMapper.insert(d) + count++ + } + UWDeviceType.UAV -> { + val d = RealTimeDataUav() + dataTransform(vo, d) + realTimeDataUavMapper.insert(d) + count++ + } + UWDeviceType.GRID -> { + val d = RealTimeDataGrid() + dataTransform(vo, d) + realTimeDataGridMapper.insert(d) + count++ + } + } + } + return count + } + + private fun dataTransform(vo: RealTimeData, bean: BaseRealTimeData) { + bean.apply { + deviceCode = vo.deviceCode + latitude = vo.latitude + longitude = vo.longitude + dataTime = vo.dataTime + createTime = vo.createTime + GsonUtils.parserJsonToArrayBeans(vo.factors, AirData::class.java).forEach { + when (it.factorId?.toInt()) { + FactorType.NO2.value -> no2 = it.factorData?.toFloat() + FactorType.CO.value -> co = it.factorData?.toFloat() + FactorType.H2S.value -> h2s = it.factorData?.toFloat() + FactorType.SO2.value -> so2 = it.factorData?.toFloat() + FactorType.O3.value -> o3 = it.factorData?.toFloat() + FactorType.PM25.value -> pm25 = it.factorData?.toFloat() + FactorType.PM10.value -> pm10 = it.factorData?.toFloat() + FactorType.TEMPERATURE.value -> temperature = it.factorData?.toFloat() + FactorType.HUMIDITY.value -> humidity = it.factorData?.toFloat() + FactorType.VOC.value -> voc = it.factorData?.toFloat() + FactorType.NOI.value -> noi = it.factorData?.toFloat() + FactorType.VELOCITY.value -> velocity = it.factorData?.toFloat() + FactorType.WIND_SPEED.value -> windSpeed = it.factorData?.toFloat() + FactorType.WIND_DIRECTION.value -> windDirection = it.factorData?.toFloat() + FactorType.HEIGHT.value -> height = it.factorData?.toFloat() + } + } + + } + } } \ No newline at end of file diff --git a/src/main/kotlin/com/flightfeather/uav/socket/DeviceSession.kt b/src/main/kotlin/com/flightfeather/uav/socket/DeviceSession.kt index c04b467..8ee5393 100644 --- a/src/main/kotlin/com/flightfeather/uav/socket/DeviceSession.kt +++ b/src/main/kotlin/com/flightfeather/uav/socket/DeviceSession.kt @@ -14,13 +14,11 @@ companion object { private const val DEFAULT_DEVICE = "default_device" } - private val deviceMap = ConcurrentHashMap<String, ChannelHandlerContext?>() + private val deviceMap = ConcurrentHashMap<String?, ChannelHandlerContext?>() private val typeMap = ConcurrentHashMap<String, List<AirTypeData>>() fun saveDevice(deviceCode: String?, channel: ChannelHandlerContext?) { - deviceCode?.let { - deviceMap.put(deviceCode, channel) - } + deviceMap[deviceCode] = channel } fun getDevice(deviceCode: String?): ChannelHandlerContext? { diff --git a/src/main/kotlin/com/flightfeather/uav/socket/eunm/UWDeviceType.kt b/src/main/kotlin/com/flightfeather/uav/socket/eunm/UWDeviceType.kt new file mode 100644 index 0000000..d3e193e --- /dev/null +++ b/src/main/kotlin/com/flightfeather/uav/socket/eunm/UWDeviceType.kt @@ -0,0 +1,22 @@ +package com.flightfeather.uav.socket.eunm + +/** + * 璧拌埅鐩戞祴璁惧绫诲瀷 + */ +enum class UWDeviceType(val value: String, val des: String) { + UAV("0b", "鏃犱汉鏈鸿澶�"), + VEHICLE("0a", "杞﹁浇璁惧"), + GRID("0d", "缃戞牸鍖栬澶�"); + + companion object { + /** + * 鏍规嵁璁惧缂栧彿鑾峰彇璁惧绫诲瀷 + */ + fun getType(deviceCode: String?): UWDeviceType? = when (deviceCode?.substring(0, 2)) { + UAV.value -> UAV + VEHICLE.value -> VEHICLE + GRID.value -> GRID + else -> null + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/com/flightfeather/uav/socket/processor/UnderwayProcessor.kt b/src/main/kotlin/com/flightfeather/uav/socket/processor/UnderwayProcessor.kt index 33a5861..7df1965 100644 --- a/src/main/kotlin/com/flightfeather/uav/socket/processor/UnderwayProcessor.kt +++ b/src/main/kotlin/com/flightfeather/uav/socket/processor/UnderwayProcessor.kt @@ -5,6 +5,7 @@ import com.flightfeather.uav.socket.decoder.AirDataDecoder import com.flightfeather.uav.socket.decoder.DataPackageDecoder import com.flightfeather.uav.socket.eunm.AirCommandUnit +import com.flightfeather.uav.socket.eunm.UWDeviceType import io.netty.channel.ChannelHandlerContext import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Component @@ -59,7 +60,10 @@ */ fun saveToDataBase(dataPackage: AirDataPackage) { when (dataPackage.commandUnit) { - AirCommandUnit.AirData.value -> instance.airDataRepository.saveAirData(dataPackage) + AirCommandUnit.AirData.value -> { + // 浠son鏍煎紡瀛樺偍鍘熷鏁版嵁 + instance.airDataRepository.saveAirData(dataPackage) + } } } diff --git a/src/main/resources/generator/generatorConfig.xml b/src/main/resources/generator/generatorConfig.xml index a75f4aa..ad2304f 100644 --- a/src/main/resources/generator/generatorConfig.xml +++ b/src/main/resources/generator/generatorConfig.xml @@ -50,6 +50,9 @@ <!-- <table tableName="el_minutevalue" domainObjectName="ElectricMinuteValue" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> <!-- <table tableName="el_company_device" domainObjectName="CompanyDevice" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> <!-- <table tableName="co_complaint" domainObjectName="Complaint" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> - <table tableName="co_assessment" domainObjectName="Assessment" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/> +<!-- <table tableName="co_assessment" domainObjectName="Assessment" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> + <table tableName="real_time_data_grid" domainObjectName="RealTimeDataGrid" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/> + <table tableName="real_time_data_uav" domainObjectName="RealTimeDataUav" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/> + <table tableName="real_time_data_vehicle" domainObjectName="RealTimeDataVehicle" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/> </context> </generatorConfiguration> \ No newline at end of file diff --git a/src/main/resources/mapper/RealTimeDataGridMapper.xml b/src/main/resources/mapper/RealTimeDataGridMapper.xml new file mode 100644 index 0000000..955924d --- /dev/null +++ b/src/main/resources/mapper/RealTimeDataGridMapper.xml @@ -0,0 +1,39 @@ +<?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.flightfeather.uav.domain.mapper.RealTimeDataGridMapper"> + <resultMap id="BaseResultMap" type="com.flightfeather.uav.domain.entity.RealTimeDataGrid"> + <!-- + WARNING - @mbg.generated + --> + <id column="id" jdbcType="INTEGER" property="id" /> + <result column="device_code" jdbcType="VARCHAR" property="deviceCode" /> + <result column="latitude" jdbcType="DECIMAL" property="latitude" /> + <result column="longitude" jdbcType="DECIMAL" property="longitude" /> + <result column="altitude" jdbcType="REAL" property="altitude" /> + <result column="data_time" jdbcType="TIMESTAMP" property="dataTime" /> + <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> + <result column="NO2" jdbcType="REAL" property="no2" /> + <result column="CO" jdbcType="REAL" property="co" /> + <result column="H2S" jdbcType="REAL" property="h2s" /> + <result column="SO2" jdbcType="REAL" property="so2" /> + <result column="O3" jdbcType="REAL" property="o3" /> + <result column="PM25" jdbcType="REAL" property="pm25" /> + <result column="PM10" jdbcType="REAL" property="pm10" /> + <result column="temperature" jdbcType="REAL" property="temperature" /> + <result column="humidity" jdbcType="REAL" property="humidity" /> + <result column="VOC" jdbcType="REAL" property="voc" /> + <result column="NOI" jdbcType="REAL" property="noi" /> + <result column="velocity" jdbcType="REAL" property="velocity" /> + <result column="wind_speed" jdbcType="REAL" property="windSpeed" /> + <result column="wind_direction" jdbcType="REAL" property="windDirection" /> + <result column="height" jdbcType="REAL" property="height" /> + </resultMap> + <sql id="Base_Column_List"> + <!-- + WARNING - @mbg.generated + --> + id, device_code, latitude, longitude, altitude, data_time, create_time, NO2, CO, + H2S, SO2, O3, PM25, PM10, temperature, humidity, VOC, NOI, velocity, wind_speed, + wind_directon, height + </sql> +</mapper> \ No newline at end of file diff --git a/src/main/resources/mapper/RealTimeDataUavMapper.xml b/src/main/resources/mapper/RealTimeDataUavMapper.xml new file mode 100644 index 0000000..28a023f --- /dev/null +++ b/src/main/resources/mapper/RealTimeDataUavMapper.xml @@ -0,0 +1,39 @@ +<?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.flightfeather.uav.domain.mapper.RealTimeDataUavMapper"> + <resultMap id="BaseResultMap" type="com.flightfeather.uav.domain.entity.RealTimeDataUav"> + <!-- + WARNING - @mbg.generated + --> + <id column="id" jdbcType="INTEGER" property="id" /> + <result column="device_code" jdbcType="VARCHAR" property="deviceCode" /> + <result column="latitude" jdbcType="DECIMAL" property="latitude" /> + <result column="longitude" jdbcType="DECIMAL" property="longitude" /> + <result column="altitude" jdbcType="REAL" property="altitude" /> + <result column="data_time" jdbcType="TIMESTAMP" property="dataTime" /> + <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> + <result column="NO2" jdbcType="REAL" property="no2" /> + <result column="CO" jdbcType="REAL" property="co" /> + <result column="H2S" jdbcType="REAL" property="h2s" /> + <result column="SO2" jdbcType="REAL" property="so2" /> + <result column="O3" jdbcType="REAL" property="o3" /> + <result column="PM25" jdbcType="REAL" property="pm25" /> + <result column="PM10" jdbcType="REAL" property="pm10" /> + <result column="temperature" jdbcType="REAL" property="temperature" /> + <result column="humidity" jdbcType="REAL" property="humidity" /> + <result column="VOC" jdbcType="REAL" property="voc" /> + <result column="NOI" jdbcType="REAL" property="noi" /> + <result column="velocity" jdbcType="REAL" property="velocity" /> + <result column="wind_speed" jdbcType="REAL" property="windSpeed" /> + <result column="wind_direction" jdbcType="REAL" property="windDirection" /> + <result column="height" jdbcType="REAL" property="height" /> + </resultMap> + <sql id="Base_Column_List"> + <!-- + WARNING - @mbg.generated + --> + id, device_code, latitude, longitude, altitude, data_time, create_time, NO2, CO, + H2S, SO2, O3, PM25, PM10, temperature, humidity, VOC, NOI, velocity, wind_speed, + wind_directon, height + </sql> +</mapper> \ No newline at end of file diff --git a/src/main/resources/mapper/RealTimeDataVehicleMapper.xml b/src/main/resources/mapper/RealTimeDataVehicleMapper.xml new file mode 100644 index 0000000..18dfc17 --- /dev/null +++ b/src/main/resources/mapper/RealTimeDataVehicleMapper.xml @@ -0,0 +1,39 @@ +<?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.flightfeather.uav.domain.mapper.RealTimeDataVehicleMapper"> + <resultMap id="BaseResultMap" type="com.flightfeather.uav.domain.entity.RealTimeDataVehicle"> + <!-- + WARNING - @mbg.generated + --> + <id column="id" jdbcType="INTEGER" property="id" /> + <result column="device_code" jdbcType="VARCHAR" property="deviceCode" /> + <result column="latitude" jdbcType="DECIMAL" property="latitude" /> + <result column="longitude" jdbcType="DECIMAL" property="longitude" /> + <result column="altitude" jdbcType="REAL" property="altitude" /> + <result column="data_time" jdbcType="TIMESTAMP" property="dataTime" /> + <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> + <result column="NO2" jdbcType="REAL" property="no2" /> + <result column="CO" jdbcType="REAL" property="co" /> + <result column="H2S" jdbcType="REAL" property="h2s" /> + <result column="SO2" jdbcType="REAL" property="so2" /> + <result column="O3" jdbcType="REAL" property="o3" /> + <result column="PM25" jdbcType="REAL" property="pm25" /> + <result column="PM10" jdbcType="REAL" property="pm10" /> + <result column="temperature" jdbcType="REAL" property="temperature" /> + <result column="humidity" jdbcType="REAL" property="humidity" /> + <result column="VOC" jdbcType="REAL" property="voc" /> + <result column="NOI" jdbcType="REAL" property="noi" /> + <result column="velocity" jdbcType="REAL" property="velocity" /> + <result column="wind_speed" jdbcType="REAL" property="windSpeed" /> + <result column="wind_direction" jdbcType="REAL" property="windDirection" /> + <result column="height" jdbcType="REAL" property="height" /> + </resultMap> + <sql id="Base_Column_List"> + <!-- + WARNING - @mbg.generated + --> + id, device_code, latitude, longitude, altitude, data_time, create_time, NO2, CO, + H2S, SO2, O3, PM25, PM10, temperature, humidity, VOC, NOI, velocity, wind_speed, + wind_directon, height + </sql> +</mapper> \ No newline at end of file -- Gitblit v1.9.3