package com.ssm.mapper.system;

import com.ssm.model.system.SysMenu;
import com.ssm.model.system.SysRole;
import com.ssm.model.system.SysRoleExample;
import com.ssm.model.system.SysUser;

import java.util.List;

import org.apache.ibatis.annotations.Param;

public interface SysRoleMapper {
    int countByExample(SysRoleExample example);

    int deleteByExample(SysRoleExample example);

    int deleteByPrimaryKey(Integer roleid);

    int insert(SysRole record);

    int insertSelective(SysRole record);

    List<SysRole> selectByExample(SysRoleExample example);

    SysRole selectByPrimaryKey(Integer roleid);

    int updateByExampleSelective(@Param("record") SysRole record, @Param("example") SysRoleExample example);

    int updateByExample(@Param("record") SysRole record, @Param("example") SysRoleExample example);

    int updateByPrimaryKeySelective(SysRole record);

    int updateByPrimaryKey(SysRole record);

	List<SysRole> findAll(String roleName);

	List<SysMenu> selectMenusByRoleId(Integer roleId);

	Integer addRoleRelevancePer(@Param("roleId")Integer roleId,@Param("menuId") Integer menuId);

	Integer selectRoleRelevancePer(@Param("roleId")Integer roleId,@Param("menuId") Integer menuId);

	List<SysUser> selectUserByRoleId(@Param("roleId")Integer roleId,@Param("username")String username ,@Param("employeeno")String employeeno);

	Integer deleteUserByRole(@Param("roleId")Integer roleId, @Param("userId") Integer userId);
	
	List<SysRole> selectRoleAndMenuList();
	
	List<SysRole> findUserRoleByUserId(@Param("userid") Integer userid);

	void deletePerPageByRoleIdAndMenuId(@Param("menuId")Integer menuId, @Param("roleId")Integer roleId);
	
	SysRole selectByRoleName(@Param("roleName") String roleName);
}