fire_point/src/main/java/com/xkrs/dao/RelRoleAuthorityDao.java

22 lines
781 B
Java
Raw Normal View History

2023-03-08 14:06:14 +08:00
package com.xkrs.dao;
2021-07-12 14:51:34 +08:00
2023-03-08 14:06:14 +08:00
import com.xkrs.model.entity.RelRoleAuthorityEntity;
2021-07-12 14:51:34 +08:00
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
2021-07-12 14:51:34 +08:00
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
2023-02-06 10:30:57 +08:00
import org.springframework.stereotype.Component;
2021-07-12 14:51:34 +08:00
import java.util.List;
2023-02-06 10:30:57 +08:00
@Component
public interface RelRoleAuthorityDao extends JpaRepository<RelRoleAuthorityEntity, Long>, JpaSpecificationExecutor<RelRoleAuthorityEntity> {
2021-07-12 14:51:34 +08:00
/**
* 根据userId查询出权限的id
*/
@Query(value = "select authority_id from rel_role_authority where user_id = ?", nativeQuery = true)
2023-02-06 09:51:50 +08:00
List<Long> selectAuthorityByUserId(@Param("userId") Long userId);
2021-07-12 14:51:34 +08:00
}