|
@@ -113,15 +113,17 @@
|
|
|
<select id="selectDescendants"
|
|
|
resultMap="TreeNodeMap">
|
|
|
WITH RECURSIVE SubPath AS (
|
|
|
- SELECT descendant, desc_name, depth
|
|
|
- FROM distri_share_path
|
|
|
- WHERE ancestor = #{ancestor}
|
|
|
- UNION ALL
|
|
|
- SELECT d.descendant, d.desc_name, d.depth
|
|
|
- FROM distri_share_path d
|
|
|
- INNER JOIN SubPath sp ON sp.descendant = d.ancestor
|
|
|
+ SELECT descendant, desc_name, depth
|
|
|
+ FROM distri_share_path
|
|
|
+ WHERE ancestor = #{ancestor} AND depth <![CDATA[>=]]> #{minDepth}
|
|
|
+ UNION ALL
|
|
|
+ SELECT d.descendant, d.desc_name, d.depth
|
|
|
+ FROM distri_share_path d
|
|
|
+ INNER JOIN SubPath sp ON sp.descendant = d.ancestor
|
|
|
+ WHERE d.depth <![CDATA[<=]]> #{maxDepth}
|
|
|
)
|
|
|
SELECT * FROM SubPath
|
|
|
+ WHERE depth <![CDATA[<=]]> #{maxDepth};
|
|
|
|
|
|
</select>
|
|
|
</mapper>
|