package com.tykj.dev.device.user.subject.dao;

import com.tykj.dev.device.user.subject.entity.UserRole;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserRoleDao extends JpaRepository<UserRole, Integer>, JpaSpecificationExecutor<UserRole> {
    List<UserRole> findAllByUserId(Integer userId);

    void deleteAllByRoleId(Integer roleId);
}
