package com.bofeng.dao; import com.baomidou.mybatisplus.mapper.BaseMapper; import com.bofeng.entity.UserRole; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.springframework.stereotype.Repository; import java.util.List; @Mapper @Repository public interface UserRoleMapper extends BaseMapper { @Select("select * from sys_user_role where user_id = #{userId}") List getUserRoleByUserId(@Param("userId") Long userId); @Select("select * from sys_user_role where user_id=#{userId} and role_id=2") UserRole getUserRoleYwhByUserId(@Param("userId") Long userId); @Select("select * from sys_user_role where user_id=#{userId} and role_id=2") List getUserRoleYwhsByUserId(@Param("userId") Long userId); }