com.base4j.mvc.sys.mapper.SysUserRoleMapper Maven / Gradle / Ivy
package com.base4j.mvc.sys.mapper;
import com.base4j.mvc.sys.entity.SysRole;
import com.base4j.mvc.sys.entity.SysUserRole;
import com.base4j.mybatis.base.mapper.BaseMapper;
import com.base4j.mybatis.config.mybatis.annotations.AutoMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@AutoMapper
public interface SysUserRoleMapper extends BaseMapper {
@Select("SELECT * FROM SEED_SYS_ROLE SSR WHERE EXISTS ( SELECT SSUR.SYS_ROLE_ID FROM SEED_SYS_USER_ROLE SSUR" +
" WHERE SSR.ID = SSUR.SYS_ROLE_ID AND SSUR.SYS_USER_ID=#{userId})")
List selectRolesByUserId(@Param("userId") Long userId);
}