| | |
| | | </select> |
| | | |
| | | <!--标签查询,按父id查询下级--> |
| | | <select id="getLabelList" resultType="org.springblade.modules.label.vo.LabelVO"> |
| | | select * from jczz_label where is_deleted = 0 |
| | | and parent_id = #{label.parentId} |
| | | <select id="getLabelList" resultType="org.springblade.common.node.TreeIntegerNode"> |
| | | SELECT |
| | | jl.id as id,jl.parent_id as parentId,jl.label_name as name |
| | | FROM |
| | | ( |
| | | SELECT |
| | | @ids AS ids, |
| | | ( SELECT @ids := GROUP_CONCAT( id ) FROM jczz_label WHERE FIND_IN_SET( parent_id, @ids ) ) AS cids |
| | | FROM |
| | | jczz_label |
| | | WHERE |
| | | @ids IS NOT NULL |
| | | AND @ids := #{label.parentId} |
| | | ) id, |
| | | jczz_label jl |
| | | WHERE |
| | | FIND_IN_SET(jl.parent_id,ids) |
| | | </select> |
| | | |
| | | |