<where><iftest="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<iftest="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sqlid="Default"databaseId="postgresql">
<![CDATA[ SELECT t1.ACCOUNT_BANK_RECONCILIATION_START, t1.ACCOUNT_DASHBOARD_ONBOARDING_STATE, t1.ACCOUNT_INVOICE_ONBOARDING_STATE, t1.ACCOUNT_NO, t1.ACCOUNT_ONBOARDING_INVOICE_LAYOUT_STATE, t1.ACCOUNT_ONBOARDING_SALE_TAX_STATE, t1.ACCOUNT_ONBOARDING_SAMPLE_INVOICE_STATE, t61.DATE AS ACCOUNT_OPENING_DATE, t61.JOURNAL_ID AS ACCOUNT_OPENING_JOURNAL_ID, t1.ACCOUNT_OPENING_MOVE_ID, t61.NAME AS ACCOUNT_OPENING_MOVE_ID_TEXT, t1.ACCOUNT_PURCHASE_TAX_ID, t41.NAME AS ACCOUNT_PURCHASE_TAX_ID_TEXT, t1.ACCOUNT_SALE_TAX_ID, t121.NAME AS ACCOUNT_SALE_TAX_ID_TEXT, t1.ACCOUNT_SETUP_BANK_DATA_STATE, t1.ACCOUNT_SETUP_COA_STATE, t1.ACCOUNT_SETUP_FY_DATA_STATE, t1.ANGLO_SAXON_ACCOUNTING, t1.BANK_ACCOUNT_CODE_PREFIX, t1.BASE_ONBOARDING_COMPANY_STATE, t1.CASH_ACCOUNT_CODE_PREFIX, t1.CHART_TEMPLATE_ID, t111.NAME AS CHART_TEMPLATE_ID_TEXT, t1.COMPANY_REGISTRY, t1.CREATE_DATE, t1.CREATE_UID, t141.NAME AS CREATE_UID_TEXT, t1.CURRENCY_EXCHANGE_JOURNAL_ID, t11.NAME AS CURRENCY_EXCHANGE_JOURNAL_ID_TEXT, t1.CURRENCY_ID, t81.NAME AS CURRENCY_ID_TEXT, t21.EMAIL, t1.EXPECTS_CHART_OF_ACCOUNTS, t11.DEFAULT_DEBIT_ACCOUNT_ID AS EXPENSE_CURRENCY_EXCHANGE_ACCOUNT_ID, t1.EXTERNAL_REPORT_LAYOUT_ID, t1.FISCALYEAR_LAST_DAY, t1.FISCALYEAR_LAST_MONTH, t1.FISCALYEAR_LOCK_DATE, t1.ID, t11.DEFAULT_CREDIT_ACCOUNT_ID AS INCOME_CURRENCY_EXCHANGE_ACCOUNT_ID, t1.INCOTERM_ID, t51.NAME AS INCOTERM_ID_TEXT, t1.INTERNAL_TRANSIT_LOCATION_ID, t201.NAME AS INTERNAL_TRANSIT_LOCATION_ID_TEXT, t1.INVOICE_IS_EMAIL, t1.INVOICE_IS_PRINT, t1.INVOICE_IS_SNAILMAIL, t1.MANUFACTURING_LEAD, t21.NAME, t1.NOMENCLATURE_ID, t1.PAPERFORMAT_ID, t1.PARENT_ID, t181.NAME AS PARENT_ID_TEXT, t21.PARTNER_GID, t1.PARTNER_ID, t1.PAYMENT_ACQUIRER_ONBOARDING_STATE, t1.PAYMENT_ONBOARDING_PAYMENT_METHOD, t1.PERIOD_LOCK_DATE, t21.PHONE, t1.PORTAL_CONFIRMATION_PAY, t1.PORTAL_CONFIRMATION_SIGN, t1.PO_DOUBLE_VALIDATION, t1.PO_DOUBLE_VALIDATION_AMOUNT, t1.PO_LEAD, t1.PO_LOCK, t1.PROPERTY_STOCK_ACCOUNT_INPUT_CATEG_ID, t31.NAME AS PROPERTY_STOCK_ACCOUNT_INPUT_CATEG_ID_TEXT, t1.PROPERTY_STOCK_ACCOUNT_OUTPUT_CATEG_ID, t151.NAME AS PROPERTY_STOCK_ACCOUNT_OUTPUT_CATEG_ID_TEXT, t1.PROPERTY_STOCK_VALUATION_ACCOUNT_ID, t161.NAME AS PROPERTY_STOCK_VALUATION_ACCOUNT_ID_TEXT, t1.QR_CODE, t1.QUOTATION_VALIDITY_DAYS, t1.RESOURCE_CALENDAR_ID, t211.NAME AS RESOURCE_CALENDAR_ID_TEXT, t1.SALE_ONBOARDING_ORDER_CONFIRMATION_STATE, t1.SALE_ONBOARDING_PAYMENT_METHOD, t1.SALE_ONBOARDING_SAMPLE_QUOTATION_STATE, t1.SALE_QUOTATION_ONBOARDING_STATE, t1.SECURITY_LEAD, t1.SEQUENCE, t1.SNAILMAIL_COLOR, t1.SNAILMAIL_DUPLEX, t1.SOCIAL_FACEBOOK, t1.SOCIAL_GITHUB, t1.SOCIAL_INSTAGRAM, t1.SOCIAL_LINKEDIN, t1.SOCIAL_TWITTER, t1.SOCIAL_YOUTUBE, t1.TAX_CALCULATION_ROUNDING_METHOD, t1.TAX_CASH_BASIS_JOURNAL_ID, t191.NAME AS TAX_CASH_BASIS_JOURNAL_ID_TEXT, t1.TAX_EXIGIBILITY, t1.TRANSFER_ACCOUNT_CODE_PREFIX, t1.TRANSFER_ACCOUNT_ID, t71.NAME AS TRANSFER_ACCOUNT_ID_TEXT, t21.VAT, t21.WEBSITE, t1.WEBSITE_SALE_ONBOARDING_PAYMENT_ACQUIRER_STATE, t1.WRITE_DATE, t1.WRITE_UID, t101.NAME AS WRITE_UID_TEXT FROM RES_COMPANY t1 LEFT JOIN ACCOUNT_JOURNAL t11 ON t1.CURRENCY_EXCHANGE_JOURNAL_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t1.PARTNER_ID = t21.ID LEFT JOIN ACCOUNT_ACCOUNT t31 ON t1.PROPERTY_STOCK_ACCOUNT_INPUT_CATEG_ID = t31.ID LEFT JOIN ACCOUNT_TAX t41 ON t1.ACCOUNT_PURCHASE_TAX_ID = t41.ID LEFT JOIN ACCOUNT_INCOTERMS t51 ON t1.INCOTERM_ID = t51.ID LEFT JOIN ACCOUNT_MOVE t61 ON t1.ACCOUNT_OPENING_MOVE_ID = t61.ID LEFT JOIN ACCOUNT_ACCOUNT t71 ON t1.TRANSFER_ACCOUNT_ID = t71.ID LEFT JOIN RES_CURRENCY t81 ON t1.CURRENCY_ID = t81.ID LEFT JOIN RES_USERS t91 ON t1.WRITE_UID = t91.ID LEFT JOIN RES_PARTNER t101 ON t91.PARTNER_ID = t101.ID LEFT JOIN ACCOUNT_CHART_TEMPLATE t111 ON t1.CHART_TEMPLATE_ID = t111.ID LEFT JOIN ACCOUNT_TAX t121 ON t1.ACCOUNT_SALE_TAX_ID = t121.ID LEFT JOIN RES_USERS t131 ON t1.CREATE_UID = t131.ID LEFT JOIN RES_PARTNER t141 ON t131.PARTNER_ID = t141.ID LEFT JOIN ACCOUNT_ACCOUNT t151 ON t1.PROPERTY_STOCK_ACCOUNT_OUTPUT_CATEG_ID = t151.ID LEFT JOIN ACCOUNT_ACCOUNT t161 ON t1.PROPERTY_STOCK_VALUATION_ACCOUNT_ID = t161.ID LEFT JOIN RES_COMPANY t171 ON t1.PARENT_ID = t171.ID LEFT JOIN RES_PARTNER t181 ON t171.PARTNER_ID = t181.ID LEFT JOIN ACCOUNT_JOURNAL t191 ON t1.TAX_CASH_BASIS_JOURNAL_ID = t191.ID LEFT JOIN STOCK_LOCATION t201 ON t1.INTERNAL_TRANSIT_LOCATION_ID = t201.ID LEFT JOIN RESOURCE_CALENDAR t211 ON t1.RESOURCE_CALENDAR_ID = t211.ID
]]>
</sql>
<!--数据查询[ROOT]-->
<sqlid="ROOT"databaseId="postgresql">
<![CDATA[ SELECT t1.ACCOUNT_BANK_RECONCILIATION_START, t1.ACCOUNT_DASHBOARD_ONBOARDING_STATE, t1.ACCOUNT_INVOICE_ONBOARDING_STATE, t1.ACCOUNT_NO, t1.ACCOUNT_ONBOARDING_INVOICE_LAYOUT_STATE, t1.ACCOUNT_ONBOARDING_SALE_TAX_STATE, t1.ACCOUNT_ONBOARDING_SAMPLE_INVOICE_STATE, t61.DATE AS ACCOUNT_OPENING_DATE, t61.JOURNAL_ID AS ACCOUNT_OPENING_JOURNAL_ID, t1.ACCOUNT_OPENING_MOVE_ID, t61.NAME AS ACCOUNT_OPENING_MOVE_ID_TEXT, t1.ACCOUNT_PURCHASE_TAX_ID, t41.NAME AS ACCOUNT_PURCHASE_TAX_ID_TEXT, t1.ACCOUNT_SALE_TAX_ID, t121.NAME AS ACCOUNT_SALE_TAX_ID_TEXT, t1.ACCOUNT_SETUP_BANK_DATA_STATE, t1.ACCOUNT_SETUP_COA_STATE, t1.ACCOUNT_SETUP_FY_DATA_STATE, t1.ANGLO_SAXON_ACCOUNTING, t1.BANK_ACCOUNT_CODE_PREFIX, t1.BASE_ONBOARDING_COMPANY_STATE, t1.CASH_ACCOUNT_CODE_PREFIX, t1.CHART_TEMPLATE_ID, t111.NAME AS CHART_TEMPLATE_ID_TEXT, t1.COMPANY_REGISTRY, t1.CREATE_DATE, t1.CREATE_UID, t141.NAME AS CREATE_UID_TEXT, t1.CURRENCY_EXCHANGE_JOURNAL_ID, t11.NAME AS CURRENCY_EXCHANGE_JOURNAL_ID_TEXT, t1.CURRENCY_ID, t81.NAME AS CURRENCY_ID_TEXT, t21.EMAIL, t1.EXPECTS_CHART_OF_ACCOUNTS, t11.DEFAULT_DEBIT_ACCOUNT_ID AS EXPENSE_CURRENCY_EXCHANGE_ACCOUNT_ID, t1.EXTERNAL_REPORT_LAYOUT_ID, t1.FISCALYEAR_LAST_DAY, t1.FISCALYEAR_LAST_MONTH, t1.FISCALYEAR_LOCK_DATE, t1.ID, t11.DEFAULT_CREDIT_ACCOUNT_ID AS INCOME_CURRENCY_EXCHANGE_ACCOUNT_ID, t1.INCOTERM_ID, t51.NAME AS INCOTERM_ID_TEXT, t1.INTERNAL_TRANSIT_LOCATION_ID, t201.NAME AS INTERNAL_TRANSIT_LOCATION_ID_TEXT, t1.INVOICE_IS_EMAIL, t1.INVOICE_IS_PRINT, t1.INVOICE_IS_SNAILMAIL, t1.MANUFACTURING_LEAD, t21.NAME, t1.NOMENCLATURE_ID, t1.PAPERFORMAT_ID, t1.PARENT_ID, t181.NAME AS PARENT_ID_TEXT, t21.PARTNER_GID, t1.PARTNER_ID, t1.PAYMENT_ACQUIRER_ONBOARDING_STATE, t1.PAYMENT_ONBOARDING_PAYMENT_METHOD, t1.PERIOD_LOCK_DATE, t21.PHONE, t1.PORTAL_CONFIRMATION_PAY, t1.PORTAL_CONFIRMATION_SIGN, t1.PO_DOUBLE_VALIDATION, t1.PO_DOUBLE_VALIDATION_AMOUNT, t1.PO_LEAD, t1.PO_LOCK, t1.PROPERTY_STOCK_ACCOUNT_INPUT_CATEG_ID, t31.NAME AS PROPERTY_STOCK_ACCOUNT_INPUT_CATEG_ID_TEXT, t1.PROPERTY_STOCK_ACCOUNT_OUTPUT_CATEG_ID, t151.NAME AS PROPERTY_STOCK_ACCOUNT_OUTPUT_CATEG_ID_TEXT, t1.PROPERTY_STOCK_VALUATION_ACCOUNT_ID, t161.NAME AS PROPERTY_STOCK_VALUATION_ACCOUNT_ID_TEXT, t1.QR_CODE, t1.QUOTATION_VALIDITY_DAYS, t1.RESOURCE_CALENDAR_ID, t211.NAME AS RESOURCE_CALENDAR_ID_TEXT, t1.SALE_ONBOARDING_ORDER_CONFIRMATION_STATE, t1.SALE_ONBOARDING_PAYMENT_METHOD, t1.SALE_ONBOARDING_SAMPLE_QUOTATION_STATE, t1.SALE_QUOTATION_ONBOARDING_STATE, t1.SECURITY_LEAD, t1.SEQUENCE, t1.SNAILMAIL_COLOR, t1.SNAILMAIL_DUPLEX, t1.SOCIAL_FACEBOOK, t1.SOCIAL_GITHUB, t1.SOCIAL_INSTAGRAM, t1.SOCIAL_LINKEDIN, t1.SOCIAL_TWITTER, t1.SOCIAL_YOUTUBE, t1.TAX_CALCULATION_ROUNDING_METHOD, t1.TAX_CASH_BASIS_JOURNAL_ID, t191.NAME AS TAX_CASH_BASIS_JOURNAL_ID_TEXT, t1.TAX_EXIGIBILITY, t1.TRANSFER_ACCOUNT_CODE_PREFIX, t1.TRANSFER_ACCOUNT_ID, t71.NAME AS TRANSFER_ACCOUNT_ID_TEXT, t21.VAT, t21.WEBSITE, t1.WEBSITE_SALE_ONBOARDING_PAYMENT_ACQUIRER_STATE, t1.WRITE_DATE, t1.WRITE_UID, t101.NAME AS WRITE_UID_TEXT FROM RES_COMPANY t1 LEFT JOIN ACCOUNT_JOURNAL t11 ON t1.CURRENCY_EXCHANGE_JOURNAL_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t1.PARTNER_ID = t21.ID LEFT JOIN ACCOUNT_ACCOUNT t31 ON t1.PROPERTY_STOCK_ACCOUNT_INPUT_CATEG_ID = t31.ID LEFT JOIN ACCOUNT_TAX t41 ON t1.ACCOUNT_PURCHASE_TAX_ID = t41.ID LEFT JOIN ACCOUNT_INCOTERMS t51 ON t1.INCOTERM_ID = t51.ID LEFT JOIN ACCOUNT_MOVE t61 ON t1.ACCOUNT_OPENING_MOVE_ID = t61.ID LEFT JOIN ACCOUNT_ACCOUNT t71 ON t1.TRANSFER_ACCOUNT_ID = t71.ID LEFT JOIN RES_CURRENCY t81 ON t1.CURRENCY_ID = t81.ID LEFT JOIN RES_USERS t91 ON t1.WRITE_UID = t91.ID LEFT JOIN RES_PARTNER t101 ON t91.PARTNER_ID = t101.ID LEFT JOIN ACCOUNT_CHART_TEMPLATE t111 ON t1.CHART_TEMPLATE_ID = t111.ID LEFT JOIN ACCOUNT_TAX t121 ON t1.ACCOUNT_SALE_TAX_ID = t121.ID LEFT JOIN RES_USERS t131 ON t1.CREATE_UID = t131.ID LEFT JOIN RES_PARTNER t141 ON t131.PARTNER_ID = t141.ID LEFT JOIN ACCOUNT_ACCOUNT t151 ON t1.PROPERTY_STOCK_ACCOUNT_OUTPUT_CATEG_ID = t151.ID LEFT JOIN ACCOUNT_ACCOUNT t161 ON t1.PROPERTY_STOCK_VALUATION_ACCOUNT_ID = t161.ID LEFT JOIN RES_COMPANY t171 ON t1.PARENT_ID = t171.ID LEFT JOIN RES_PARTNER t181 ON t171.PARTNER_ID = t181.ID LEFT JOIN ACCOUNT_JOURNAL t191 ON t1.TAX_CASH_BASIS_JOURNAL_ID = t191.ID LEFT JOIN STOCK_LOCATION t201 ON t1.INTERNAL_TRANSIT_LOCATION_ID = t201.ID LEFT JOIN RESOURCE_CALENDAR t211 ON t1.RESOURCE_CALENDAR_ID = t211.ID
WHERE ( t1.PARENT_ID IS NULL )
]]>
</sql>
<!--数据查询[View]-->
<sqlid="View"databaseId="postgresql">
<![CDATA[ SELECT t1.ACCOUNT_BANK_RECONCILIATION_START, t1.ACCOUNT_DASHBOARD_ONBOARDING_STATE, t1.ACCOUNT_INVOICE_ONBOARDING_STATE, t1.ACCOUNT_NO, t1.ACCOUNT_ONBOARDING_INVOICE_LAYOUT_STATE, t1.ACCOUNT_ONBOARDING_SALE_TAX_STATE, t1.ACCOUNT_ONBOARDING_SAMPLE_INVOICE_STATE, t61.DATE AS ACCOUNT_OPENING_DATE, t61.JOURNAL_ID AS ACCOUNT_OPENING_JOURNAL_ID, t1.ACCOUNT_OPENING_MOVE_ID, t61.NAME AS ACCOUNT_OPENING_MOVE_ID_TEXT, t1.ACCOUNT_PURCHASE_TAX_ID, t41.NAME AS ACCOUNT_PURCHASE_TAX_ID_TEXT, t1.ACCOUNT_SALE_TAX_ID, t121.NAME AS ACCOUNT_SALE_TAX_ID_TEXT, t1.ACCOUNT_SETUP_BANK_DATA_STATE, t1.ACCOUNT_SETUP_COA_STATE, t1.ACCOUNT_SETUP_FY_DATA_STATE, t1.ANGLO_SAXON_ACCOUNTING, t1.BANK_ACCOUNT_CODE_PREFIX, t1.BASE_ONBOARDING_COMPANY_STATE, t1.CASH_ACCOUNT_CODE_PREFIX, t1.CHART_TEMPLATE_ID, t111.NAME AS CHART_TEMPLATE_ID_TEXT, t1.COMPANY_REGISTRY, t1.CREATE_DATE, t1.CREATE_UID, t141.NAME AS CREATE_UID_TEXT, t1.CURRENCY_EXCHANGE_JOURNAL_ID, t11.NAME AS CURRENCY_EXCHANGE_JOURNAL_ID_TEXT, t1.CURRENCY_ID, t81.NAME AS CURRENCY_ID_TEXT, t21.EMAIL, t1.EXPECTS_CHART_OF_ACCOUNTS, t11.DEFAULT_DEBIT_ACCOUNT_ID AS EXPENSE_CURRENCY_EXCHANGE_ACCOUNT_ID, t1.EXTERNAL_REPORT_LAYOUT_ID, t1.FISCALYEAR_LAST_DAY, t1.FISCALYEAR_LAST_MONTH, t1.FISCALYEAR_LOCK_DATE, t1.ID, t11.DEFAULT_CREDIT_ACCOUNT_ID AS INCOME_CURRENCY_EXCHANGE_ACCOUNT_ID, t1.INCOTERM_ID, t51.NAME AS INCOTERM_ID_TEXT, t1.INTERNAL_TRANSIT_LOCATION_ID, t201.NAME AS INTERNAL_TRANSIT_LOCATION_ID_TEXT, t1.INVOICE_IS_EMAIL, t1.INVOICE_IS_PRINT, t1.INVOICE_IS_SNAILMAIL, t1.MANUFACTURING_LEAD, t21.NAME, t1.NOMENCLATURE_ID, t1.PAPERFORMAT_ID, t1.PARENT_ID, t181.NAME AS PARENT_ID_TEXT, t21.PARTNER_GID, t1.PARTNER_ID, t1.PAYMENT_ACQUIRER_ONBOARDING_STATE, t1.PAYMENT_ONBOARDING_PAYMENT_METHOD, t1.PERIOD_LOCK_DATE, t21.PHONE, t1.PORTAL_CONFIRMATION_PAY, t1.PORTAL_CONFIRMATION_SIGN, t1.PO_DOUBLE_VALIDATION, t1.PO_DOUBLE_VALIDATION_AMOUNT, t1.PO_LEAD, t1.PO_LOCK, t1.PROPERTY_STOCK_ACCOUNT_INPUT_CATEG_ID, t31.NAME AS PROPERTY_STOCK_ACCOUNT_INPUT_CATEG_ID_TEXT, t1.PROPERTY_STOCK_ACCOUNT_OUTPUT_CATEG_ID, t151.NAME AS PROPERTY_STOCK_ACCOUNT_OUTPUT_CATEG_ID_TEXT, t1.PROPERTY_STOCK_VALUATION_ACCOUNT_ID, t161.NAME AS PROPERTY_STOCK_VALUATION_ACCOUNT_ID_TEXT, t1.QR_CODE, t1.QUOTATION_VALIDITY_DAYS, t1.REPORT_FOOTER, t1.REPORT_HEADER, t1.RESOURCE_CALENDAR_ID, t211.NAME AS RESOURCE_CALENDAR_ID_TEXT, t1.SALE_ONBOARDING_ORDER_CONFIRMATION_STATE, t1.SALE_ONBOARDING_PAYMENT_METHOD, t1.SALE_ONBOARDING_SAMPLE_QUOTATION_STATE, t1.SALE_QUOTATION_ONBOARDING_STATE, t1.SECURITY_LEAD, t1.SEQUENCE, t1.SNAILMAIL_COLOR, t1.SNAILMAIL_DUPLEX, t1.SOCIAL_FACEBOOK, t1.SOCIAL_GITHUB, t1.SOCIAL_INSTAGRAM, t1.SOCIAL_LINKEDIN, t1.SOCIAL_TWITTER, t1.SOCIAL_YOUTUBE, t1.TAX_CALCULATION_ROUNDING_METHOD, t1.TAX_CASH_BASIS_JOURNAL_ID, t191.NAME AS TAX_CASH_BASIS_JOURNAL_ID_TEXT, t1.TAX_EXIGIBILITY, t1.TRANSFER_ACCOUNT_CODE_PREFIX, t1.TRANSFER_ACCOUNT_ID, t71.NAME AS TRANSFER_ACCOUNT_ID_TEXT, t21.VAT, t21.WEBSITE, t1.WEBSITE_SALE_ONBOARDING_PAYMENT_ACQUIRER_STATE, t1.WRITE_DATE, t1.WRITE_UID, t101.NAME AS WRITE_UID_TEXT FROM RES_COMPANY t1 LEFT JOIN ACCOUNT_JOURNAL t11 ON t1.CURRENCY_EXCHANGE_JOURNAL_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t1.PARTNER_ID = t21.ID LEFT JOIN ACCOUNT_ACCOUNT t31 ON t1.PROPERTY_STOCK_ACCOUNT_INPUT_CATEG_ID = t31.ID LEFT JOIN ACCOUNT_TAX t41 ON t1.ACCOUNT_PURCHASE_TAX_ID = t41.ID LEFT JOIN ACCOUNT_INCOTERMS t51 ON t1.INCOTERM_ID = t51.ID LEFT JOIN ACCOUNT_MOVE t61 ON t1.ACCOUNT_OPENING_MOVE_ID = t61.ID LEFT JOIN ACCOUNT_ACCOUNT t71 ON t1.TRANSFER_ACCOUNT_ID = t71.ID LEFT JOIN RES_CURRENCY t81 ON t1.CURRENCY_ID = t81.ID LEFT JOIN RES_USERS t91 ON t1.WRITE_UID = t91.ID LEFT JOIN RES_PARTNER t101 ON t91.PARTNER_ID = t101.ID LEFT JOIN ACCOUNT_CHART_TEMPLATE t111 ON t1.CHART_TEMPLATE_ID = t111.ID LEFT JOIN ACCOUNT_TAX t121 ON t1.ACCOUNT_SALE_TAX_ID = t121.ID LEFT JOIN RES_USERS t131 ON t1.CREATE_UID = t131.ID LEFT JOIN RES_PARTNER t141 ON t131.PARTNER_ID = t141.ID LEFT JOIN ACCOUNT_ACCOUNT t151 ON t1.PROPERTY_STOCK_ACCOUNT_OUTPUT_CATEG_ID = t151.ID LEFT JOIN ACCOUNT_ACCOUNT t161 ON t1.PROPERTY_STOCK_VALUATION_ACCOUNT_ID = t161.ID LEFT JOIN RES_COMPANY t171 ON t1.PARENT_ID = t171.ID LEFT JOIN RES_PARTNER t181 ON t171.PARTNER_ID = t181.ID LEFT JOIN ACCOUNT_JOURNAL t191 ON t1.TAX_CASH_BASIS_JOURNAL_ID = t191.ID LEFT JOIN STOCK_LOCATION t201 ON t1.INTERNAL_TRANSIT_LOCATION_ID = t201.ID LEFT JOIN RESOURCE_CALENDAR t211 ON t1.RESOURCE_CALENDAR_ID = t211.ID
<where><iftest="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<iftest="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sqlid="Default"databaseId="postgresql">
<![CDATA[ SELECT t1.ACTIVE, t1.COLOR, t1.COMPANY_ID, t91.NAME AS COMPANY_ID_TEXT, t1.COMPLETE_NAME, t1.CREATE_DATE, t1.CREATE_UID, t61.NAME AS CREATE_UID_TEXT, t1.ID, t1.MANAGER_ID, t41.NAME AS MANAGER_ID_TEXT, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.NAME, t1.PARENT_ID, t71.NAME AS PARENT_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UID_TEXT FROM HR_DEPARTMENT t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN HR_EMPLOYEE t31 ON t1.MANAGER_ID = t31.ID LEFT JOIN RESOURCE_RESOURCE t41 ON t31.RESOURCE_ID = t41.ID LEFT JOIN RES_USERS t51 ON t1.CREATE_UID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN HR_DEPARTMENT t71 ON t1.PARENT_ID = t71.ID LEFT JOIN RES_COMPANY t81 ON t1.COMPANY_ID = t81.ID LEFT JOIN RES_PARTNER t91 ON t81.PARTNER_ID = t91.ID
]]>
</sql>
<!--数据查询[ROOT]-->
<sqlid="ROOT"databaseId="postgresql">
<![CDATA[ SELECT t1.ACTIVE, t1.COLOR, t1.COMPANY_ID, t91.NAME AS COMPANY_ID_TEXT, t1.COMPLETE_NAME, t1.CREATE_DATE, t1.CREATE_UID, t61.NAME AS CREATE_UID_TEXT, t1.ID, t1.MANAGER_ID, t41.NAME AS MANAGER_ID_TEXT, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.NAME, t1.PARENT_ID, t71.NAME AS PARENT_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UID_TEXT FROM HR_DEPARTMENT t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN HR_EMPLOYEE t31 ON t1.MANAGER_ID = t31.ID LEFT JOIN RESOURCE_RESOURCE t41 ON t31.RESOURCE_ID = t41.ID LEFT JOIN RES_USERS t51 ON t1.CREATE_UID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN HR_DEPARTMENT t71 ON t1.PARENT_ID = t71.ID LEFT JOIN RES_COMPANY t81 ON t1.COMPANY_ID = t81.ID LEFT JOIN RES_PARTNER t91 ON t81.PARTNER_ID = t91.ID
WHERE ( t1.PARENT_ID IS NULL )
]]>
</sql>
<!--数据查询[View]-->
<sqlid="View"databaseId="postgresql">
<![CDATA[ SELECT t1.ACTIVE, t1.COLOR, t1.COMPANY_ID, t91.NAME AS COMPANY_ID_TEXT, t1.COMPLETE_NAME, t1.CREATE_DATE, t1.CREATE_UID, t61.NAME AS CREATE_UID_TEXT, t1.ID, t1.MANAGER_ID, t41.NAME AS MANAGER_ID_TEXT, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.NAME, t1.NOTE, t1.PARENT_ID, t71.NAME AS PARENT_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UID_TEXT FROM HR_DEPARTMENT t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN HR_EMPLOYEE t31 ON t1.MANAGER_ID = t31.ID LEFT JOIN RESOURCE_RESOURCE t41 ON t31.RESOURCE_ID = t41.ID LEFT JOIN RES_USERS t51 ON t1.CREATE_UID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN HR_DEPARTMENT t71 ON t1.PARENT_ID = t71.ID LEFT JOIN RES_COMPANY t81 ON t1.COMPANY_ID = t81.ID LEFT JOIN RES_PARTNER t91 ON t81.PARTNER_ID = t91.ID
<![CDATA[select t1.* from (SELECT t1.CREATE_DATE, t1.CREATE_UID, t1.EMPLOYEE_ID, t21.NAME AS EMPLOYEE_NAME, t1.ID, t1.SKILL_ID, t1.SKILL_LEVEL_ID, t51.NAME AS SKILL_LEVEL_NAME, t41.NAME AS SKILL_NAME, t1.SKILL_TYPE_ID, t31.NAME AS SKILL_TYPE_NAME, t1.WRITE_DATE, t1.WRITE_UID FROM HR_EMPLOYEE_SKILL t1 LEFT JOIN HR_EMPLOYEE t11 ON t1.EMPLOYEE_ID = t11.ID LEFT JOIN RESOURCE_RESOURCE t21 ON t11.RESOURCE_ID = t21.ID LEFT JOIN HR_SKILL_TYPE t31 ON t1.SKILL_TYPE_ID = t31.ID LEFT JOIN HR_SKILL t41 ON t1.SKILL_ID = t41.ID LEFT JOIN HR_SKILL_LEVEL t51 ON t1.SKILL_LEVEL_ID = t51.ID ) t1 where id=#{id}]]>
<where><iftest="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<iftest="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sqlid="Default"databaseId="postgresql">
<![CDATA[ SELECT t1.CREATE_DATE, t1.CREATE_UID, t1.EMPLOYEE_ID, t21.NAME AS EMPLOYEE_NAME, t1.ID, t1.SKILL_ID, t1.SKILL_LEVEL_ID, t51.NAME AS SKILL_LEVEL_NAME, t41.NAME AS SKILL_NAME, t1.SKILL_TYPE_ID, t31.NAME AS SKILL_TYPE_NAME, t1.WRITE_DATE, t1.WRITE_UID FROM HR_EMPLOYEE_SKILL t1 LEFT JOIN HR_EMPLOYEE t11 ON t1.EMPLOYEE_ID = t11.ID LEFT JOIN RESOURCE_RESOURCE t21 ON t11.RESOURCE_ID = t21.ID LEFT JOIN HR_SKILL_TYPE t31 ON t1.SKILL_TYPE_ID = t31.ID LEFT JOIN HR_SKILL t41 ON t1.SKILL_ID = t41.ID LEFT JOIN HR_SKILL_LEVEL t51 ON t1.SKILL_LEVEL_ID = t51.ID
]]>
</sql>
<!--数据查询[View]-->
<sqlid="View"databaseId="postgresql">
<![CDATA[ SELECT t1.CREATE_DATE, t1.CREATE_UID, t1.EMPLOYEE_ID, t21.NAME AS EMPLOYEE_NAME, t1.ID, t1.SKILL_ID, t1.SKILL_LEVEL_ID, t51.NAME AS SKILL_LEVEL_NAME, t41.NAME AS SKILL_NAME, t1.SKILL_TYPE_ID, t31.NAME AS SKILL_TYPE_NAME, t1.WRITE_DATE, t1.WRITE_UID FROM HR_EMPLOYEE_SKILL t1 LEFT JOIN HR_EMPLOYEE t11 ON t1.EMPLOYEE_ID = t11.ID LEFT JOIN RESOURCE_RESOURCE t21 ON t11.RESOURCE_ID = t21.ID LEFT JOIN HR_SKILL_TYPE t31 ON t1.SKILL_TYPE_ID = t31.ID LEFT JOIN HR_SKILL t41 ON t1.SKILL_ID = t41.ID LEFT JOIN HR_SKILL_LEVEL t51 ON t1.SKILL_LEVEL_ID = t51.ID
<![CDATA[select t1.* from (SELECT t1.CREATE_DATE, t1.CREATE_UID, t1.DATE_END, t1.DATE_START, t1.DISPLAY_TYPE, t1.EMPLOYEE_ID, t21.NAME AS EMPLOYEE_ID_TEXT, t1.ID, t1.LINE_TYPE_ID, t31.NAME AS LINE_TYPE_ID_TEXT, t1.NAME, t1.WRITE_DATE FROM HR_RESUME_LINE t1 LEFT JOIN HR_EMPLOYEE t11 ON t1.EMPLOYEE_ID = t11.ID LEFT JOIN RESOURCE_RESOURCE t21 ON t11.RESOURCE_ID = t21.ID LEFT JOIN HR_RESUME_LINE_TYPE t31 ON t1.LINE_TYPE_ID = t31.ID ) t1 where id=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.CREATE_DATE, t1.CREATE_UID, t1.DATE_END, t1.DATE_START, t1.DISPLAY_TYPE, t1.EMPLOYEE_ID, t21.NAME AS EMPLOYEE_ID_TEXT, t1.ID, t1.LINE_TYPE_ID, t31.NAME AS LINE_TYPE_ID_TEXT, t1.NAME, t1.WRITE_DATE, t1.WRITE_UID FROM HR_RESUME_LINE t1 LEFT JOIN HR_EMPLOYEE t11 ON t1.EMPLOYEE_ID = t11.ID LEFT JOIN RESOURCE_RESOURCE t21 ON t11.RESOURCE_ID = t21.ID LEFT JOIN HR_RESUME_LINE_TYPE t31 ON t1.LINE_TYPE_ID = t31.ID ) t1 where id=#{id}]]>
<![CDATA[ SELECT t1.CREATE_DATE, t1.CREATE_UID, t1.DATE_END, t1.DATE_START, t1.DISPLAY_TYPE, t1.EMPLOYEE_ID, t21.NAME AS EMPLOYEE_ID_TEXT, t1.ID, t1.LINE_TYPE_ID, t31.NAME AS LINE_TYPE_ID_TEXT, t1.NAME, t1.WRITE_DATE FROM HR_RESUME_LINE t1 LEFT JOIN HR_EMPLOYEE t11 ON t1.EMPLOYEE_ID = t11.ID LEFT JOIN RESOURCE_RESOURCE t21 ON t11.RESOURCE_ID = t21.ID LEFT JOIN HR_RESUME_LINE_TYPE t31 ON t1.LINE_TYPE_ID = t31.ID
<![CDATA[ SELECT t1.CREATE_DATE, t1.CREATE_UID, t1.DATE_END, t1.DATE_START, t1.DISPLAY_TYPE, t1.EMPLOYEE_ID, t21.NAME AS EMPLOYEE_ID_TEXT, t1.ID, t1.LINE_TYPE_ID, t31.NAME AS LINE_TYPE_ID_TEXT, t1.NAME, t1.WRITE_DATE, t1.WRITE_UID FROM HR_RESUME_LINE t1 LEFT JOIN HR_EMPLOYEE t11 ON t1.EMPLOYEE_ID = t11.ID LEFT JOIN RESOURCE_RESOURCE t21 ON t11.RESOURCE_ID = t21.ID LEFT JOIN HR_RESUME_LINE_TYPE t31 ON t1.LINE_TYPE_ID = t31.ID
]]>
</sql>
<!--数据查询[View]-->
<sqlid="View"databaseId="postgresql">
<![CDATA[ SELECT t1.CREATE_DATE, t1.CREATE_UID, t1.DATE_END, t1.DATE_START, t1.DISPLAY_TYPE, t1.EMPLOYEE_ID, t21.NAME AS EMPLOYEE_ID_TEXT, t1.ID, t1.LINE_TYPE_ID, t31.NAME AS LINE_TYPE_ID_TEXT, t1.NAME, t1.WRITE_DATE FROM HR_RESUME_LINE t1 LEFT JOIN HR_EMPLOYEE t11 ON t1.EMPLOYEE_ID = t11.ID LEFT JOIN RESOURCE_RESOURCE t21 ON t11.RESOURCE_ID = t21.ID LEFT JOIN HR_RESUME_LINE_TYPE t31 ON t1.LINE_TYPE_ID = t31.ID
<![CDATA[ SELECT t1.CREATE_DATE, t1.CREATE_UID, t1.DATE_END, t1.DATE_START, t1.DISPLAY_TYPE, t1.EMPLOYEE_ID, t21.NAME AS EMPLOYEE_ID_TEXT, t1.ID, t1.LINE_TYPE_ID, t31.NAME AS LINE_TYPE_ID_TEXT, t1.NAME, t1.WRITE_DATE, t1.WRITE_UID FROM HR_RESUME_LINE t1 LEFT JOIN HR_EMPLOYEE t11 ON t1.EMPLOYEE_ID = t11.ID LEFT JOIN RESOURCE_RESOURCE t21 ON t11.RESOURCE_ID = t21.ID LEFT JOIN HR_RESUME_LINE_TYPE t31 ON t1.LINE_TYPE_ID = t31.ID
<![CDATA[select t1.* from (SELECT t1.CREATE_DATE, t1.CREATE_UID, t1.ID, t1.NAME, t1.SKILL_TYPE_ID, t11.NAME AS SKILL_TYPE_NAME, t1.WRITE_DATE, t1.WRITE_UID FROM HR_SKILL t1 LEFT JOIN HR_SKILL_TYPE t11 ON t1.SKILL_TYPE_ID = t11.ID ) t1 where id=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.CREATE_DATE, t1.CREATE_UID, t1.ID, t1.NAME, t1.SKILL_TYPE_ID, t11.NAME AS SKILL_TYPE_NAME, t1.WRITE_DATE, t1.WRITE_UID FROM HR_SKILL_LEVEL t1 LEFT JOIN HR_SKILL_TYPE t11 ON t1.SKILL_TYPE_ID = t11.ID ) t1 where id=#{id}]]>
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Hr_department-searchROOT-all') and hasPermission(#context,'iBizBusinessCentral-Hr_department-Get')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Hr_department-searchROOT-all') and hasPermission(#context,'iBizBusinessCentral-Hr_department-Get')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Res_company-searchROOT-all') and hasPermission(#context,'iBizBusinessCentral-Res_company-Get')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Res_company-searchROOT-all') and hasPermission(#context,'iBizBusinessCentral-Res_company-Get')")