<![CDATA[select t1.* from (SELECT t1.ACCESS_TOKEN, t1.AMOUNT_TAX, t1.AMOUNT_TOTAL, t1.AMOUNT_UNTAXED, t1.COMPANY_ID, t61.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t121.NAME AS CREATE_UID_TEXT, t1.CURRENCY_ID, t41.NAME AS CURRENCY_ID_TEXT, t1.DATE_APPROVE, t1.DATE_ORDER, t1.DATE_PLANNED, t1.DEST_ADDRESS_ID, t71.NAME AS DEST_ADDRESS_ID_TEXT, t1.FISCAL_POSITION_ID, t31.NAME AS FISCAL_POSITION_ID_TEXT, t1.GROUP_ID, t1.ID, t1.INCOTERM_ID, t151.NAME AS INCOTERM_ID_TEXT, t1.INVOICE_COUNT, t1.INVOICE_STATUS, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.NAME, t1.NOTES, t1.ORIGIN, t1.PARTNER_ID, t131.NAME AS PARTNER_ID_TEXT, t1.PARTNER_REF, t1.PAYMENT_TERM_ID, t101.NAME AS PAYMENT_TERM_ID_TEXT, t1.PICKING_COUNT, t1.PICKING_TYPE_ID, t141.NAME AS PICKING_TYPE_ID_TEXT, t1.STATE, t1.USER_ID, t21.NAME AS USER_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t91.NAME AS WRITE_UID_TEXT FROM PURCHASE_ORDER t1 LEFT JOIN RES_USERS t11 ON t1.USER_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN ACCOUNT_FISCAL_POSITION t31 ON t1.FISCAL_POSITION_ID = t31.ID LEFT JOIN RES_CURRENCY t41 ON t1.CURRENCY_ID = t41.ID LEFT JOIN RES_COMPANY t51 ON t1.COMPANY_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN RES_PARTNER t71 ON t1.DEST_ADDRESS_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 ACCOUNT_PAYMENT_TERM t101 ON t1.PAYMENT_TERM_ID = t101.ID LEFT JOIN RES_USERS t111 ON t1.CREATE_UID = t111.ID LEFT JOIN RES_PARTNER t121 ON t111.PARTNER_ID = t121.ID LEFT JOIN RES_PARTNER t131 ON t1.PARTNER_ID = t131.ID LEFT JOIN STOCK_PICKING_TYPE t141 ON t1.PICKING_TYPE_ID = t141.ID LEFT JOIN ACCOUNT_INCOTERMS t151 ON t1.INCOTERM_ID = t151.ID ) t1 where id=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.ACCESS_TOKEN, t1.AMOUNT_TAX, t1.AMOUNT_TOTAL, t1.AMOUNT_UNTAXED, t1.COMPANY_ID, t61.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t121.NAME AS CREATE_UID_TEXT, t1.CURRENCY_ID, t41.NAME AS CURRENCY_ID_TEXT, t1.DATE_APPROVE, t1.DATE_ORDER, t1.DATE_PLANNED, t1.DEST_ADDRESS_ID, t71.NAME AS DEST_ADDRESS_ID_TEXT, t1.FISCAL_POSITION_ID, t31.NAME AS FISCAL_POSITION_ID_TEXT, t1.GROUP_ID, t1.ID, t1.INCOTERM_ID, t151.NAME AS INCOTERM_ID_TEXT, t1.INVOICE_COUNT, t1.INVOICE_STATUS, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.NAME, t1.NOTES, t1.ORIGIN, t1.PARTNER_ID, t131.NAME AS PARTNER_ID_TEXT, t1.PARTNER_REF, t1.PAYMENT_TERM_ID, t101.NAME AS PAYMENT_TERM_ID_TEXT, t1.PICKING_COUNT, t1.PICKING_TYPE_ID, t141.NAME AS PICKING_TYPE_ID_TEXT, t1.REQUISITION_ID, t1.STATE, t1.USER_ID, t21.NAME AS USER_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t91.NAME AS WRITE_UID_TEXT FROM PURCHASE_ORDER t1 LEFT JOIN RES_USERS t11 ON t1.USER_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN ACCOUNT_FISCAL_POSITION t31 ON t1.FISCAL_POSITION_ID = t31.ID LEFT JOIN RES_CURRENCY t41 ON t1.CURRENCY_ID = t41.ID LEFT JOIN RES_COMPANY t51 ON t1.COMPANY_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN RES_PARTNER t71 ON t1.DEST_ADDRESS_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 ACCOUNT_PAYMENT_TERM t101 ON t1.PAYMENT_TERM_ID = t101.ID LEFT JOIN RES_USERS t111 ON t1.CREATE_UID = t111.ID LEFT JOIN RES_PARTNER t121 ON t111.PARTNER_ID = t121.ID LEFT JOIN RES_PARTNER t131 ON t1.PARTNER_ID = t131.ID LEFT JOIN STOCK_PICKING_TYPE t141 ON t1.PICKING_TYPE_ID = t141.ID LEFT JOIN ACCOUNT_INCOTERMS t151 ON t1.INCOTERM_ID = t151.ID ) t1 where id=#{id}]]>
<![CDATA[ SELECT t1.ACCESS_TOKEN, t1.AMOUNT_TAX, t1.AMOUNT_TOTAL, t1.AMOUNT_UNTAXED, t1.COMPANY_ID, t61.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t121.NAME AS CREATE_UID_TEXT, t1.CURRENCY_ID, t41.NAME AS CURRENCY_ID_TEXT, t1.DATE_APPROVE, t1.DATE_ORDER, t1.DATE_PLANNED, t1.DEST_ADDRESS_ID, t71.NAME AS DEST_ADDRESS_ID_TEXT, t1.FISCAL_POSITION_ID, t31.NAME AS FISCAL_POSITION_ID_TEXT, t1.GROUP_ID, t1.ID, t1.INCOTERM_ID, t151.NAME AS INCOTERM_ID_TEXT, t1.INVOICE_COUNT, t1.INVOICE_STATUS, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.NAME, t1.ORIGIN, t1.PARTNER_ID, t131.NAME AS PARTNER_ID_TEXT, t1.PARTNER_REF, t1.PAYMENT_TERM_ID, t101.NAME AS PAYMENT_TERM_ID_TEXT, t1.PICKING_COUNT, t1.PICKING_TYPE_ID, t141.NAME AS PICKING_TYPE_ID_TEXT, t1.STATE, t1.USER_ID, t21.NAME AS USER_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t91.NAME AS WRITE_UID_TEXT FROM PURCHASE_ORDER t1 LEFT JOIN RES_USERS t11 ON t1.USER_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN ACCOUNT_FISCAL_POSITION t31 ON t1.FISCAL_POSITION_ID = t31.ID LEFT JOIN RES_CURRENCY t41 ON t1.CURRENCY_ID = t41.ID LEFT JOIN RES_COMPANY t51 ON t1.COMPANY_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN RES_PARTNER t71 ON t1.DEST_ADDRESS_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 ACCOUNT_PAYMENT_TERM t101 ON t1.PAYMENT_TERM_ID = t101.ID LEFT JOIN RES_USERS t111 ON t1.CREATE_UID = t111.ID LEFT JOIN RES_PARTNER t121 ON t111.PARTNER_ID = t121.ID LEFT JOIN RES_PARTNER t131 ON t1.PARTNER_ID = t131.ID LEFT JOIN STOCK_PICKING_TYPE t141 ON t1.PICKING_TYPE_ID = t141.ID LEFT JOIN ACCOUNT_INCOTERMS t151 ON t1.INCOTERM_ID = t151.ID
<![CDATA[ SELECT t1.ACCESS_TOKEN, t1.AMOUNT_TAX, t1.AMOUNT_TOTAL, t1.AMOUNT_UNTAXED, t1.COMPANY_ID, t61.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t121.NAME AS CREATE_UID_TEXT, t1.CURRENCY_ID, t41.NAME AS CURRENCY_ID_TEXT, t1.DATE_APPROVE, t1.DATE_ORDER, t1.DATE_PLANNED, t1.DEST_ADDRESS_ID, t71.NAME AS DEST_ADDRESS_ID_TEXT, t1.FISCAL_POSITION_ID, t31.NAME AS FISCAL_POSITION_ID_TEXT, t1.GROUP_ID, t1.ID, t1.INCOTERM_ID, t151.NAME AS INCOTERM_ID_TEXT, t1.INVOICE_COUNT, t1.INVOICE_STATUS, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.NAME, t1.ORIGIN, t1.PARTNER_ID, t131.NAME AS PARTNER_ID_TEXT, t1.PARTNER_REF, t1.PAYMENT_TERM_ID, t101.NAME AS PAYMENT_TERM_ID_TEXT, t1.PICKING_COUNT, t1.PICKING_TYPE_ID, t141.NAME AS PICKING_TYPE_ID_TEXT, t1.REQUISITION_ID, t1.STATE, t1.USER_ID, t21.NAME AS USER_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t91.NAME AS WRITE_UID_TEXT FROM PURCHASE_ORDER t1 LEFT JOIN RES_USERS t11 ON t1.USER_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN ACCOUNT_FISCAL_POSITION t31 ON t1.FISCAL_POSITION_ID = t31.ID LEFT JOIN RES_CURRENCY t41 ON t1.CURRENCY_ID = t41.ID LEFT JOIN RES_COMPANY t51 ON t1.COMPANY_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN RES_PARTNER t71 ON t1.DEST_ADDRESS_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 ACCOUNT_PAYMENT_TERM t101 ON t1.PAYMENT_TERM_ID = t101.ID LEFT JOIN RES_USERS t111 ON t1.CREATE_UID = t111.ID LEFT JOIN RES_PARTNER t121 ON t111.PARTNER_ID = t121.ID LEFT JOIN RES_PARTNER t131 ON t1.PARTNER_ID = t131.ID LEFT JOIN STOCK_PICKING_TYPE t141 ON t1.PICKING_TYPE_ID = t141.ID LEFT JOIN ACCOUNT_INCOTERMS t151 ON t1.INCOTERM_ID = t151.ID
]]>
</sql>
<!--数据查询[View]-->
<sqlid="View"databaseId="postgresql">
<![CDATA[ SELECT t1.ACCESS_TOKEN, t1.AMOUNT_TAX, t1.AMOUNT_TOTAL, t1.AMOUNT_UNTAXED, t1.COMPANY_ID, t61.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t121.NAME AS CREATE_UID_TEXT, t1.CURRENCY_ID, t41.NAME AS CURRENCY_ID_TEXT, t1.DATE_APPROVE, t1.DATE_ORDER, t1.DATE_PLANNED, t1.DEST_ADDRESS_ID, t71.NAME AS DEST_ADDRESS_ID_TEXT, t1.FISCAL_POSITION_ID, t31.NAME AS FISCAL_POSITION_ID_TEXT, t1.GROUP_ID, t1.ID, t1.INCOTERM_ID, t151.NAME AS INCOTERM_ID_TEXT, t1.INVOICE_COUNT, t1.INVOICE_STATUS, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.NAME, t1.NOTES, t1.ORIGIN, t1.PARTNER_ID, t131.NAME AS PARTNER_ID_TEXT, t1.PARTNER_REF, t1.PAYMENT_TERM_ID, t101.NAME AS PAYMENT_TERM_ID_TEXT, t1.PICKING_COUNT, t1.PICKING_TYPE_ID, t141.NAME AS PICKING_TYPE_ID_TEXT, t1.STATE, t1.USER_ID, t21.NAME AS USER_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t91.NAME AS WRITE_UID_TEXT FROM PURCHASE_ORDER t1 LEFT JOIN RES_USERS t11 ON t1.USER_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN ACCOUNT_FISCAL_POSITION t31 ON t1.FISCAL_POSITION_ID = t31.ID LEFT JOIN RES_CURRENCY t41 ON t1.CURRENCY_ID = t41.ID LEFT JOIN RES_COMPANY t51 ON t1.COMPANY_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN RES_PARTNER t71 ON t1.DEST_ADDRESS_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 ACCOUNT_PAYMENT_TERM t101 ON t1.PAYMENT_TERM_ID = t101.ID LEFT JOIN RES_USERS t111 ON t1.CREATE_UID = t111.ID LEFT JOIN RES_PARTNER t121 ON t111.PARTNER_ID = t121.ID LEFT JOIN RES_PARTNER t131 ON t1.PARTNER_ID = t131.ID LEFT JOIN STOCK_PICKING_TYPE t141 ON t1.PICKING_TYPE_ID = t141.ID LEFT JOIN ACCOUNT_INCOTERMS t151 ON t1.INCOTERM_ID = t151.ID
<![CDATA[ SELECT t1.ACCESS_TOKEN, t1.AMOUNT_TAX, t1.AMOUNT_TOTAL, t1.AMOUNT_UNTAXED, t1.COMPANY_ID, t61.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t121.NAME AS CREATE_UID_TEXT, t1.CURRENCY_ID, t41.NAME AS CURRENCY_ID_TEXT, t1.DATE_APPROVE, t1.DATE_ORDER, t1.DATE_PLANNED, t1.DEST_ADDRESS_ID, t71.NAME AS DEST_ADDRESS_ID_TEXT, t1.FISCAL_POSITION_ID, t31.NAME AS FISCAL_POSITION_ID_TEXT, t1.GROUP_ID, t1.ID, t1.INCOTERM_ID, t151.NAME AS INCOTERM_ID_TEXT, t1.INVOICE_COUNT, t1.INVOICE_STATUS, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.NAME, t1.NOTES, t1.ORIGIN, t1.PARTNER_ID, t131.NAME AS PARTNER_ID_TEXT, t1.PARTNER_REF, t1.PAYMENT_TERM_ID, t101.NAME AS PAYMENT_TERM_ID_TEXT, t1.PICKING_COUNT, t1.PICKING_TYPE_ID, t141.NAME AS PICKING_TYPE_ID_TEXT, t1.REQUISITION_ID, t1.STATE, t1.USER_ID, t21.NAME AS USER_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t91.NAME AS WRITE_UID_TEXT FROM PURCHASE_ORDER t1 LEFT JOIN RES_USERS t11 ON t1.USER_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN ACCOUNT_FISCAL_POSITION t31 ON t1.FISCAL_POSITION_ID = t31.ID LEFT JOIN RES_CURRENCY t41 ON t1.CURRENCY_ID = t41.ID LEFT JOIN RES_COMPANY t51 ON t1.COMPANY_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN RES_PARTNER t71 ON t1.DEST_ADDRESS_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 ACCOUNT_PAYMENT_TERM t101 ON t1.PAYMENT_TERM_ID = t101.ID LEFT JOIN RES_USERS t111 ON t1.CREATE_UID = t111.ID LEFT JOIN RES_PARTNER t121 ON t111.PARTNER_ID = t121.ID LEFT JOIN RES_PARTNER t131 ON t1.PARTNER_ID = t131.ID LEFT JOIN STOCK_PICKING_TYPE t141 ON t1.PICKING_TYPE_ID = t141.ID LEFT JOIN ACCOUNT_INCOTERMS t151 ON t1.INCOTERM_ID = t151.ID