From 5bacbb17debde58d6ff2581e4a03a866ca009c02 Mon Sep 17 00:00:00 2001
From: lizijie <lzjiiie@163.com>
Date: Mon, 31 May 2021 15:33:05 +0800
Subject: [PATCH] 菜单接口合并,查询父菜单列表

---
 screen-manage/src/main/resources/mapper/ManageMenuMapper.xml |   72 +++++++++++++++++++++++++++++++++--
 1 files changed, 67 insertions(+), 5 deletions(-)

diff --git a/screen-manage/src/main/resources/mapper/ManageMenuMapper.xml b/screen-manage/src/main/resources/mapper/ManageMenuMapper.xml
index 1d85053..fecfa44 100644
--- a/screen-manage/src/main/resources/mapper/ManageMenuMapper.xml
+++ b/screen-manage/src/main/resources/mapper/ManageMenuMapper.xml
@@ -13,11 +13,12 @@
         <result column="create_time" property="createTime"/>
         <result column="update_time" property="updateTime"/>
         <result column="is_delete" property="isDelete"/>
+        <result column="desc" property="desc"/>
     </resultMap>
 
 
     <sql id="Base_Column_List">
-        mm.id,mm.name,mm.url,mm.icon,mm.parent_id,mm.order,mm.create_time,mm.update_time,mm.is_delete
+        mm.id,mm.name,mm.url,mm.icon,mm.parent_id,mm.order,mm.create_time,mm.update_time,mm.is_delete,mm.desc
     </sql>
 
 
@@ -31,7 +32,7 @@
         join
         manage_role_menu mrm
         on
-        mm.`id` = mrm.`menu_id` and mm.`is_delete`=0
+        mm.`id` = mrm.`menu_id` and mrm.`is_delete`=0
         join
         manage_role mr
         on
@@ -67,11 +68,14 @@
             <if test="icon != null">
                 icon,
             </if>
-            <if test="parent_id != null">
+            <if test="parentId != null">
                 parent_id,
             </if>
             <if test="order != null">
                 `order`,
+            </if>
+            <if test="desc != null">
+                `desc`,
             </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -84,11 +88,14 @@
             <if test="icon != null">
                 #{icon},
             </if>
-            <if test="parent_id != null">
-                #{parent_id},
+            <if test="parentId != null">
+                #{parentId},
             </if>
             <if test="order != null">
                 #{order},
+            </if>
+            <if test="desc != null">
+                #{desc},
             </if>
         </trim>
     </insert>
@@ -113,6 +120,9 @@
             </if>
             <if test="is_delete != null">
                 is_delete = #{is_delete},
+            </if>
+            <if test="desc != null">
+                `desc` = #{desc},
             </if>
         </set>
         where id = #{id}
@@ -154,4 +164,56 @@
         WHERE mm.is_delete = 0
     </select>
 
+    <select id="getManageMenuByCondition" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"></include>
+        from manage_menu mm
+        where mm.is_delete = 0
+        <if test="name != null">
+            and mm.name = #{name}
+        </if>
+        <if test="url != null">
+            and mm.url = #{url}
+        </if>
+        <if test="icon != null">
+            and mm.icon = #{icon}
+        </if>
+        <if test="parent_id != null">
+            and mm.parent_id = #{parent_id}
+        </if>
+        <if test="order != null">
+            and mm.order = #{order}
+        </if>
+        <if test="desc != null">
+            and mm.desc = #{order}
+        </if>
+        limit #{start},#{number}
+    </select>
+
+    <select id="getManageMenuByNameFuzzy" parameterType="java.util.Map" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"></include>
+        from manage_menu mm
+        where mm.is_delete = 0
+        <if test="name != null">
+            and mm.name like concat('%',#{name},'%')
+        </if>
+        <if test="url != null">
+            and mm.url = #{url}
+        </if>
+        <if test="icon != null">
+            and mm.icon = #{icon}
+        </if>
+        <if test="parent_id != null">
+            and mm.parent_id = #{parent_id}
+        </if>
+        <if test="order != null">
+            and mm.order = #{order}
+        </if>
+        <if test="desc != null">
+            and mm.desc = #{order}
+        </if>
+        limit #{start},#{number}
+    </select>
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0