SELECT PARENT_ORG_ID, ORG_ID,ORG_ENAME,ORG_CNAME,ORG_TYPE FROM ${platSchema}.TXSOG01 WHERE FIND_IN_SET(ORG_ID,${platSchema}.getChildrenOrg(#orgId#)) AND IS_DELETED = '0';
WITH report(PARENT_ORG_ID, ORG_ID,ORG_ENAME,ORG_CNAME) AS (
WITH report(PARENT_ORG_ID, ORG_ID,ORG_ENAME,ORG_CNAME, ORG_TYPE) AS (
SELECT PARENT_ORG_ID, ORG_ID,ORG_ENAME,ORG_CNAME FROM ${platSchema}.TXSOG01 WHERE ORG_ID = #orgId# and is_deleted = '0'
SELECT PARENT_ORG_ID, ORG_ID,ORG_ENAME,ORG_CNAME,ORG_TYPE FROM ${platSchema}.TXSOG01
WHERE ORG_ID = #orgId# and is_deleted = '0'
UNION ALL
UNION ALL
SELECT b.PARENT_ORG_ID, b.ORG_ID,b.ORG_ENAME,b.ORG_CNAME FROM report a, ${platSchema}.TXSOG01 b WHERE b.PARENT_ORG_ID = a.ORG_ID and b.is_deleted = '0'
SELECT b.PARENT_ORG_ID, b.ORG_ID,b.ORG_ENAME,b.ORG_CNAME,b.ORG_TYPE FROM report a, ${platSchema}.TXSOG01 b
WHERE b.PARENT_ORG_ID = a.ORG_ID and b.is_deleted = '0'