From 20b3440967afcc4a6b9ddc00cb15f0612ff15342 Mon Sep 17 00:00:00 2001
From: 郑永安 <zyazyz250@sina.com>
Date: 星期一, 24 七月 2023 09:35:07 +0800
Subject: [PATCH] dev

---
 src/main/java/com/gk/hotwork/Mapper/mybatis/ElementManagementMapper.xml |   49 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 48 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/ElementManagementMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/ElementManagementMapper.xml
index 455f46c..7b16e76 100644
--- a/src/main/java/com/gk/hotwork/Mapper/mybatis/ElementManagementMapper.xml
+++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/ElementManagementMapper.xml
@@ -17,7 +17,7 @@
     <result column="remark" property="remark" jdbcType="VARCHAR" />
     <result column="point" property="point" jdbcType="VARCHAR" />
     <result column="weight" property="weight" />
-
+    <result column="menu_type" property="menuType" jdbcType="VARCHAR"/>
   </resultMap>
   <select id="selectPages" resultMap="BaseResultMap">
     select a.*,
@@ -37,5 +37,52 @@
   <select id="getElementByType" resultMap="BaseResultMap">
     select *  from element_management where valid_flag = 1 and type = #{type}
   </select>
+  
+  
+ <!-- <select id="getElementTree" resultType="java.util.Map">
+  	select DISTINCT t.label,t.mt,t.type,t.pid,t.value,(case when (t.keyw is null and t.type>0) then  1 else  0 end ) as isLeaf from(
+	select t1.mt,t1.label,t1.type,t1.value,t1.pid,t2.label as keyw
+	from (select name as label,menu_type as mt,type,id as value,parent_id as pid from element_management WHERE valid_flag=1) t1  left join (select name as label,type,id as value,	  parent_id as pid from element_management WHERE valid_flag=1) t2
+	on t1.value=t2.pid) t
+  </select>-->
+  <select id="getElementTree" resultType="java.util.Map">
+    SELECT DISTINCT
+      t.label,
+      t.mt,
+      t.type,
+      t.pid,
+      t.point,
+      t.value,
+      (CASE
+
+         WHEN ( t.keyw IS NULL AND t.type > 0 ) THEN
+           1 ELSE 0
+        END ) AS isLeaf
+    FROM
+      (
+        SELECT
+          t1.mt,
+          t1.label,
+          t1.type,
+          t1.value,
+          t1.pid,
+          t1.point,
+          t2.label AS keyw
+        FROM
+          ( SELECT
+              name AS label,
+              menu_type AS mt,
+              type,
+              id AS value,
+			  parent_id AS pid,
+			  point
+            FROM
+              element_management
+            WHERE
+              valid_flag = 1
+          ) t1
+            LEFT JOIN ( SELECT name AS label, type, id AS value, parent_id AS pid FROM element_management WHERE valid_flag = 1 ) t2 ON t1.value= t2.pid
+      ) t
+  </select>
 
 </mapper>

--
Gitblit v1.9.2