package com.fs.company.service.impl;

import com.fs.company.domain.CompanyRoleMenu;
import com.fs.company.mapper.CompanyRoleMenuMapper;
import com.fs.company.service.ICompanyRoleMenuService;
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 CompanyRoleMenuServiceImpl implements ICompanyRoleMenuService
{
    @Autowired
    private CompanyRoleMenuMapper companyRoleMenuMapper;

    /**
     * 查询角色和菜单关联
     * 
     * @param roleId 角色和菜单关联ID
     * @return 角色和菜单关联
     */
    @Override
    public CompanyRoleMenu selectCompanyRoleMenuById(Long roleId)
    {
        return companyRoleMenuMapper.selectCompanyRoleMenuById(roleId);
    }

    /**
     * 查询角色和菜单关联列表
     * 
     * @param companyRoleMenu 角色和菜单关联
     * @return 角色和菜单关联
     */
    @Override
    public List<CompanyRoleMenu> selectCompanyRoleMenuList(CompanyRoleMenu companyRoleMenu)
    {
        return companyRoleMenuMapper.selectCompanyRoleMenuList(companyRoleMenu);
    }

    /**
     * 新增角色和菜单关联
     * 
     * @param companyRoleMenu 角色和菜单关联
     * @return 结果
     */
    @Override
    public int insertCompanyRoleMenu(CompanyRoleMenu companyRoleMenu)
    {
        return companyRoleMenuMapper.insertCompanyRoleMenu(companyRoleMenu);
    }

    /**
     * 修改角色和菜单关联
     * 
     * @param companyRoleMenu 角色和菜单关联
     * @return 结果
     */
    @Override
    public int updateCompanyRoleMenu(CompanyRoleMenu companyRoleMenu)
    {
        return companyRoleMenuMapper.updateCompanyRoleMenu(companyRoleMenu);
    }

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

    /**
     * 删除角色和菜单关联信息
     * 
     * @param roleId 角色和菜单关联ID
     * @return 结果
     */
    @Override
    public int deleteCompanyRoleMenuById(Long roleId)
    {
        return companyRoleMenuMapper.deleteCompanyRoleMenuById(roleId);
    }
}
