package com.fs.hospital.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.hospital.mapper.HospitalRoleMenuMapper;
import com.fs.hospital.domain.HospitalRoleMenu;
import com.fs.hospital.service.IHospitalRoleMenuService;

/**
 * 角色和菜单关联Service业务层处理
 * 
 * @author fs
 * @date 2024-02-26
 */
@Service
public class HospitalRoleMenuServiceImpl implements IHospitalRoleMenuService 
{
    @Autowired
    private HospitalRoleMenuMapper hospitalRoleMenuMapper;

    /**
     * 查询角色和菜单关联
     * 
     * @param roleId 角色和菜单关联主键
     * @return 角色和菜单关联
     */
    @Override
    public HospitalRoleMenu selectHospitalRoleMenuByRoleId(Long roleId)
    {
        return hospitalRoleMenuMapper.selectHospitalRoleMenuByRoleId(roleId);
    }

    /**
     * 查询角色和菜单关联列表
     * 
     * @param hospitalRoleMenu 角色和菜单关联
     * @return 角色和菜单关联
     */
    @Override
    public List<HospitalRoleMenu> selectHospitalRoleMenuList(HospitalRoleMenu hospitalRoleMenu)
    {
        return hospitalRoleMenuMapper.selectHospitalRoleMenuList(hospitalRoleMenu);
    }

    /**
     * 新增角色和菜单关联
     * 
     * @param hospitalRoleMenu 角色和菜单关联
     * @return 结果
     */
    @Override
    public int insertHospitalRoleMenu(HospitalRoleMenu hospitalRoleMenu)
    {
        return hospitalRoleMenuMapper.insertHospitalRoleMenu(hospitalRoleMenu);
    }

    /**
     * 修改角色和菜单关联
     * 
     * @param hospitalRoleMenu 角色和菜单关联
     * @return 结果
     */
    @Override
    public int updateHospitalRoleMenu(HospitalRoleMenu hospitalRoleMenu)
    {
        return hospitalRoleMenuMapper.updateHospitalRoleMenu(hospitalRoleMenu);
    }

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

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