package com.xkrs.dao; import com.xkrs.model.entity.RelRoleAuthorityEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Component; import java.util.List; @Component public interface RelRoleAuthorityDao extends JpaRepository, JpaSpecificationExecutor { /** * 根据userId查询出权限的id */ @Query(value = "select authority_id from rel_role_authority where user_id = ?", nativeQuery = true) List selectAuthorityByUserId(@Param("userId") Long userId); }