From 1964314fc149ff51c89bc82cbb27fd4ee754b7e3 Mon Sep 17 00:00:00 2001
From: 郑永安 <zyazyz250@sina.com>
Date: 星期二, 18 七月 2023 15:01:43 +0800
Subject: [PATCH] 要素树

---
 src/main/java/com/gk/hotwork/Mapper/mybatis/ElementManagementMapper.xml |   11 ++++++++++-
 1 files changed, 10 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..a97d635 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,14 @@
   <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>
+
 
 </mapper>

--
Gitblit v1.9.2