fire_point/src/main/java/com/xkrs/dao/RelRoleAuthorityDao.java
2023-03-08 14:06:14 +08:00

22 lines
781 B
Java

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<RelRoleAuthorityEntity, Long>, JpaSpecificationExecutor<RelRoleAuthorityEntity> {
/**
* 根据userId查询出权限的id
*/
@Query(value = "select authority_id from rel_role_authority where user_id = ?", nativeQuery = true)
List<Long> selectAuthorityByUserId(@Param("userId") Long userId);
}