package cn.palmte.work.model;


import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
public interface SysRolePermissionRepository extends JpaRepository<SysRolePermission, Integer> {


    @Modifying
    @Query(" delete from SysRolePermission where  permissionId = ?1 ")
    public int deleteSysRolePermissionByPermissionId(int permission_id);

    @Query("  from SysRolePermission where roleId=?1 ")
    public List<SysRolePermission> findPerListByRoleId(int role_id);

    @Modifying
    @Query(" delete from SysRolePermission where roleId=?1")
    public int deleteSysRolePermissionByRoleId(int role_id);

}
