<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`MEMO`, t1.`PROLEID`, t11.`SYS_ROLENAME` AS `PROLENAME`, t1.`SYS_ROLEID`, t1.`SYS_ROLENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `IBZROLE` t1 LEFT JOIN IBZROLE t11 ON t1.PROLEID = t11.SYS_ROLEID
WHERE T1.SYS_ROLEID NOT IN ( SELECT DISTINCT (DATA.SYS_ROLEID) FROM( SELECT @SYS_ROLEID AS _ID, ( SELECT @SYS_ROLEID := PROLEID FROM IBZROLE WHERE SYS_ROLEID = @SYS_ROLEID LIMIT 0,1 ) AS _PID, @L := @L+1 AS LEVEL FROM IBZROLE, (SELECT @SYS_ROLEID := ${srfdatacontext('','{\"defname\":\"SYS_ROLEID\",\"dename\":\"SYS_ROLE\"}')}, @L := 0 ) B ) ID, IBZROLE DATA WHERE ID._ID = DATA.SYS_ROLEID ORDER BY LEVEL)
WHERE T1.SYS_ROLEID NOT IN ( SELECT DISTINCT (DATA.SYS_ROLEID) FROM( SELECT @SYS_ROLEID AS _ID, ( SELECT @SYS_ROLEID := PROLEID FROM IBZROLE WHERE SYS_ROLEID = @SYS_ROLEID LIMIT 0,1 ) AS _PID, @L := @L+1 AS LEVEL FROM IBZROLE, (SELECT @SYS_ROLEID := #{srf.datacontext.sys_roleid}, @L := 0 ) B ) ID, IBZROLE DATA WHERE ID._ID = DATA.SYS_ROLEID ORDER BY LEVEL)