郑永安
2023-07-18 1964314fc149ff51c89bc82cbb27fd4ee754b7e3
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>