|
|
@@ -26,13 +26,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="selectAllChildListById" parameterType="String" resultType="java.lang.String"> |
|
|
|
SELECT id |
|
|
|
FROM( |
|
|
|
SELECT @ids AS p_ids, (SELECT @ids := GROUP_CONCAT(id) FROM th_dept WHERE FIND_IN_SET(pid, CONVERT(@ids USING utf8) COLLATE utf8_unicode_ci)) AS c_ids, @l := @l+1 AS LEVEL |
|
|
|
FROM th_dept, (SELECT @ids := #{id}, @l := 0 ) b |
|
|
|
WHERE @ids IS NOT NULL |
|
|
|
select id |
|
|
|
from ( |
|
|
|
select @ids AS p_ids, (select @ids := group_concat(id) from th_dept where find_in_set(pid, convert(@ids using utf8) collate utf8_unicode_ci)) AS c_ids, @l := @l+1 AS level |
|
|
|
from th_dept, (select @ids := #{id}, @l := 0 ) b |
|
|
|
having @ids is not null |
|
|
|
) u1 |
|
|
|
JOIN th_dept u2 ON FIND_IN_SET(u2.id, CONVERT(u1.p_ids USING utf8) COLLATE utf8_unicode_ci) |
|
|
|
join th_dept u2 on find_in_set(u2.id, convert(u1.p_ids using utf8) collate utf8_unicode_ci) |
|
|
|
</select> |
|
|
|
|
|
|
|
<update id="update" parameterType="com.tuoheng.admin.entity.Dept"> |