| | |
| | | fun getDataStream(deviceCode: String, pageNum: Int?, pageSize: Int?, startTime: String?, endTime: String?): List<DataStreamVo> |
| | | |
| | | /** |
| | | * 根据终端设备码获取数据流数据计数 |
| | | */ |
| | | fun getDataStreamCount(deviceCode: String, startTime: String?, endTime: String?): Int |
| | | |
| | | /** |
| | | * 根据终端设备码获取最新经纬度 |
| | | */ |
| | | fun getCoordinate(deviceCode: String): LatLngVo |
| | | |
| | | /** |
| | | * 根据终端设备码及时间段,给出此段时间内 |
| | | */ |
| | | } |
| | |
| | | override fun getDataStream(deviceCode: String, pageNum: Int?, pageSize: Int?, startTime: String?, endTime: String?): List<DataStreamVo> |
| | | = dataStreamRepository.getDataStream(deviceCode, pageNum, pageSize, startTime, endTime) |
| | | |
| | | override fun getDataStreamCount(deviceCode: String, startTime: String?, endTime: String?): Int |
| | | = dataStreamRepository.getDataStreamCount(deviceCode, startTime, endTime) |
| | | |
| | | override fun getCoordinate(deviceCode: String): LatLngVo |
| | | = dataStreamRepository.getCoordinate(deviceCode) |
| | | } |
| | |
| | | @RequestParam("endTime", required = false) endTime: String? |
| | | ) = obdDataService.getDataStream(deviceCode, pageNum, pageSize, startTime, endTime) |
| | | |
| | | @GetMapping("/dataStream/count") |
| | | fun getDataStreamCount( |
| | | @RequestParam("deviceCode") deviceCode: String = "", |
| | | @RequestParam("startTime", required = false) startTime: String?, |
| | | @RequestParam("endTime", required = false) endTime: String? |
| | | ) = obdDataService.getDataStreamCount(deviceCode, startTime, endTime) |
| | | |
| | | @GetMapping("/coordinate/{deviceCode}") |
| | | fun getCoordinate( |
| | | @PathVariable("deviceCode") deviceCode: String |
| | |
| | | fun getDataStream(deviceCode: String, pageNum: Int?, pageSize: Int?, startTime: String?, endTime: String?): List<DataStreamVo> |
| | | |
| | | /** |
| | | * 根据终端设备码获取数据流数据计数 |
| | | */ |
| | | fun getDataStreamCount(deviceCode: String, startTime: String?, endTime: String?): Int |
| | | |
| | | /** |
| | | * 根据终端设备码获取最新经纬度 |
| | | */ |
| | | fun getCoordinate(deviceCode: String): LatLngVo |
| | |
| | | return resultList |
| | | } |
| | | |
| | | override fun getDataStreamCount(deviceCode: String, startTime: String?, endTime: String?): Int { |
| | | val sf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss") |
| | | val example = Example(DataStream::class.java).apply { |
| | | createCriteria().andEqualTo("obdDeviceCode", deviceCode).run { |
| | | startTime?.let { |
| | | val st = sf.parse(startTime) |
| | | andGreaterThanOrEqualTo("obdDataTime", st) |
| | | } |
| | | endTime?.let { |
| | | val et = sf.parse(endTime) |
| | | andLessThanOrEqualTo("obdDataTime", et) |
| | | } |
| | | orderBy("obdDataTime").desc() |
| | | } |
| | | } |
| | | |
| | | return dataStreamMapper.selectCountByExample(example) |
| | | } |
| | | |
| | | override fun getCoordinate(deviceCode: String): LatLngVo { |
| | | val example = Example(DataStream::class.java).apply { |
| | | createCriteria().andEqualTo("obdDeviceCode", deviceCode).run { |