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
52
53
54
55
56
| <?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.changhong.epc.admin.mapper.centen.menu.MenuMapper">
|
| <resultMap id="getMenuMap" type="com.changhong.epc.bean.admin.menu.Menu">
| <id column="rId" property="id"/>
| <result column="rText" property="text"/>
| <result column="rLink" property="link"/>
| <result column="rIcon" property="icon"/>
| <collection property="submenu" ofType="com.changhong.epc.bean.admin.menu.Menu">
| <id column="cId" property="id"/>
| <result column="cText" property="text"/>
| <result column="cLink" property="link"/>
| <result column="cIcon" property="icon"/>
| </collection>
| </resultMap>
|
| <select id="getMenu" resultMap="getMenuMap">
| select
| r.id rId,
| r.text rText,
| r.link rLink,
| r.icon rIcon,
| c.id cId,
| c.text cText,
| c.link cLink,
| c.icon cIcon
| from epc_menu r
| left join epc_menu c on r.link = c.p_link and c.data_start = 0 and c.tenant_id = {tenantId} and c.company_id = {companyId}
| where r.p_link is null
| and r.data_start = 0
| and r.tenant_id = {tenantId}
| and r.company_id = {companyId}
| order by r.sort, c.sort
| </select>
|
| <select id="getAdminMenu" resultMap="getMenuMap">
| select
| r.id rId,
| r.text rText,
| r.link rLink,
| r.icon rIcon,
| c.id cId,
| c.text cText,
| c.link cLink,
| c.icon cIcon
| from epc_menu r
| left join epc_menu c on r.link = c.p_link and c.data_start = 0 and c.tenant_id is null and c.company_id is null
| where r.p_link is null
| and r.data_start = 0
| and r.tenant_id is null
| and r.company_id is null
| order by r.sort, c.sort
| </select>
|
| </mapper>
|
|