package com.sysu.admin.support.system.user_role;

import com.xiesx.fastboot.core.jpa.JpaPlusRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface UserRoleRepository extends JpaPlusRepository<UserRole, Long> {

    @Query(value = "select * from sys_user_role where users=?1", nativeQuery = true)
    UserRole getRoleByUser(Long userId);

    @Query(value = "select * from sys_user_role where users=?1", nativeQuery = true)
    List<UserRole> getRoleByUsers(Long userId);
}
