作者:欧欧 来源:风者信息科技 发布时间:2022-07-01
BEGIN DECLARE sTemp VARCHAR(50000); DECLARE sTempChd VARCHAR(1000); SET sTemp = ''; SET sTempChd =typeid; WHILE sTempChd is not null DO if sTemp <> '' THEN SET sTemp = concat(sTemp,',',sTempChd); else SET sTemp = sTempChd; end if; SELECT group_concat(id) INTO sTempChd FROM qiye_user_type where FIND_IN_SET(parentid,sTempChd)>0; END WHILE; return concat(',',sTemp,','); END