
package com.lutao.cloud.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lutao.cloud.admin.api.entity.SysCompany;
import com.lutao.cloud.admin.mapper.SysCompanyMapper;
import com.lutao.cloud.admin.service.SysCompanyService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 
 *
 * @author guoyc
 * @date 2022-05-30 10:00:45
 */
@Service
public class SysCompanyServiceImpl extends ServiceImpl<SysCompanyMapper, SysCompany> implements SysCompanyService {

    /**
     * 通过公司名字获取公司列表
     * @param companyName
     * @return
     */
    @Override
    public List<SysCompany> getSysCompanyListByName(String companyName){
        return  list(new QueryWrapper<SysCompany>().lambda().like(SysCompany::getCompanyName,companyName));
    }


    /**
     * 查询公司详情
     * @param companyId
     * @return
     */
    @Override
    public SysCompany getSysCompanyById(Integer companyId){
        return baseMapper.getSysCompanyById(companyId);
    }
}
