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

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

import java.util.List;

public interface RolePermissionsDao extends JpaRepository<RolePermissions, Integer>, JpaSpecificationExecutor<RolePermissions> {

    List<RolePermissions> findAllByRoleIdIn(List<Integer> roleIds);

    List<RolePermissions> findAllByRoleId(Integer roleId);

    List<RolePermissions> findAllByPermissionsId(Integer permissionsId);

    void deleteAllByRoleId(Integer roleId);
}
