huang
6 天以前 0dfdc8148cc266fd3e877183c5b162fb986d5c65
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mes.role.mapper.SysRoleMapper">
 
    <resultMap id="baseMap" type="com.mes.role.vo.SysRoleVO">
        <result column="id" property="id"/>
        <result column="user_name" property="name"/>
        <result column="nick_name" property="state"/>
        <result column="password" property="delFlag"/>
        <result column="avatar" property="remark"/>
        <collection property="menuList" ofType="com.mes.menu.SysMenu">
            <id column="id" property="id"/>
            <result column="parent_id" property="parentId"/>
            <result column="menu_mame" property="menuName"/>
            <result column="icon" property="icon"/>
            <result column="url" property="url"/>
            <result column="language_type" property="languageType"/>
            <result column="state" property="state"/>
            <result column="list_sort" property="listSort"/>
            <result column="create_time" property="createTime"/>
            <result column="perms" property="perms"/>
        </collection>
    </resultMap>
 
 
    <select id="roleList" resultMap="baseMap">
        SELECT t.*, t2.*
        FROM sys_role t
        LEFT JOIN sys_role_menu t1 ON t.id = t1.role_id
        LEFT JOIN sys_menu t2 ON t1.menu_id = t2.id
        WHERE 1=1
        <if test="key != null and key != ''">
            and t.name LIKE CONCAT('%', #{key}, '%')
        </if>
    </select>
</mapper>