package com.huiju.estateagents.property.dao;


import com.huiju.estateagents.property.model.TaSysRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface TaSysRoleMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(TaSysRole record);

    int insertSelective(TaSysRole record);

    TaSysRole selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TaSysRole record);

    int updateByPrimaryKey(TaSysRole record);

    TaSysRole findRoleByUserId(Integer userId);


    /**
     * 根据 角色名称 查询
     * @param roleName
     * @return
     */
    @ResultType(TaSysRole.class)
    @Select("select * from ta_sys_role where role_name=#{roleName}")
    TaSysRole selectByRoleName(String roleName);

}