houzhongjian
2024-07-23 a6de490948278991e47952e90671ddba4555e9a2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
<mapper namespace="com.iailab.module.knowledge.dao.KnowledgePathDao">
 
    <!-- 查询所有树形图节点 -->
    <select id="selectPathList" resultType="com.iailab.module.knowledge.dto.KnowledgePathDTO">
        select *
        from (
                 select t1.id,
                        t1.id as value,
                        t1.label,
                        t1.parent_id
                 from t_knowledge_path t1
                          inner join t_knowledge_path t2 on
                     t1.parent_id = t2.id
                 union
                 select id,
                        id as value,
                        label,
                        parent_id
                 from t_knowledge_path
                 where parent_id = '0000000000'
             ) t
        order by parent_id asc,
                 id asc
    </select>
 
</mapper>