liuxiaolong
2019-05-06 f99bc8c6a1d10610373738edd7d0aa0181c81d99
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.cloud.user.dao;
 
import com.cloud.model.sys.SysMenu;
import com.cloud.model.sys.SysRoleMenu;
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.Map;
import java.util.Set;
 
@Mapper
public interface SysRoleMenuDao {
    int insert(SysRoleMenu record);
 
    int insertSelective(SysRoleMenu record);
 
    Set<SysMenu> findPermissionsByRoleIds(@Param("roleIds") Set<Long> roleIds, @Param("orgId") Long orgId);
 
    Set<SysMenu> findMenusByRoleIds(Map<String,Object> params);
 
    @Select("select * from sys_menu t where enabled = '0' and delFlag = '0'order by t.sort")
    List<SysMenu> findAll();
 
    @Select("select t.menuId from sys_role_menu t where t.roleId = #{roleId} and t.orgId = #{orgId}")
    Set<Long> findMenuIdsByRoleId(Map<String,Object> params);
 
    Integer save(SysMenu menu);
 
    Integer update(SysMenu menu);
 
    Integer delete(@Param("id") Long id, @Param("orgId") Long orgId);
 
    SysMenu findById(@Param("id") Long id, @Param("orgId") Long orgId);
 
    void deleteRolePermissionByParams(Map<String, Object> params);
 
    List<Map<String, Object>> findMenuByUser(Map<String, Object> map);
 
    @Select("select t.menuId from sys_role_menu t where t.roleId in (\n" +
            "select roleId from sys_role_user where userId = #{userId} and orgId = #{orgId}) and t.orgId = #{orgId}")
    Set<Long> findMenuIdsByUserId(Map<String, Object> params);
 
    /**
     * 查询所有模块
     * @param map
     * @return
     */
    List<Map<String, Object>> findAllMenuByUser(Map<String, Object> map);
}