| | |
| | | <!--标签查询,按父id查询下级--> |
| | | <select id="getLabelList" resultType="org.springblade.common.node.TreeIntegerNode"> |
| | | SELECT |
| | | jl.id as id,jl.parent_id as parentId,jl.label_name as name |
| | | jl.id as id,jl.parent_id as parentId,jl.label_name as name, |
| | | ( |
| | | SELECT |
| | | CASE WHEN count(1) > 0 THEN 1 ELSE 0 END |
| | | FROM |
| | | jczz_label |
| | | WHERE |
| | | parent_id = jl.id and is_deleted = 0 |
| | | ) AS hasChildren |
| | | FROM |
| | | jczz_label jl |
| | | where parent_id = #{label.parentId} |
| | | where is_deleted = 0 |
| | | and parent_id = #{label.parentId} |
| | | </select> |
| | | |
| | | <!--标签查询,按父id查询下级--> |
| | | <select id="getChildrenLabelList" resultType="org.springblade.common.node.TreeIntegerNode"> |
| | | SELECT |
| | | jl.id as id,jl.parent_id as parentId,jl.label_name as name, |
| | | ( |
| | | SELECT |
| | | CASE WHEN count(1) > 0 THEN 1 ELSE 0 END |
| | | FROM |
| | | jczz_label |
| | | WHERE |
| | | parent_id = jl.id and is_deleted = 0 |
| | | ) AS hasChildren |
| | | FROM |
| | | jczz_label jl |
| | | where is_deleted = 0 |
| | | and parent_id in |
| | | <foreach collection="list" separator="," item="id" open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | |