| | |
| | | } |
| | | } |
| | | |
| | | 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() |
| | |
| | | //分页 |
| | | 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) |
| | | } |
| | | } |