kimi
2020-05-27 2893347bf72477c4d108e8589a0f61e3e97a990c
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.highdatas.mdm.mapper.MenuMappingMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.highdatas.mdm.entity.MenuMapping">
        <id column="id" property="id" />
        <result column="code" property="code" />
        <result column="name" property="name" />
        <result column="chargeid" property="chargeid" />
        <result column="systemid" property="systemid" />
        <result column="menuid" property="menuid" />
        <result column="datatype" property="datatype" />
        <result column="tablename" property="tablename" />
        <result column="starttime" property="starttime" />
        <result column="endtime" property="endtime" />
        <result column="createtime" property="createtime" />
        <result column="updatetime" property="updatetime" />
    </resultMap>
 
    <select id="getMapping" resultType="java.util.Map">
        SELECT
        m.id,m.code, m.name, system_id as systemId, m.audit as audit, m.desc,
 
        c2.name as cname1, c2.id as cid1, c1.name as cname2, c1.id as cid2, c.name as cname3, c.id as cid3,
        start_time as startTime, end_time as endTime, m.create_time as createTime, m.update_time as updateTime,
        table_name as tableName, sm.name as theme, m.theme_id as themeId, m.charge_id as chargeId
        FROM `menu_mapping` m
        LEFT JOIN sys_datacategory c on c.id = m.data_type
        LEFT JOIN sys_datacategory c1 on c1.id = c.parent_id
        LEFT JOIN sys_datacategory c2 on c2.id = c1.parent_id
        LEFT JOIN sys_menu sm on sm.id = m.theme_id
        where m.menu_id = #{id}
    </select>
 
</mapper>