<![CDATA[ SELECT t1.ACCOUNT_ANALYTIC_ID, t131.NAME AS ACCOUNT_ANALYTIC_ID_TEXT, t1.COMPANY_ID, t111.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t31.NAME AS CREATE_UID_TEXT, t1.CURRENCY_ID, t151.NAME AS CURRENCY_ID_TEXT, t121.DATE_ORDER, t1.DATE_PLANNED, t1.ID, t1.ORDERPOINT_ID, t41.NAME AS ORDERPOINT_ID_TEXT, t1.ORDER_ID, t121.NAME AS ORDER_ID_TEXT, t1.PARTNER_ID, t11.NAME AS PARTNER_ID_TEXT, t1.PRICE_SUBTOTAL, t1.PRICE_TAX, t1.PRICE_TOTAL, t1.PRICE_UNIT, t1.PRODUCT_ID, t71.NAME AS PRODUCT_ID_TEXT, t1.PRODUCT_QTY, t71.TYPE AS PRODUCT_TYPE, t1.PRODUCT_UOM, t141.CATEGORY_ID AS PRODUCT_UOM_CATEGORY_ID, t1.PRODUCT_UOM_QTY, t141.NAME AS PRODUCT_UOM_TEXT, t1.QTY_INVOICED, t1.QTY_RECEIVED, t1.SALE_LINE_ID, t1.SALE_ORDER_ID, t51.NAME AS SALE_ORDER_ID_TEXT, t1.SEQUENCE, t121.STATE, (SELECT ARRAY_TO_JSON(ARRAY_AGG(T.*)) FROM (SELECT M2.ID AS SRFKEY, M2.NAME AS SRFMAJORTEXT FROM ACCOUNT_TAX_PURCHASE_ORDER_LINE_REL M1 LEFT JOIN ACCOUNT_TAX M2 ON M1.ACCOUNT_TAX_ID = M2.ID WHERE M1.PURCHASE_ORDER_LINE_ID =T1.ID ) T) AS TAXES_ID, t1.WRITE_DATE, t1.WRITE_UID, t91.NAME AS WRITE_UID_TEXT FROM PURCHASE_ORDER_LINE t1 LEFT JOIN RES_PARTNER t11 ON t1.PARTNER_ID = t11.ID LEFT JOIN RES_USERS t21 ON t1.CREATE_UID = t21.ID LEFT JOIN RES_PARTNER t31 ON t21.PARTNER_ID = t31.ID LEFT JOIN STOCK_WAREHOUSE_ORDERPOINT t41 ON t1.ORDERPOINT_ID = t41.ID LEFT JOIN SALE_ORDER t51 ON t1.SALE_ORDER_ID = t51.ID LEFT JOIN PRODUCT_PRODUCT t61 ON t1.PRODUCT_ID = t61.ID LEFT JOIN PRODUCT_TEMPLATE t71 ON t61.PRODUCT_TMPL_ID = t71.ID LEFT JOIN RES_USERS t81 ON t1.WRITE_UID = t81.ID LEFT JOIN RES_PARTNER t91 ON t81.PARTNER_ID = t91.ID LEFT JOIN RES_COMPANY t101 ON t1.COMPANY_ID = t101.ID LEFT JOIN RES_PARTNER t111 ON t101.PARTNER_ID = t111.ID LEFT JOIN PURCHASE_ORDER t121 ON t1.ORDER_ID = t121.ID LEFT JOIN ACCOUNT_ANALYTIC_ACCOUNT t131 ON t1.ACCOUNT_ANALYTIC_ID = t131.ID LEFT JOIN UOM_UOM t141 ON t1.PRODUCT_UOM = t141.ID LEFT JOIN RES_CURRENCY t151 ON t1.CURRENCY_ID = t151.ID
<![CDATA[ SELECT t1.ACCOUNT_ANALYTIC_ID, t131.NAME AS ACCOUNT_ANALYTIC_ID_TEXT, t1.COMPANY_ID, t111.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t31.NAME AS CREATE_UID_TEXT, t1.CURRENCY_ID, t151.NAME AS CURRENCY_ID_TEXT, t121.DATE_ORDER, t1.DATE_PLANNED, t1.ID, t1.NAME, t1.ORDERPOINT_ID, t41.NAME AS ORDERPOINT_ID_TEXT, t1.ORDER_ID, t121.NAME AS ORDER_ID_TEXT, t1.PARTNER_ID, t11.NAME AS PARTNER_ID_TEXT, t1.PRICE_SUBTOTAL, t1.PRICE_TAX, t1.PRICE_TOTAL, t1.PRICE_UNIT, t1.PRODUCT_ID, t71.NAME AS PRODUCT_ID_TEXT, t1.PRODUCT_QTY, t71.TYPE AS PRODUCT_TYPE, t1.PRODUCT_UOM, t141.CATEGORY_ID AS PRODUCT_UOM_CATEGORY_ID, t1.PRODUCT_UOM_QTY, t141.NAME AS PRODUCT_UOM_TEXT, t1.QTY_INVOICED, t1.QTY_RECEIVED, t1.SALE_LINE_ID, t1.SALE_ORDER_ID, t51.NAME AS SALE_ORDER_ID_TEXT, t1.SEQUENCE, t121.STATE, (SELECT ARRAY_TO_JSON(ARRAY_AGG(T.*)) FROM (SELECT M2.ID AS SRFKEY, M2.NAME AS SRFMAJORTEXT FROM ACCOUNT_TAX_PURCHASE_ORDER_LINE_REL M1 LEFT JOIN ACCOUNT_TAX M2 ON M1.ACCOUNT_TAX_ID = M2.ID WHERE M1.PURCHASE_ORDER_LINE_ID =T1.ID ) T) AS TAXES_ID, t1.WRITE_DATE, t1.WRITE_UID, t91.NAME AS WRITE_UID_TEXT FROM PURCHASE_ORDER_LINE t1 LEFT JOIN RES_PARTNER t11 ON t1.PARTNER_ID = t11.ID LEFT JOIN RES_USERS t21 ON t1.CREATE_UID = t21.ID LEFT JOIN RES_PARTNER t31 ON t21.PARTNER_ID = t31.ID LEFT JOIN STOCK_WAREHOUSE_ORDERPOINT t41 ON t1.ORDERPOINT_ID = t41.ID LEFT JOIN SALE_ORDER t51 ON t1.SALE_ORDER_ID = t51.ID LEFT JOIN PRODUCT_PRODUCT t61 ON t1.PRODUCT_ID = t61.ID LEFT JOIN PRODUCT_TEMPLATE t71 ON t61.PRODUCT_TMPL_ID = t71.ID LEFT JOIN RES_USERS t81 ON t1.WRITE_UID = t81.ID LEFT JOIN RES_PARTNER t91 ON t81.PARTNER_ID = t91.ID LEFT JOIN RES_COMPANY t101 ON t1.COMPANY_ID = t101.ID LEFT JOIN RES_PARTNER t111 ON t101.PARTNER_ID = t111.ID LEFT JOIN PURCHASE_ORDER t121 ON t1.ORDER_ID = t121.ID LEFT JOIN ACCOUNT_ANALYTIC_ACCOUNT t131 ON t1.ACCOUNT_ANALYTIC_ID = t131.ID LEFT JOIN UOM_UOM t141 ON t1.PRODUCT_UOM = t141.ID LEFT JOIN RES_CURRENCY t151 ON t1.CURRENCY_ID = t151.ID
]]>
</sql>
<!--数据查询[Default]-->
<sqlid="Default"databaseId="postgresql">
<![CDATA[ SELECT t1.ACCOUNT_ANALYTIC_ID, t131.NAME AS ACCOUNT_ANALYTIC_ID_TEXT, t1.COMPANY_ID, t111.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t31.NAME AS CREATE_UID_TEXT, t1.CURRENCY_ID, t151.NAME AS CURRENCY_ID_TEXT, t121.DATE_ORDER, t1.DATE_PLANNED, t1.ID, t1.ORDERPOINT_ID, t41.NAME AS ORDERPOINT_ID_TEXT, t1.ORDER_ID, t121.NAME AS ORDER_ID_TEXT, t1.PARTNER_ID, t11.NAME AS PARTNER_ID_TEXT, t1.PRICE_SUBTOTAL, t1.PRICE_TAX, t1.PRICE_TOTAL, t1.PRICE_UNIT, t1.PRODUCT_ID, t71.NAME AS PRODUCT_ID_TEXT, t1.PRODUCT_QTY, t71.TYPE AS PRODUCT_TYPE, t1.PRODUCT_UOM, t141.CATEGORY_ID AS PRODUCT_UOM_CATEGORY_ID, t1.PRODUCT_UOM_QTY, t141.NAME AS PRODUCT_UOM_TEXT, t1.QTY_INVOICED, t1.QTY_RECEIVED, t1.SALE_LINE_ID, t1.SALE_ORDER_ID, t51.NAME AS SALE_ORDER_ID_TEXT, t1.SEQUENCE, t121.STATE, (SELECT ARRAY_TO_JSON(ARRAY_AGG(T.*)) FROM (SELECT M2.ID AS SRFKEY, M2.NAME AS SRFMAJORTEXT FROM ACCOUNT_TAX_PURCHASE_ORDER_LINE_REL M1 LEFT JOIN ACCOUNT_TAX M2 ON M1.ACCOUNT_TAX_ID = M2.ID WHERE M1.PURCHASE_ORDER_LINE_ID =T1.ID ) T) AS TAXES_ID, t1.WRITE_DATE, t1.WRITE_UID, t91.NAME AS WRITE_UID_TEXT FROM PURCHASE_ORDER_LINE t1 LEFT JOIN RES_PARTNER t11 ON t1.PARTNER_ID = t11.ID LEFT JOIN RES_USERS t21 ON t1.CREATE_UID = t21.ID LEFT JOIN RES_PARTNER t31 ON t21.PARTNER_ID = t31.ID LEFT JOIN STOCK_WAREHOUSE_ORDERPOINT t41 ON t1.ORDERPOINT_ID = t41.ID LEFT JOIN SALE_ORDER t51 ON t1.SALE_ORDER_ID = t51.ID LEFT JOIN PRODUCT_PRODUCT t61 ON t1.PRODUCT_ID = t61.ID LEFT JOIN PRODUCT_TEMPLATE t71 ON t61.PRODUCT_TMPL_ID = t71.ID LEFT JOIN RES_USERS t81 ON t1.WRITE_UID = t81.ID LEFT JOIN RES_PARTNER t91 ON t81.PARTNER_ID = t91.ID LEFT JOIN RES_COMPANY t101 ON t1.COMPANY_ID = t101.ID LEFT JOIN RES_PARTNER t111 ON t101.PARTNER_ID = t111.ID LEFT JOIN PURCHASE_ORDER t121 ON t1.ORDER_ID = t121.ID LEFT JOIN ACCOUNT_ANALYTIC_ACCOUNT t131 ON t1.ACCOUNT_ANALYTIC_ID = t131.ID LEFT JOIN UOM_UOM t141 ON t1.PRODUCT_UOM = t141.ID LEFT JOIN RES_CURRENCY t151 ON t1.CURRENCY_ID = t151.ID
<![CDATA[ SELECT t1.ACCOUNT_ANALYTIC_ID, t131.NAME AS ACCOUNT_ANALYTIC_ID_TEXT, t1.COMPANY_ID, t111.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t31.NAME AS CREATE_UID_TEXT, t1.CURRENCY_ID, t151.NAME AS CURRENCY_ID_TEXT, t121.DATE_ORDER, t1.DATE_PLANNED, t1.ID, t1.NAME, t1.ORDERPOINT_ID, t41.NAME AS ORDERPOINT_ID_TEXT, t1.ORDER_ID, t121.NAME AS ORDER_ID_TEXT, t1.PARTNER_ID, t11.NAME AS PARTNER_ID_TEXT, t1.PRICE_SUBTOTAL, t1.PRICE_TAX, t1.PRICE_TOTAL, t1.PRICE_UNIT, t1.PRODUCT_ID, t71.NAME AS PRODUCT_ID_TEXT, t1.PRODUCT_QTY, t71.TYPE AS PRODUCT_TYPE, t1.PRODUCT_UOM, t141.CATEGORY_ID AS PRODUCT_UOM_CATEGORY_ID, t1.PRODUCT_UOM_QTY, t141.NAME AS PRODUCT_UOM_TEXT, t1.QTY_INVOICED, t1.QTY_RECEIVED, t1.SALE_LINE_ID, t1.SALE_ORDER_ID, t51.NAME AS SALE_ORDER_ID_TEXT, t1.SEQUENCE, t121.STATE, (SELECT ARRAY_TO_JSON(ARRAY_AGG(T.*)) FROM (SELECT M2.ID AS SRFKEY, M2.NAME AS SRFMAJORTEXT FROM ACCOUNT_TAX_PURCHASE_ORDER_LINE_REL M1 LEFT JOIN ACCOUNT_TAX M2 ON M1.ACCOUNT_TAX_ID = M2.ID WHERE M1.PURCHASE_ORDER_LINE_ID =T1.ID ) T) AS TAXES_ID, t1.WRITE_DATE, t1.WRITE_UID, t91.NAME AS WRITE_UID_TEXT FROM PURCHASE_ORDER_LINE t1 LEFT JOIN RES_PARTNER t11 ON t1.PARTNER_ID = t11.ID LEFT JOIN RES_USERS t21 ON t1.CREATE_UID = t21.ID LEFT JOIN RES_PARTNER t31 ON t21.PARTNER_ID = t31.ID LEFT JOIN STOCK_WAREHOUSE_ORDERPOINT t41 ON t1.ORDERPOINT_ID = t41.ID LEFT JOIN SALE_ORDER t51 ON t1.SALE_ORDER_ID = t51.ID LEFT JOIN PRODUCT_PRODUCT t61 ON t1.PRODUCT_ID = t61.ID LEFT JOIN PRODUCT_TEMPLATE t71 ON t61.PRODUCT_TMPL_ID = t71.ID LEFT JOIN RES_USERS t81 ON t1.WRITE_UID = t81.ID LEFT JOIN RES_PARTNER t91 ON t81.PARTNER_ID = t91.ID LEFT JOIN RES_COMPANY t101 ON t1.COMPANY_ID = t101.ID LEFT JOIN RES_PARTNER t111 ON t101.PARTNER_ID = t111.ID LEFT JOIN PURCHASE_ORDER t121 ON t1.ORDER_ID = t121.ID LEFT JOIN ACCOUNT_ANALYTIC_ACCOUNT t131 ON t1.ACCOUNT_ANALYTIC_ID = t131.ID LEFT JOIN UOM_UOM t141 ON t1.PRODUCT_UOM = t141.ID LEFT JOIN RES_CURRENCY t151 ON t1.CURRENCY_ID = t151.ID