SELECT DISTINCT t2.fpath
FROM tfolderauth t1
         LEFT JOIN tfolder t2 ON t1.tfolderid = t2.tfolderid
WHERE frole IN $frole$
   OR fauthtype IN $fauthtype$
   OR tuserid = $tuserid$
   OR tdepartmentid =( SELECT tdepartmentid FROM tdepartment WHERE wechat_depid = ( SELECT wechat_parendeptid FROM tdepartment WHERE wechat_depid = ( SELECT wechat_depid FROM tuser WHERE tuserid = $tuserid$)))