feiyu02
2024-08-15 196bb14112448857a885e32dc4149e308e00b01a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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)
        }
    }
}