From e55c8b0a92eb9715edd90c31dfd4de51a47b588b Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期五, 04 十一月 2022 17:40:08 +0800
Subject: [PATCH] changes

---
 dao/src/main/resources/mapper/MenuMapper.xml |   74 ++++++++++++++++++++++++++++++------
 1 files changed, 61 insertions(+), 13 deletions(-)

diff --git a/dao/src/main/resources/mapper/MenuMapper.xml b/dao/src/main/resources/mapper/MenuMapper.xml
index 9c58432..f3d8cd1 100644
--- a/dao/src/main/resources/mapper/MenuMapper.xml
+++ b/dao/src/main/resources/mapper/MenuMapper.xml
@@ -5,19 +5,19 @@
 <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"/>
+        <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">
@@ -30,4 +30,52 @@
     <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>

--
Gitblit v1.9.3