zhangf
2024-07-26 698995469a3fcdc3164fc486d18bdbe059b6c92e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.gkhy.fourierSpecialGasMonitor.domain.account.repository.jpa;
 
import com.gkhy.fourierSpecialGasMonitor.domain.account.entity.RoleMenuBind;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
 
import java.util.List;
 
@Repository
public interface RoleMenuBindRepository extends JpaRepository<RoleMenuBind,Long> {
 
    List<RoleMenuBind> findAllByRoleIdAndMenuItemIdIn(Long roleId,List<Long> menuItemIds);
 
    List<RoleMenuBind> findAllByMenuItemIdAndRoleIdIn(Long menuItemId,List<Long> roleIds);
 
    List<RoleMenuBind> findAllByRoleId(Long roleId);
 
    @Query(value = "select rb.roleId from RoleMenuBind rb where rb.menuItemId = :menuItemId")
    List<Long> findBindRoleListByMenuItemId(Long menuItemId);
 
    @Modifying
    Integer deleteByMenuItemId(Long menuItemId);
 
    @Modifying
    Integer deleteByMenuItemIdAndRoleIdIn(Long menuItemId,List<Long> roleIds);
 
    List<RoleMenuBind> findAllByRoleIdIn(List<Long> roleIds);
}