| | |
| | | |
| | | import com.flightfeather.obd.domain.entity.CarLogout |
| | | import com.flightfeather.obd.domain.mapper.CarLogoutMapper |
| | | import com.flightfeather.obd.lightshare.bean.CarLogoutVo |
| | | import com.flightfeather.obd.repository.CarLogoutRepository |
| | | import com.flightfeather.obd.socket.bean.CarLogOutData |
| | | import com.flightfeather.obd.socket.bean.ObdPackageData |
| | | import com.flightfeather.obd.socket.eunm.ObdCommandUnit |
| | | import com.github.pagehelper.PageHelper |
| | | import org.springframework.beans.BeanUtils |
| | | import org.springframework.stereotype.Repository |
| | | import tk.mybatis.mapper.entity.Example |
| | | |
| | | /** |
| | | * @author riku |
| | |
| | | false |
| | | } |
| | | } |
| | | |
| | | override fun getLogoutData(deviceCode: String, pageNum: Int?, pageSize: Int?, startTime: String?, endTime: String?): List<CarLogoutVo> { |
| | | val example = Example(CarLogout::class.java).apply { |
| | | createCriteria().andEqualTo("obdDeviceCode", deviceCode).run { |
| | | startTime?.let { andGreaterThanOrEqualTo("loginDataTime", it) } |
| | | endTime?.let { andLessThanOrEqualTo("loginDataTime", it) } |
| | | orderBy("loginDataTime").desc() |
| | | } |
| | | } |
| | | |
| | | //分页 |
| | | val offset = (pageSize?.times(pageNum?.minus(1) ?: 0)) ?: 0 |
| | | PageHelper.offsetPage<CarLogout>(offset, pageSize ?: 10) |
| | | val result = carLogoutMapper.selectByExample(example) |
| | | |
| | | val resultList = mutableListOf<CarLogoutVo>() |
| | | result.forEach { |
| | | val vo = CarLogoutVo() |
| | | BeanUtils.copyProperties(it, vo) |
| | | resultList.add(vo) |
| | | } |
| | | |
| | | return resultList |
| | | } |
| | | } |