<![CDATA[select t1.* from (SELECT t31.CATEGORY AS ACTIVITY_CATEGORY, t31.DECORATION_TYPE AS ACTIVITY_DECORATION, t1.ACTIVITY_TYPE_ID, t31.NAME AS ACTIVITY_TYPE_ID_TEXT, t1.AUTOMATED, t1.CALENDAR_EVENT_ID, t131.NAME AS CALENDAR_EVENT_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t91.NAME AS CREATE_UID_TEXT, t1.CREATE_USER_ID, t71.NAME AS CREATE_USER_ID_TEXT, t1.DATE_DEADLINE, t1.FEEDBACK, t31.FORCE_NEXT, t31.ICON, t1.ID, t1.NOTE, t1.NOTE_ID, t51.NAME AS NOTE_ID_TEXT, t1.PREVIOUS_ACTIVITY_TYPE_ID, t41.NAME AS PREVIOUS_ACTIVITY_TYPE_ID_TEXT, t1.RECOMMENDED_ACTIVITY_TYPE_ID, t121.NAME AS RECOMMENDED_ACTIVITY_TYPE_ID_TEXT, t1.RES_ID, t1.RES_MODEL, t1.RES_MODEL_ID, t1.RES_NAME, t1.SUMMARY, t1.USER_ID, t21.NAME AS USER_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t111.NAME AS WRITE_UID_TEXT FROM MAIL_ACTIVITY 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 MAIL_ACTIVITY_TYPE t31 ON t1.ACTIVITY_TYPE_ID = t31.ID LEFT JOIN MAIL_ACTIVITY_TYPE t41 ON t1.PREVIOUS_ACTIVITY_TYPE_ID = t41.ID LEFT JOIN NOTE_NOTE t51 ON t1.NOTE_ID = t51.ID LEFT JOIN RES_USERS t61 ON t1.CREATE_USER_ID = t61.ID LEFT JOIN RES_PARTNER t71 ON t61.PARTNER_ID = t71.ID LEFT JOIN RES_USERS t81 ON t1.CREATE_UID = t81.ID LEFT JOIN RES_PARTNER t91 ON t81.PARTNER_ID = t91.ID LEFT JOIN RES_USERS t101 ON t1.WRITE_UID = t101.ID LEFT JOIN RES_PARTNER t111 ON t101.PARTNER_ID = t111.ID LEFT JOIN MAIL_ACTIVITY_TYPE t121 ON t1.RECOMMENDED_ACTIVITY_TYPE_ID = t121.ID LEFT JOIN CALENDAR_EVENT t131 ON t1.CALENDAR_EVENT_ID = t131.ID ) t1 where id=#{id}]]>
<![CDATA[select t1.* from (SELECT t31.CATEGORY AS ACTIVITY_CATEGORY, t31.DECORATION_TYPE AS ACTIVITY_DECORATION, t1.ACTIVITY_TYPE_ID, t31.NAME AS ACTIVITY_TYPE_ID_TEXT, t1.AUTOMATED, t1.CALENDAR_EVENT_ID, t111.NAME AS CALENDAR_EVENT_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t71.NAME AS CREATE_UID_TEXT, t1.DATE_DEADLINE, t1.FEEDBACK, t31.FORCE_NEXT, t31.ICON, t1.ID, t1.NOTE, t1.NOTE_ID, t51.NAME AS NOTE_ID_TEXT, t1.PREVIOUS_ACTIVITY_TYPE_ID, t41.NAME AS PREVIOUS_ACTIVITY_TYPE_ID_TEXT, t1.RECOMMENDED_ACTIVITY_TYPE_ID, t101.NAME AS RECOMMENDED_ACTIVITY_TYPE_ID_TEXT, t1.RES_ID, t1.RES_MODEL, t1.RES_MODEL_ID, t1.RES_NAME, t1.SUMMARY, t1.USER_ID, t21.NAME AS USER_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t91.NAME AS WRITE_UID_TEXT FROM MAIL_ACTIVITY 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 MAIL_ACTIVITY_TYPE t31 ON t1.ACTIVITY_TYPE_ID = t31.ID LEFT JOIN MAIL_ACTIVITY_TYPE t41 ON t1.PREVIOUS_ACTIVITY_TYPE_ID = t41.ID LEFT JOIN NOTE_NOTE t51 ON t1.NOTE_ID = t51.ID LEFT JOIN RES_USERS t61 ON t1.CREATE_UID = t61.ID LEFT JOIN RES_PARTNER t71 ON t61.PARTNER_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 MAIL_ACTIVITY_TYPE t101 ON t1.RECOMMENDED_ACTIVITY_TYPE_ID = t101.ID LEFT JOIN CALENDAR_EVENT t111 ON t1.CALENDAR_EVENT_ID = t111.ID ) t1 where id=#{id}]]>
<![CDATA[ SELECT t31.CATEGORY AS ACTIVITY_CATEGORY, t31.DECORATION_TYPE AS ACTIVITY_DECORATION, t1.ACTIVITY_TYPE_ID, t31.NAME AS ACTIVITY_TYPE_ID_TEXT, t1.AUTOMATED, t1.CALENDAR_EVENT_ID, t121.NAME AS CALENDAR_EVENT_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t81.NAME AS CREATE_UID_TEXT, t1.CREATE_USER_ID, t61.NAME AS CREATE_USER_ID_TEXT, t1.DATE_DEADLINE, t31.FORCE_NEXT, t31.ICON, t1.ID, t1.NOTE_ID, t1.PREVIOUS_ACTIVITY_TYPE_ID, t41.NAME AS PREVIOUS_ACTIVITY_TYPE_ID_TEXT, t1.RECOMMENDED_ACTIVITY_TYPE_ID, t111.NAME AS RECOMMENDED_ACTIVITY_TYPE_ID_TEXT, t1.RES_ID, t1.RES_MODEL, t1.RES_MODEL_ID, t1.RES_NAME, t1.SUMMARY, t1.USER_ID, t21.NAME AS USER_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t101.NAME AS WRITE_UID_TEXT FROM MAIL_ACTIVITY 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 MAIL_ACTIVITY_TYPE t31 ON t1.ACTIVITY_TYPE_ID = t31.ID LEFT JOIN MAIL_ACTIVITY_TYPE t41 ON t1.PREVIOUS_ACTIVITY_TYPE_ID = t41.ID LEFT JOIN RES_USERS t51 ON t1.CREATE_USER_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN RES_USERS t71 ON t1.CREATE_UID = t71.ID LEFT JOIN RES_PARTNER t81 ON t71.PARTNER_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 MAIL_ACTIVITY_TYPE t111 ON t1.RECOMMENDED_ACTIVITY_TYPE_ID = t111.ID LEFT JOIN CALENDAR_EVENT t121 ON t1.CALENDAR_EVENT_ID = t121.ID
<![CDATA[ SELECT t31.CATEGORY AS ACTIVITY_CATEGORY, t31.DECORATION_TYPE AS ACTIVITY_DECORATION, t1.ACTIVITY_TYPE_ID, t31.NAME AS ACTIVITY_TYPE_ID_TEXT, t1.AUTOMATED, t1.CALENDAR_EVENT_ID, t101.NAME AS CALENDAR_EVENT_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t61.NAME AS CREATE_UID_TEXT, t1.DATE_DEADLINE, t31.FORCE_NEXT, t31.ICON, t1.ID, t1.NOTE_ID, t1.PREVIOUS_ACTIVITY_TYPE_ID, t41.NAME AS PREVIOUS_ACTIVITY_TYPE_ID_TEXT, t1.RECOMMENDED_ACTIVITY_TYPE_ID, t91.NAME AS RECOMMENDED_ACTIVITY_TYPE_ID_TEXT, t1.RES_ID, t1.RES_MODEL, t1.RES_MODEL_ID, t1.RES_NAME, t1.SUMMARY, t1.USER_ID, t21.NAME AS USER_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t81.NAME AS WRITE_UID_TEXT FROM MAIL_ACTIVITY 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 MAIL_ACTIVITY_TYPE t31 ON t1.ACTIVITY_TYPE_ID = t31.ID LEFT JOIN MAIL_ACTIVITY_TYPE t41 ON t1.PREVIOUS_ACTIVITY_TYPE_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 RES_USERS t71 ON t1.WRITE_UID = t71.ID LEFT JOIN RES_PARTNER t81 ON t71.PARTNER_ID = t81.ID LEFT JOIN MAIL_ACTIVITY_TYPE t91 ON t1.RECOMMENDED_ACTIVITY_TYPE_ID = t91.ID LEFT JOIN CALENDAR_EVENT t101 ON t1.CALENDAR_EVENT_ID = t101.ID
]]>
</sql>
<!--数据查询[View]-->
<sqlid="View"databaseId="postgresql">
<![CDATA[ SELECT t31.CATEGORY AS ACTIVITY_CATEGORY, t31.DECORATION_TYPE AS ACTIVITY_DECORATION, t1.ACTIVITY_TYPE_ID, t31.NAME AS ACTIVITY_TYPE_ID_TEXT, t1.AUTOMATED, t1.CALENDAR_EVENT_ID, t131.NAME AS CALENDAR_EVENT_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t91.NAME AS CREATE_UID_TEXT, t1.CREATE_USER_ID, t71.NAME AS CREATE_USER_ID_TEXT, t1.DATE_DEADLINE, t1.FEEDBACK, t31.FORCE_NEXT, t31.ICON, t1.ID, t1.NOTE, t1.NOTE_ID, t51.NAME AS NOTE_ID_TEXT, t1.PREVIOUS_ACTIVITY_TYPE_ID, t41.NAME AS PREVIOUS_ACTIVITY_TYPE_ID_TEXT, t1.RECOMMENDED_ACTIVITY_TYPE_ID, t121.NAME AS RECOMMENDED_ACTIVITY_TYPE_ID_TEXT, t1.RES_ID, t1.RES_MODEL, t1.RES_MODEL_ID, t1.RES_NAME, t1.SUMMARY, t1.USER_ID, t21.NAME AS USER_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t111.NAME AS WRITE_UID_TEXT FROM MAIL_ACTIVITY 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 MAIL_ACTIVITY_TYPE t31 ON t1.ACTIVITY_TYPE_ID = t31.ID LEFT JOIN MAIL_ACTIVITY_TYPE t41 ON t1.PREVIOUS_ACTIVITY_TYPE_ID = t41.ID LEFT JOIN NOTE_NOTE t51 ON t1.NOTE_ID = t51.ID LEFT JOIN RES_USERS t61 ON t1.CREATE_USER_ID = t61.ID LEFT JOIN RES_PARTNER t71 ON t61.PARTNER_ID = t71.ID LEFT JOIN RES_USERS t81 ON t1.CREATE_UID = t81.ID LEFT JOIN RES_PARTNER t91 ON t81.PARTNER_ID = t91.ID LEFT JOIN RES_USERS t101 ON t1.WRITE_UID = t101.ID LEFT JOIN RES_PARTNER t111 ON t101.PARTNER_ID = t111.ID LEFT JOIN MAIL_ACTIVITY_TYPE t121 ON t1.RECOMMENDED_ACTIVITY_TYPE_ID = t121.ID LEFT JOIN CALENDAR_EVENT t131 ON t1.CALENDAR_EVENT_ID = t131.ID
<![CDATA[ SELECT t31.CATEGORY AS ACTIVITY_CATEGORY, t31.DECORATION_TYPE AS ACTIVITY_DECORATION, t1.ACTIVITY_TYPE_ID, t31.NAME AS ACTIVITY_TYPE_ID_TEXT, t1.AUTOMATED, t1.CALENDAR_EVENT_ID, t111.NAME AS CALENDAR_EVENT_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t71.NAME AS CREATE_UID_TEXT, t1.DATE_DEADLINE, t1.FEEDBACK, t31.FORCE_NEXT, t31.ICON, t1.ID, t1.NOTE, t1.NOTE_ID, t51.NAME AS NOTE_ID_TEXT, t1.PREVIOUS_ACTIVITY_TYPE_ID, t41.NAME AS PREVIOUS_ACTIVITY_TYPE_ID_TEXT, t1.RECOMMENDED_ACTIVITY_TYPE_ID, t101.NAME AS RECOMMENDED_ACTIVITY_TYPE_ID_TEXT, t1.RES_ID, t1.RES_MODEL, t1.RES_MODEL_ID, t1.RES_NAME, t1.SUMMARY, t1.USER_ID, t21.NAME AS USER_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t91.NAME AS WRITE_UID_TEXT FROM MAIL_ACTIVITY 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 MAIL_ACTIVITY_TYPE t31 ON t1.ACTIVITY_TYPE_ID = t31.ID LEFT JOIN MAIL_ACTIVITY_TYPE t41 ON t1.PREVIOUS_ACTIVITY_TYPE_ID = t41.ID LEFT JOIN NOTE_NOTE t51 ON t1.NOTE_ID = t51.ID LEFT JOIN RES_USERS t61 ON t1.CREATE_UID = t61.ID LEFT JOIN RES_PARTNER t71 ON t61.PARTNER_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 MAIL_ACTIVITY_TYPE t101 ON t1.RECOMMENDED_ACTIVITY_TYPE_ID = t101.ID LEFT JOIN CALENDAR_EVENT t111 ON t1.CALENDAR_EVENT_ID = t111.ID