package com.fs.company.service.impl;

import com.fs.company.domain.CompanyRoleDept;
import com.fs.company.mapper.CompanyRoleDeptMapper;
import com.fs.company.service.ICompanyRoleDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 角色和部门关联Service业务层处理
 * 
 * @author fs
 * @date 2021-05-25
 */
@Service
public class CompanyRoleDeptServiceImpl implements ICompanyRoleDeptService
{
    @Autowired
    private CompanyRoleDeptMapper companyRoleDeptMapper;

    /**
     * 查询角色和部门关联
     * 
     * @param roleId 角色和部门关联ID
     * @return 角色和部门关联
     */
    @Override
    public CompanyRoleDept selectCompanyRoleDeptById(Long roleId)
    {
        return companyRoleDeptMapper.selectCompanyRoleDeptById(roleId);
    }

    /**
     * 查询角色和部门关联列表
     * 
     * @param companyRoleDept 角色和部门关联
     * @return 角色和部门关联
     */
    @Override
    public List<CompanyRoleDept> selectCompanyRoleDeptList(CompanyRoleDept companyRoleDept)
    {
        return companyRoleDeptMapper.selectCompanyRoleDeptList(companyRoleDept);
    }

    /**
     * 新增角色和部门关联
     * 
     * @param companyRoleDept 角色和部门关联
     * @return 结果
     */
    @Override
    public int insertCompanyRoleDept(CompanyRoleDept companyRoleDept)
    {
        return companyRoleDeptMapper.insertCompanyRoleDept(companyRoleDept);
    }

    /**
     * 修改角色和部门关联
     * 
     * @param companyRoleDept 角色和部门关联
     * @return 结果
     */
    @Override
    public int updateCompanyRoleDept(CompanyRoleDept companyRoleDept)
    {
        return companyRoleDeptMapper.updateCompanyRoleDept(companyRoleDept);
    }

    /**
     * 批量删除角色和部门关联
     * 
     * @param roleIds 需要删除的角色和部门关联ID
     * @return 结果
     */
    @Override
    public int deleteCompanyRoleDeptByIds(Long[] roleIds)
    {
        return companyRoleDeptMapper.deleteCompanyRoleDeptByIds(roleIds);
    }

    /**
     * 删除角色和部门关联信息
     * 
     * @param roleId 角色和部门关联ID
     * @return 结果
     */
    @Override
    public int deleteCompanyRoleDeptById(Long roleId)
    {
        return companyRoleDeptMapper.deleteCompanyRoleDeptById(roleId);
    }
}
