package com.fs.hospital.service.impl;


import com.fs.hospital.domain.HospitalUserRole;
import com.fs.hospital.mapper.HospitalUserRoleMapper;
import com.fs.hospital.service.IHospitalUserRoleService;
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 HospitalUserRoleServiceImpl implements IHospitalUserRoleService
{
    @Autowired
    private HospitalUserRoleMapper hospitalUserRoleMapper;

    /**
     * 查询用户和角色关联
     *
     * @param userId 用户和角色关联ID
     * @return 用户和角色关联
     */
    @Override
    public HospitalUserRole selectHospitalUserRoleById(Long userId)
    {
        return hospitalUserRoleMapper.selectHospitalUserRoleById(userId);
    }

    /**
     * 查询用户和角色关联列表
     *
     * @param HospitalUserRole 用户和角色关联
     * @return 用户和角色关联
     */
    @Override
    public List<HospitalUserRole> selectHospitalUserRoleList(HospitalUserRole HospitalUserRole)
    {
        return hospitalUserRoleMapper.selectHospitalUserRoleList(HospitalUserRole);
    }

    /**
     * 新增用户和角色关联
     *
     * @param HospitalUserRole 用户和角色关联
     * @return 结果
     */
    @Override
    public int insertHospitalUserRole(HospitalUserRole HospitalUserRole)
    {
        return hospitalUserRoleMapper.insertHospitalUserRole(HospitalUserRole);
    }

    /**
     * 修改用户和角色关联
     *
     * @param HospitalUserRole 用户和角色关联
     * @return 结果
     */
    @Override
    public int updateHospitalUserRole(HospitalUserRole HospitalUserRole)
    {
        return hospitalUserRoleMapper.updateHospitalUserRole(HospitalUserRole);
    }

    /**
     * 批量删除用户和角色关联
     *
     * @param userIds 需要删除的用户和角色关联ID
     * @return 结果
     */
    @Override
    public int deleteHospitalUserRoleByIds(Long[] userIds)
    {
        return hospitalUserRoleMapper.deleteHospitalUserRoleByIds(userIds);
    }

    /**
     * 删除用户和角色关联信息
     *
     * @param userId 用户和角色关联ID
     * @return 结果
     */
    @Override
    public int deleteHospitalUserRoleById(Long userId)
    {
        return hospitalUserRoleMapper.deleteHospitalUserRoleById(userId);
    }
}
