package com.ssm.mapper.system;

import com.ssm.model.system.SysUser;
import com.ssm.model.system.SysUserExample;

import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface SysUserMapper {
    int countByExample(SysUserExample example);

    int deleteByExample(SysUserExample example);

    int deleteByPrimaryKey(Integer userid);

    int insert(SysUser record);

    int insertSelective(SysUser record);

    List<SysUser> selectByExample(SysUserExample example);
    
    List<SysUser> selectByCondition(@Param("username") String username, @Param("employeeno") String employeeno);

    SysUser selectByPrimaryKey(Integer userid);

    int updateByExampleSelective(@Param("record") SysUser record, @Param("example") SysUserExample example);

    int updateByExample(@Param("record") SysUser record, @Param("example") SysUserExample example);

    int updateByPrimaryKeySelective(SysUser record);

    int updateByPrimaryKey(SysUser record);
    
    SysUser findByEmployeenoAndPasswod(@Param("employeeno") String employeeno, @Param("password") String password);
    
    SysUser findByEmployeeno(@Param("employeeno") String employeeno);
    
    int deleteUserRole(Integer userid);
    
    int insertUserRole(@Param("userid")Integer userid, @Param("roleid")Integer roleid);
    
    int selectPerssion(@Param("userid")Integer userid, @Param("menuUrl")String menuUrl);
    
    List<SysUser> selectAllUser();

    /**
     * 
     * @param userid
     * @param roldid
     * @return
     */
	int selectUserRoleByUserIdAndRoldId(@Param("userid") Integer userid,@Param("roldid") Integer roldid);
}