<![CDATA[select t1.* from (SELECT (SELECT ARRAY_TO_JSON(ARRAY_AGG(T.*)) FROM (SELECT M2.ID AS SRFKEY, M2.NAME AS SRFMAJORTEXT FROM RES_PARTNER_RES_PARTNER_CATEGORY_REL M1 LEFT JOIN RES_PARTNER_CATEGORY M2 ON M1.CATEGORY_ID = M2.ID WHERE M1.PARTNER_ID =T1.ID ) T) AS CATEGORY_ID, t1.EMAIL, t1.FUNCTION, t1.ID, t1.MOBILE, t1.NAME, t1.PHONE, t1.ID AS PROPERTY_SUPPLIER_PAYMENT_TERM_ID, t11.NAME AS PROPERTY_SUPPLIER_PAYMENT_TERM_NAME, t1.TYPE, t1.VAT FROM RES_PARTNER t1 LEFT JOIN ACCOUNT_PAYMENT_TERM t11 ON t1.ID = t11.ID ) t1 where id=#{id}]]>
<![CDATA[select t1.* from (SELECT (SELECT ARRAY_TO_JSON(ARRAY_AGG(T.*)) FROM (SELECT M2.ID AS SRFKEY, M2.NAME AS SRFMAJORTEXT FROM RES_PARTNER_RES_PARTNER_CATEGORY_REL M1 LEFT JOIN RES_PARTNER_CATEGORY M2 ON M1.CATEGORY_ID = M2.ID WHERE M1.PARTNER_ID =T1.ID ) T) AS CATEGORY_ID, t1.EMAIL, t1.FUNCTION, t1.ID, t1.MOBILE, t1.NAME, t1.PHONE, t1.PROPERTY_SUPPLIER_PAYMENT_TERM_ID, t11.NAME AS PROPERTY_SUPPLIER_PAYMENT_TERM_NAME, t1.TYPE, t1.VAT FROM RES_PARTNER t1 LEFT JOIN ACCOUNT_PAYMENT_TERM t11 ON t1.PROPERTY_SUPPLIER_PAYMENT_TERM_ID = t11.ID ) t1 where id=#{id}]]>
<![CDATA[ SELECT t1.EMAIL, t1.FUNCTION, t1.ID, t1.MOBILE, t1.NAME, t1.PHONE, t1.ID AS PROPERTY_SUPPLIER_PAYMENT_TERM_ID, t11.NAME AS PROPERTY_SUPPLIER_PAYMENT_TERM_NAME, t1.TYPE, t1.VAT FROM RES_PARTNER t1 LEFT JOIN ACCOUNT_PAYMENT_TERM t11 ON t1.ID = t11.ID
<![CDATA[ SELECT t1.EMAIL, t1.FUNCTION, t1.ID, t1.MOBILE, t1.NAME, t1.PHONE, t1.PROPERTY_SUPPLIER_PAYMENT_TERM_ID, t11.NAME AS PROPERTY_SUPPLIER_PAYMENT_TERM_NAME, t1.TYPE, t1.VAT FROM RES_PARTNER t1 LEFT JOIN ACCOUNT_PAYMENT_TERM t11 ON t1.PROPERTY_SUPPLIER_PAYMENT_TERM_ID = t11.ID
]]>
</sql>
<!--数据查询[View]-->
<sqlid="View"databaseId="postgresql">
<![CDATA[ SELECT (SELECT ARRAY_TO_JSON(ARRAY_AGG(T.*)) FROM (SELECT M2.ID AS SRFKEY, M2.NAME AS SRFMAJORTEXT FROM RES_PARTNER_RES_PARTNER_CATEGORY_REL M1 LEFT JOIN RES_PARTNER_CATEGORY M2 ON M1.CATEGORY_ID = M2.ID WHERE M1.PARTNER_ID =T1.ID ) T) AS CATEGORY_ID, t1.EMAIL, t1.FUNCTION, t1.ID, t1.MOBILE, t1.NAME, t1.PHONE, t1.ID AS PROPERTY_SUPPLIER_PAYMENT_TERM_ID, t11.NAME AS PROPERTY_SUPPLIER_PAYMENT_TERM_NAME, t1.TYPE, t1.VAT FROM RES_PARTNER t1 LEFT JOIN ACCOUNT_PAYMENT_TERM t11 ON t1.ID = t11.ID
<![CDATA[ SELECT (SELECT ARRAY_TO_JSON(ARRAY_AGG(T.*)) FROM (SELECT M2.ID AS SRFKEY, M2.NAME AS SRFMAJORTEXT FROM RES_PARTNER_RES_PARTNER_CATEGORY_REL M1 LEFT JOIN RES_PARTNER_CATEGORY M2 ON M1.CATEGORY_ID = M2.ID WHERE M1.PARTNER_ID =T1.ID ) T) AS CATEGORY_ID, t1.EMAIL, t1.FUNCTION, t1.ID, t1.MOBILE, t1.NAME, t1.PHONE, t1.PROPERTY_SUPPLIER_PAYMENT_TERM_ID, t11.NAME AS PROPERTY_SUPPLIER_PAYMENT_TERM_NAME, t1.TYPE, t1.VAT FROM RES_PARTNER t1 LEFT JOIN ACCOUNT_PAYMENT_TERM t11 ON t1.PROPERTY_SUPPLIER_PAYMENT_TERM_ID = t11.ID