表结构是这样的
通过 0,1,2,3查询出相对应得名称
SELECT
GROUP_CONCAT(t1.`name` ORDER BY t1.type)
FROM
(
SELECT
b.`name`,
b.type,
'03826d9158c542cc9578042cdfd58a7b' AS iid
FROM
jx_resource_classification a
LEFT JOIN jx_resource_model b ON a.model_id = b.id
WHERE
a.id IN (
SELECT
c.id
FROM
jx_resource_classification b
LEFT JOIN jx_resource_classification c ON concat(',', b.up_id, ',') LIKE concat('%,', c.id, ',%')
WHERE
b.id = '03826d9158c542cc9578042cdfd58a7b'
)
) t1
GROUP BY
t1.iid;