package cn.flightfeather.supervision.lightshare.repository.impl
|
|
import cn.flightfeather.supervision.domain.entity.Company
|
import cn.flightfeather.supervision.domain.mapper.CompanyMapper
|
import cn.flightfeather.supervision.domain.mapper.UserinfoMapper
|
import cn.flightfeather.supervision.lightshare.repository.CompanyRepository
|
import org.springframework.stereotype.Repository
|
|
/**
|
* @author riku
|
* Date: 2019/12/19
|
*/
|
@Repository
|
class CompanyRepositoryImpl(
|
val companyMapper: CompanyMapper,
|
val userinfoMapper: UserinfoMapper
|
):CompanyRepository {
|
|
override fun findCompanyByUserId(userId: String): Company {
|
val companyId = userinfoMapper.selectByPrimaryKey(userId)?.dGuid
|
return if (companyId == null) {
|
Company()
|
}else{
|
companyMapper.selectByPrimaryKey(companyId)
|
}
|
}
|
}
|