新增接口:
1. 获取所有设备的最新一条数据
新增数据库表:
1. 车辆信息表
已修改9个文件
已删除1个文件
已添加11个文件
428 ■■■■■ 文件已修改
src/main/kotlin/com/flightfeather/obd/common/packgeinfo 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/domain/entity/VehicleInfo.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/domain/mapper/VehicleInfoMapper.kt 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/lightshare/bean/LatLngVo.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/lightshare/bean/VehicleInfoVo.kt 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/lightshare/eunm/CarStatus.kt 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/lightshare/eunm/CarType.kt 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/lightshare/service/ObdDataService.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/lightshare/service/VehicleService.kt 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/lightshare/service/impl/ObdDataServiceImpl.kt 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/lightshare/service/impl/VehicleServiceImpl.kt 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/lightshare/web/ObdDataController.kt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/lightshare/web/VehicleInfoController.kt 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/repository/DataStreamRepository.kt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/repository/ObdInfoRepository.kt 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/repository/VehicleRepository.kt 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/repository/impl/DataStreamDaoImpl.kt 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/repository/impl/ObdInfoDaoImpl.kt 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/repository/impl/VehicleRepositoryImpl.kt 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/generator/generatorConfig.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/VehicleInfoMapper.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/obd/common/packgeinfo
src/main/kotlin/com/flightfeather/obd/domain/entity/VehicleInfo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,98 @@
package com.flightfeather.obd.domain.entity;
import javax.persistence.*;
@Table(name = "obd_vehicle_info")
public class VehicleInfo {
    @Id
    private Integer id;
    @Column(name = "obd_device_code")
    private String obdDeviceCode;
    @Column(name = "obd_vin")
    private String obdVin;
    @Column(name = "obd_licence_plate")
    private String obdLicencePlate;
    /**
     * 0: é›†å¡ï¼› 1:渣土车
     */
    @Column(name = "obd_vehicle_type")
    private Integer obdVehicleType;
    /**
     * @return id
     */
    public Integer getId() {
        return id;
    }
    /**
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }
    /**
     * @return obd_device_code
     */
    public String getObdDeviceCode() {
        return obdDeviceCode;
    }
    /**
     * @param obdDeviceCode
     */
    public void setObdDeviceCode(String obdDeviceCode) {
        this.obdDeviceCode = obdDeviceCode == null ? null : obdDeviceCode.trim();
    }
    /**
     * @return obd_vin
     */
    public String getObdVin() {
        return obdVin;
    }
    /**
     * @param obdVin
     */
    public void setObdVin(String obdVin) {
        this.obdVin = obdVin == null ? null : obdVin.trim();
    }
    /**
     * @return obd_licence_plate
     */
    public String getObdLicencePlate() {
        return obdLicencePlate;
    }
    /**
     * @param obdLicencePlate
     */
    public void setObdLicencePlate(String obdLicencePlate) {
        this.obdLicencePlate = obdLicencePlate == null ? null : obdLicencePlate.trim();
    }
    /**
     * èŽ·å–1: é›†å¡ï¼› 2:渣土车
     *
     * @return obd_vehicle_type - 1: é›†å¡ï¼› 2:渣土车
     */
    public Integer getObdVehicleType() {
        return obdVehicleType;
    }
    /**
     * è®¾ç½®1: é›†å¡ï¼› 2:渣土车
     *
     * @param obdVehicleType 1: é›†å¡ï¼› 2:渣土车
     */
    public void setObdVehicleType(Integer obdVehicleType) {
        this.obdVehicleType = obdVehicleType;
    }
}
src/main/kotlin/com/flightfeather/obd/domain/mapper/VehicleInfoMapper.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
package com.flightfeather.obd.domain.mapper
import com.flightfeather.obd.domain.MyMapper
import com.flightfeather.obd.domain.entity.VehicleInfo
import org.apache.ibatis.annotations.Mapper
@Mapper
interface VehicleInfoMapper : MyMapper<VehicleInfo>
src/main/kotlin/com/flightfeather/obd/lightshare/bean/LatLngVo.kt
@@ -8,7 +8,13 @@
 */
class LatLngVo : BaseJson() {
    var deviceCode: String? = null
    var obdDataTime: Date?= null
    var vin: String? = null
    var license: String? = null
    var obdDataTime: Date? = null
    //车辆类型
    var carType: Int? = null
    //车辆状态
    var status: Int = 0
    var lat: Double? = null
    var lng: Double? = null
}
src/main/kotlin/com/flightfeather/obd/lightshare/bean/VehicleInfoVo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
package com.flightfeather.obd.lightshare.bean
/**
 * @author riku
 * Date: 2019/10/25
 */
class VehicleInfoVo : BaseJson() {
    var id: Int? = null
    var obdDeviceCode: String? = null
    var obdVin: String? = null
    var obdLicencePlate: String? = null
    /**
     * 0: é›†å¡ï¼› 1:渣土车
     */
    var obdVehicleType: Int? = null
}
src/main/kotlin/com/flightfeather/obd/lightshare/eunm/CarStatus.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
package com.flightfeather.obd.lightshare.eunm
/**
 * @author riku
 * Date: 2019/9/26
 * è½¦è¾†çŠ¶æ€
 * 0:离线
 * 1:在线
 * 2:警报
 * 3:超标
 */
enum class CarStatus(val value: Int) {
    OffLine(0),
    OnLine(1),
    Warn(2),
    Exceed(3)
}
src/main/kotlin/com/flightfeather/obd/lightshare/eunm/CarType.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
package com.flightfeather.obd.lightshare.eunm
/**
 * @author riku
 * Date: 2019/9/26
 */
enum class CarType(val value: Int){
    //集装箱卡车
    ContainerTruck(0),
    //渣土车
    SlagCar(1)
}
src/main/kotlin/com/flightfeather/obd/lightshare/service/ObdDataService.kt
@@ -44,6 +44,12 @@
    fun getCoordinate(deviceCode: String): LatLngVo
    /**
     * æ ¹æ®ç»ˆç«¯è®¾å¤‡ç åŠæ—¶é—´æ®µï¼Œç»™å‡ºæ­¤æ®µæ—¶é—´å†…
     * èŽ·å–æœ€æ–°çš„è½¦è¾†åæ ‡ä¿¡æ¯
     */
    fun getLatestCoordinate(pageNum: Int?, pageSize: Int?): List<LatLngVo>
    /**
     * æ ¹æ®ç»ˆç«¯è®¾å¤‡ç åŠæ—¶é—´æ®µï¼Œç»™å‡ºæ­¤æ®µæ—¶é—´å†…的坐标
     */
    //TODO
}
src/main/kotlin/com/flightfeather/obd/lightshare/service/VehicleService.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
package com.flightfeather.obd.lightshare.service
import com.flightfeather.obd.lightshare.bean.VehicleInfoVo
/**
 * @author riku
 * Date: 2019/10/25
 * è½¦è¾†ç›¸å…³ä¿¡æ¯æŽ¥å£
 */
interface VehicleService {
    /**
     * èŽ·å–è½¦è¾†ä¿¡æ¯
     */
    fun getVehicleInfo(pageNum: Int?, pageSize: Int?): List<VehicleInfoVo>
}
src/main/kotlin/com/flightfeather/obd/lightshare/service/impl/ObdDataServiceImpl.kt
@@ -1,9 +1,14 @@
package com.flightfeather.obd.lightshare.service.impl
import com.flightfeather.obd.lightshare.bean.*
import com.flightfeather.obd.lightshare.eunm.CarStatus
import com.flightfeather.obd.lightshare.service.ObdDataService
import com.flightfeather.obd.repository.*
import org.springframework.beans.BeanUtils
import org.springframework.stereotype.Service
import java.time.LocalDateTime
import java.time.ZoneId
import java.util.*
/**
 * @author riku
@@ -15,7 +20,8 @@
        val carLoginRepository: CarLoginRepository,
        val carLogoutRepository: CarLogoutRepository,
        val obdInfoRepository: ObdInfoRepository,
        val dataStreamRepository: DataStreamRepository
        val dataStreamRepository: DataStreamRepository,
        val vehicleRepository: VehicleRepository
) : ObdDataService {
    override fun getDataByVinCode(vinCode: String, pageNum: Int?, pageSize: Int?): MutableList<ObdDataVo>
@@ -27,8 +33,15 @@
    override fun getLogoutData(deviceCode: String, pageNum: Int?, pageSize: Int?, startTime: String?, endTime: String?): List<CarLogoutVo>
            = carLogoutRepository.getLogoutData(deviceCode, pageNum, pageSize, startTime, endTime)
    override fun getObdInfo(deviceCode: String, pageNum: Int?, pageSize: Int?): List<ObdInfoVo>
            = obdInfoRepository.getObdInfo(deviceCode, pageNum, pageSize)
    override fun getObdInfo(deviceCode: String, pageNum: Int?, pageSize: Int?): List<ObdInfoVo>{
        val resultList = mutableListOf<ObdInfoVo>()
        obdInfoRepository.getObdInfo(deviceCode, pageNum, pageSize).forEach {
            val vo = ObdInfoVo()
            BeanUtils.copyProperties(it, vo)
            resultList.add(vo)
        }
        return resultList
    }
    override fun getDataStream(deviceCode: String, pageNum: Int?, pageSize: Int?, startTime: String?, endTime: String?): List<DataStreamVo>
            = dataStreamRepository.getDataStream(deviceCode, pageNum, pageSize, startTime, endTime)
@@ -38,4 +51,39 @@
    override fun getCoordinate(deviceCode: String): LatLngVo
            = dataStreamRepository.getCoordinate(deviceCode)
    override fun getLatestCoordinate(pageNum: Int?, pageSize: Int?): List<LatLngVo> {
        val resultList = mutableListOf<LatLngVo>()
        val now = LocalDateTime.now()
        vehicleRepository.getVehicleInfo(pageNum, pageSize).forEach { vehicleInfo ->
            val dataStream = dataStreamRepository.getLatestDataStream(vehicleInfo.obdDeviceCode)
            val obdInfo = obdInfoRepository.getObdInfo(vehicleInfo.obdDeviceCode, 1, 1).takeIf { it.isNotEmpty() }?.get(0)
            //获取数据采样时间,如果为空,则取当前时间的前24小时
            val dataTime = dataStream?.obdDataTime?.toInstant()?.atZone(ZoneId.systemDefault())?.toLocalDateTime()
                    ?: LocalDateTime.now().minusDays(1)
            resultList.add(LatLngVo().apply {
                deviceCode = vehicleInfo.obdDeviceCode
                vin = obdInfo?.obdVin
                license = vehicleInfo.obdLicencePlate
                obdDataTime = dataStream?.obdDataTime
                carType = vehicleInfo.obdVehicleType
                //采样时间和当前时间相差超过10分钟认为设备处于离线状态
                //todo 2019.10.25 å…¶ä½™ä¸¤ç§è½¦è¾†çŠ¶æ€ï¼ŒåŽç»­éœ€å¤„ç†
                status = if (now.minusMinutes(10).isAfter(dataTime)) {
                    CarStatus.OffLine.value
                } else {
                    CarStatus.OnLine.value
                }
                lat = dataStream?.obdLat
                lng = dataStream?.obdLong
            })
        }
        return resultList
    }
}
src/main/kotlin/com/flightfeather/obd/lightshare/service/impl/VehicleServiceImpl.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
package com.flightfeather.obd.lightshare.service.impl
import com.flightfeather.obd.lightshare.bean.VehicleInfoVo
import com.flightfeather.obd.lightshare.service.VehicleService
import com.flightfeather.obd.repository.VehicleRepository
import org.springframework.beans.BeanUtils
import org.springframework.stereotype.Service
/**
 * @author riku
 * Date: 2019/10/25
 */
@Service
class VehicleServiceImpl(val vehicleRepository: VehicleRepository) : VehicleService {
    override fun getVehicleInfo(pageNum: Int?, pageSize: Int?): List<VehicleInfoVo> {
        val dbResult = vehicleRepository.getVehicleInfo(pageNum, pageSize)
        val resultList = mutableListOf<VehicleInfoVo>()
        dbResult.forEach {
            val vo = VehicleInfoVo()
            BeanUtils.copyProperties(it, vo)
            resultList.add(vo)
        }
        return resultList
    }
}
src/main/kotlin/com/flightfeather/obd/lightshare/web/ObdDataController.kt
@@ -63,4 +63,10 @@
    fun getCoordinate(
            @PathVariable("deviceCode") deviceCode: String
    ) = obdDataService.getCoordinate(deviceCode)
    @GetMapping("/coordinate/latest")
    fun getCoordinate(
            @RequestParam("page", required = false) pageNum: Int?,
            @RequestParam("per_page", required = false) pageSize: Int?
    ) = obdDataService.getLatestCoordinate(pageNum, pageSize)
}
src/main/kotlin/com/flightfeather/obd/lightshare/web/VehicleInfoController.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,22 @@
package com.flightfeather.obd.lightshare.web
import com.flightfeather.obd.lightshare.service.VehicleService
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController
/**
 * @author riku
 * Date: 2019/10/25
 */
@RestController
@RequestMapping("obd/vehicle")
class VehicleInfoController(val vehicleService: VehicleService) {
    @GetMapping("/info")
    fun getVehicleInfo(
            @RequestParam("page", required = false) pageNum: Int?,
            @RequestParam("per_page", required = false) pageSize: Int?
    ) = vehicleService.getVehicleInfo(pageNum, pageSize)
}
src/main/kotlin/com/flightfeather/obd/repository/DataStreamRepository.kt
@@ -1,5 +1,6 @@
package com.flightfeather.obd.repository
import com.flightfeather.obd.domain.entity.DataStream
import com.flightfeather.obd.lightshare.bean.DataStreamVo
import com.flightfeather.obd.lightshare.bean.LatLngVo
import com.flightfeather.obd.socket.bean.ObdPackageData
@@ -29,4 +30,9 @@
     * æ ¹æ®ç»ˆç«¯è®¾å¤‡ç èŽ·å–æœ€æ–°ç»çº¬åº¦
     */
    fun getCoordinate(deviceCode: String): LatLngVo
    /**
     * èŽ·å–ä¸€è¾†è½¦æœ€æ–°çš„ä¸€æ¡çŠ¶æ€ä¿¡æ¯
     */
    fun getLatestDataStream(deviceCode: String): DataStream?
}
src/main/kotlin/com/flightfeather/obd/repository/ObdInfoRepository.kt
@@ -20,5 +20,7 @@
    /**
     * æ ¹æ®ç»ˆç«¯è®¾å¤‡ç èŽ·å–obd数据
     */
    fun getObdInfo(deviceCode: String, pageNum: Int?, pageSize: Int?): List<ObdInfoVo>
    fun getObdInfo(deviceCode: String, pageNum: Int?, pageSize: Int?): List<com.flightfeather.obd.domain.entity.ObdInfo>
}
src/main/kotlin/com/flightfeather/obd/repository/VehicleRepository.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
package com.flightfeather.obd.repository
import com.flightfeather.obd.domain.entity.VehicleInfo
/**
 * @author riku
 * Date: 2019/10/25
 */
interface VehicleRepository {
    /**
     * èŽ·å–è½¦è¾†ä¿¡æ¯
     */
    fun getVehicleInfo(pageNum: Int?, pageSize: Int?): List<VehicleInfo>
}
src/main/kotlin/com/flightfeather/obd/repository/impl/DataStreamDaoImpl.kt
@@ -2,6 +2,7 @@
import com.flightfeather.obd.domain.entity.DataStream
import com.flightfeather.obd.domain.mapper.DataStreamMapper
import com.flightfeather.obd.domain.mapper.VehicleInfoMapper
import com.flightfeather.obd.lightshare.bean.DataStreamVo
import com.flightfeather.obd.lightshare.bean.LatLngVo
import com.flightfeather.obd.repository.DataStreamRepository
@@ -21,7 +22,7 @@
 * Date: 2019/9/17
 */
@Repository
class DataStreamDaoImpl(val dataStreamMapper: DataStreamMapper): DataStreamRepository {
class DataStreamDaoImpl(val dataStreamMapper: DataStreamMapper, val vehicleInfoMapper: VehicleInfoMapper): DataStreamRepository {
    override fun saveDataStream(packageData: ObdPackageData): Boolean {
@@ -84,12 +85,20 @@
        val example = Example(DataStream::class.java).apply {
            createCriteria().andEqualTo("obdDeviceCode", deviceCode).run {
                startTime?.let {
                    val st = sf.parse(startTime)
                    andGreaterThanOrEqualTo("obdDataTime", st)
                    try {
                        val st = sf.parse(startTime)
                        andGreaterThanOrEqualTo("obdDataTime", st)
                    } catch (e: Throwable) {
                        e.printStackTrace()
                    }
                }
                endTime?.let {
                    val et = sf.parse(endTime)
                    andLessThanOrEqualTo("obdDataTime", et)
                    try {
                        val et = sf.parse(endTime)
                        andLessThanOrEqualTo("obdDataTime", et)
                    } catch (e: Throwable) {
                        e.printStackTrace()
                    }
                }
                orderBy("obdDataTime").desc()
            }
@@ -115,12 +124,20 @@
        val example = Example(DataStream::class.java).apply {
            createCriteria().andEqualTo("obdDeviceCode", deviceCode).run {
                startTime?.let {
                    val st = sf.parse(startTime)
                    andGreaterThanOrEqualTo("obdDataTime", st)
                    try {
                        val st = sf.parse(startTime)
                        andGreaterThanOrEqualTo("obdDataTime", st)
                    } catch (e: Throwable) {
                        e.printStackTrace()
                    }
                }
                endTime?.let {
                    val et = sf.parse(endTime)
                    andLessThanOrEqualTo("obdDataTime", et)
                    try {
                        val et = sf.parse(endTime)
                        andLessThanOrEqualTo("obdDataTime", et)
                    } catch (e: Throwable) {
                        e.printStackTrace()
                    }
                }
                orderBy("obdDataTime").desc()
            }
@@ -154,4 +171,14 @@
        return latLngVo
    }
    override fun getLatestDataStream(deviceCode: String): DataStream? {
        val example = Example(DataStream::class.java).apply {
            createCriteria().andEqualTo("obdDeviceCode", deviceCode)
            orderBy("obdDataTime").desc()
        }
        //获取最新的一个
        PageHelper.offsetPage<DataStream>(0, 1)
        return dataStreamMapper.selectByExample(example).takeIf { it.isNotEmpty() }?.get(0)
    }
}
src/main/kotlin/com/flightfeather/obd/repository/impl/ObdInfoDaoImpl.kt
@@ -55,7 +55,7 @@
        }
    }
    override fun getObdInfo(deviceCode: String, pageNum: Int?, pageSize: Int?): List<ObdInfoVo> {
    override fun getObdInfo(deviceCode: String, pageNum: Int?, pageSize: Int?): List<ObdInfo> {
        val example = Example(ObdInfo::class.java).apply {
            createCriteria().andEqualTo("obdDeviceCode", deviceCode).run {
                orderBy("obdDataTime").desc()
@@ -65,15 +65,6 @@
        //分页
        val offset = (pageSize?.times(pageNum?.minus(1) ?: 0)) ?: 0
        PageHelper.offsetPage<ObdInfo>(offset, pageSize ?: 10)
        val result = obdInfoMapper.selectByExample(example)
        val resultList = mutableListOf<ObdInfoVo>()
        result.forEach {
            val vo = ObdInfoVo()
            BeanUtils.copyProperties(it, vo)
            resultList.add(vo)
        }
        return resultList
        return obdInfoMapper.selectByExample(example)
    }
}
src/main/kotlin/com/flightfeather/obd/repository/impl/VehicleRepositoryImpl.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
package com.flightfeather.obd.repository.impl
import com.flightfeather.obd.domain.entity.DataStream
import com.flightfeather.obd.domain.entity.VehicleInfo
import com.flightfeather.obd.domain.mapper.VehicleInfoMapper
import com.flightfeather.obd.repository.VehicleRepository
import com.github.pagehelper.PageHelper
import org.springframework.stereotype.Repository
/**
 * @author riku
 * Date: 2019/10/25
 */
@Repository
class VehicleRepositoryImpl(val vehicleInfoMapper: VehicleInfoMapper):VehicleRepository {
    override fun getVehicleInfo(pageNum: Int?, pageSize: Int?): List<VehicleInfo> {
        //分页
        val offset = (pageSize?.times(pageNum?.minus(1) ?: 0)) ?: 0
        PageHelper.offsetPage<DataStream>(offset, pageSize ?: 10)
        return vehicleInfoMapper.selectAll()
    }
}
src/main/resources/generator/generatorConfig.xml
@@ -52,7 +52,8 @@
        <!--<table tableName="obd_origin_data" domainObjectName="OriginData" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
        <!--<table tableName="obd_car_login" domainObjectName="CarLogin" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
        <!--<table tableName="obd_car_logout" domainObjectName="CarLogout" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
        <table tableName="obd_data_stream" domainObjectName="DataStream" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>
        <!--<table tableName="obd_data_stream" domainObjectName="DataStream" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
        <!--<table tableName="obd_info" domainObjectName="ObdInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
        <table tableName="obd_vehicle_info" domainObjectName="VehicleInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>
    </context>
</generatorConfiguration>
src/main/resources/mapper/VehicleInfoMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
<?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.obd.domain.mapper.VehicleInfoMapper">
  <resultMap id="BaseResultMap" type="com.flightfeather.obd.domain.entity.VehicleInfo">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="obd_device_code" jdbcType="VARCHAR" property="obdDeviceCode" />
    <result column="obd_vin" jdbcType="VARCHAR" property="obdVin" />
    <result column="obd_licence_plate" jdbcType="VARCHAR" property="obdLicencePlate" />
    <result column="obd_vehicle_type" jdbcType="INTEGER" property="obdVehicleType" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
    -->
    id, obd_device_code, obd_vin, obd_licence_plate, obd_vehicle_type
  </sql>
</mapper>