package cn.edu.whu.boot.user.mapper;

import cn.edu.whu.boot.user.entities.Role;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface RoleMapper {

    @Select("SELECT * FROM user_role WHERE id = #{id}")
    Role findById(@Param("id") int id);

    @Select("SELECT * FROM user_role WHERE name = #{name}")
    Role findByName(@Param("name") String name);

    @Select("SELECT * FROM user_role WHERE code = #{code}")
    Role findByCode(@Param("code") int code);
}
