2021与蓝度共同重构项目,服务端
liuhaonan
2022-10-26 c7be2ef037c5aebb0cd8f1f33e5fa934389e6083
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?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.sandu.ximon.dao.mapper.MenuMapper">
 
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.Menu">
        <id property="id" column="id" jdbcType="BIGINT"/>
        <result property="title" column="title" jdbcType="VARCHAR"/>
        <result property="pid" column="pid" jdbcType="BIGINT"/>
        <result property="seq" column="seq" jdbcType="INTEGER"/>
        <result property="icon" column="icon" jdbcType="VARCHAR"/>
        <result property="path" column="path" jdbcType="VARCHAR"/>
        <result property="hidden" column="hidden" jdbcType="BOOLEAN"/>
        <result property="component" column="component" jdbcType="VARCHAR"/>
        <result property="routerName" column="router_name" jdbcType="VARCHAR"/>
        <result property="permission" column="permission" jdbcType="VARCHAR"/>
        <result property="type" column="type" jdbcType="INTEGER"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
    </resultMap>
 
    <sql id="Base_Column_List">
        id,title,pid,
        seq,icon,path,
        hidden,component,router_name,
        permission,type,create_time,
        update_time
    </sql>
    <select id="listMenu" resultType="java.lang.Long">
        SELECT id FROM menu
    </select>
 
    <select id="listMenuIfBinding" resultType="java.lang.Long">
        SELECT t1.id
        FROM menu t1
        LEFT JOIN role_menu_relation t2 ON t1.id = t2.menu_id
        <where>
            t2.menu_id = #{id}
        </where>
    </select>
    <select id="listMenuIfBinding1" resultType="java.lang.Long" parameterType="java.lang.Long">
        SELECT t1.id
        FROM menu t1
        <where>
            t1.pid = #{id}
        </where>
 
    </select>
 
    <select id="listMenuById" resultType="com.sandu.ximon.dao.domain.Menu">
        SELECT
        *
        FROM
        menu t1
        <where>
            t1.id IN
            <foreach collection="menuIdList" open="(" close=")" item="id" separator=",">
                #{id}
            </foreach>
        </where>
        ORDER BY t1.seq ASC
 
    </select>
 
    <select id="getUserPermissionListById" resultType="com.sandu.ximon.dao.domain.Menu">
        SELECT
        *
        FROM
        menu t1
        <where>
            <if test="menuIds != null">
                t1.id IN
                <foreach collection="menuIds" open="(" close=")" item="id" separator=",">
                    #{id}
                </foreach>
            </if>
        </where>
        ORDER BY t1.seq ASC
    </select>
</mapper>