+"CASE WHEN am.STANDARD_ACCOUNT_CODE='0000' THEN am.STANDARD_ACCOUNT_CODE ELSE sa.Code END StdCode,"
+"CASE WHEN am.STANDARD_ACCOUNT_CODE='0000' THEN am.STANDARD_ACCOUNT_CODE ELSE sa.Code END StdCode,"
+"sa.Name StdName,sa.PARENT_CODE StdParentCode "
+"sa.Name Name,sa.PARENT_CODE StdParentCode "
+"FROM (SELECT * FROM ENTERPRISE_ACCOUNT where PARENT_CODE=#{parentCode} and ENTERPRISE_ACCOUNT_SET_ID=#{accountSetId}) ea "
+"FROM (SELECT * FROM ENTERPRISE_ACCOUNT where PARENT_CODE=#{parentCode} and ENTERPRISE_ACCOUNT_SET_ID=#{accountSetId}) ea "
+"LEFT JOIN (SELECT * FROM ACCOUNT_MAPPING WHERE ORGANIZATION_ID=#{orgId} AND INDUSTRY_ID=#{industryId} AND ENTERPRISE_ACCOUNT_SET_ID=#{accountSetId}) am ON ea.Code=am.ENTERPRISE_ACCOUNT_CODE "
+"LEFT JOIN (SELECT * FROM ACCOUNT_MAPPING WHERE ORGANIZATION_ID=#{orgId} AND INDUSTRY_ID=#{industryId} AND ENTERPRISE_ACCOUNT_SET_ID=#{accountSetId}) am ON ea.Code=am.ENTERPRISE_ACCOUNT_CODE "
+"LEFT JOIN (SELECT * FROM StandardAccount WHERE IndustryID=#{industryId}) sa ON am.STANDARD_ACCOUNT_CODE=sa.Code "
+"LEFT JOIN (SELECT * FROM STANDARD_ACCOUNT WHERE INDUSTRY_ID=#{industryId}) sa ON am.STANDARD_ACCOUNT_CODE=sa.Code "