xin
2025-04-28 08716238bafaf3e0b69675d4b3a6a3b531c7a4f9
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
31
32
33
34
35
36
37
package com.oying.modules.system.mapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.oying.modules.system.domain.Role;
import com.oying.modules.system.domain.dto.RoleQueryCriteria;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Set;
 
/**
 * @author Z
 * @date 2023-06-20
 */
@Mapper
public interface RoleMapper extends BaseMapper<Role> {
 
    List<Role> queryAll();
 
    Long countAll(@Param("criteria") RoleQueryCriteria criteria);
 
    List<Role> findAll(@Param("criteria") RoleQueryCriteria criteria);
 
    Role findById(@Param("roleId") Long roleId);
 
    Role findByName(@Param("name") String name);
 
    List<Role> findByUserId(@Param("userId") Long userId);
 
    int countByDepts(@Param("deptIds") Set<Long> deptIds);
 
    @Select("SELECT role.role_id as id FROM sys_role role, sys_roles_menus rm " +
            "WHERE role.role_id = rm.role_id AND rm.menu_id = #{menuId}")
    List<Role> findByMenuId(@Param("menuId") Long menuId);
 
}