package com.flightfeather.obd.repository.impl
|
|
import com.flightfeather.obd.domain.entity.ObdUser
|
import com.flightfeather.obd.domain.mapper.ObdUserMapper
|
import com.flightfeather.obd.lightshare.bean.ObdUserVo
|
import com.flightfeather.obd.repository.ObdUserRepository
|
import org.springframework.beans.BeanUtils
|
import org.springframework.stereotype.Repository
|
import tk.mybatis.mapper.entity.Example
|
|
/**
|
* @author riku
|
* Date: 2019/9/6
|
*/
|
@Repository
|
class ObdUserDaoImpl(val obdUserMapper: ObdUserMapper): ObdUserRepository {
|
|
override fun getUserInfo(userId: String): ObdUserVo? {
|
val example = Example(ObdUser::class.java).apply {
|
createCriteria().andEqualTo("obdUserId", userId)
|
}
|
|
val result = obdUserMapper.selectByExample(example)
|
|
if (result.isNotEmpty()) {
|
val vo = ObdUserVo()
|
BeanUtils.copyProperties(result[0], vo)
|
return vo
|
}
|
|
return null
|
}
|
|
}
|