package com.ruoyi.ss.menuRole.service.impl;

import java.util.List;

import com.ruoyi.ss.menuRole.domain.MenuRole;
import com.ruoyi.ss.menuRole.domain.MenuRoleQuery;
import com.ruoyi.ss.menuRole.domain.MenuRoleVO;
import com.ruoyi.ss.menuRole.mapper.MenuRoleMapper;
import com.ruoyi.ss.menuRole.service.IMenuRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 角色和菜单关联Service业务层处理
 *
 * @author qzz
 * @date 2025-01-16
 */
@Service
public class MenuRoleServiceImpl implements IMenuRoleService
{
    @Autowired
    private MenuRoleMapper menuRoleMapper;

    /**
     * 查询角色和菜单关联
     *
     * @param roleId 角色和菜单关联主键
     * @return 角色和菜单关联
     */
    @Override
    public MenuRoleVO selectMenuRoleByRoleId(String roleId)
    {
        return menuRoleMapper.selectMenuRoleByRoleId(roleId);
    }

    /**
     * 查询角色和菜单关联列表
     *
     * @param menuRole 角色和菜单关联
     * @return 角色和菜单关联
     */
    @Override
    public List<MenuRoleVO> selectMenuRoleList(MenuRoleQuery menuRole)
    {
        return menuRoleMapper.selectMenuRoleList(menuRole);
    }

    /**
     * 新增角色和菜单关联
     *
     * @param menuRole 角色和菜单关联
     * @return 结果
     */
    @Override
    public int insertMenuRole(MenuRole menuRole)
    {
        return menuRoleMapper.insertMenuRole(menuRole);
    }

    /**
     * 修改角色和菜单关联
     *
     * @param menuRole 角色和菜单关联
     * @return 结果
     */
    @Override
    public int updateMenuRole(MenuRole menuRole)
    {
        return menuRoleMapper.updateMenuRole(menuRole);
    }

    /**
     * 批量删除角色和菜单关联
     *
     * @param roleIds 需要删除的角色和菜单关联主键
     * @return 结果
     */
    @Override
    public int deleteMenuRoleByRoleIds(String[] roleIds)
    {
        return menuRoleMapper.deleteMenuRoleByRoleIds(roleIds);
    }

    /**
     * 删除角色和菜单关联信息
     *
     * @param roleId 角色和菜单关联主键
     * @return 结果
     */
    @Override
    public int deleteMenuRoleByRoleId(String roleId)
    {
        return menuRoleMapper.deleteMenuRoleByRoleId(roleId);
    }
}
