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;
|
2022-06-03 18:52:10 +08:00
|
|
|
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
|
2022-06-03 18:52:10 +08:00
|
|
|
public interface RelRoleAuthorityDao extends JpaRepository<RelRoleAuthorityEntity, Long>, JpaSpecificationExecutor<RelRoleAuthorityEntity> {
|
2021-07-12 14:51:34 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据userId查询出权限的id
|
|
|
|
*/
|
2022-06-03 18:52:10 +08:00
|
|
|
@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);
|
2022-06-03 18:52:10 +08:00
|
|
|
|
2021-07-12 14:51:34 +08:00
|
|
|
}
|