<![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}]]>
<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 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
]]>
</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 t1.* from (SELECT t1.ACTIVE, t1.CATEGORY, t1.CREATE_DATE, t1.CREATE_UID, t51.NAME AS CREATE_UID_TEXT, t1.DECORATION_TYPE, t1.DEFAULT_NEXT_TYPE_ID, t11.NAME AS DEFAULT_NEXT_TYPE_ID_TEXT, t1.DELAY_COUNT, t1.DELAY_FROM, t1.DELAY_UNIT, t1.FORCE_NEXT, t1.ICON, t1.ID, t1.NAME, t1.RES_MODEL_ID, t1.SEQUENCE, t1.SUMMARY, t1.WRITE_DATE, t1.WRITE_UID, t31.NAME AS WRITE_UID_TEXT FROM MAIL_ACTIVITY_TYPE t1 LEFT JOIN MAIL_ACTIVITY_TYPE t11 ON t1.DEFAULT_NEXT_TYPE_ID = t11.ID LEFT JOIN RES_USERS t21 ON t1.WRITE_UID = t21.ID LEFT JOIN RES_PARTNER t31 ON t21.PARTNER_ID = t31.ID LEFT JOIN RES_USERS t41 ON t1.CREATE_UID = t41.ID LEFT JOIN RES_PARTNER t51 ON t41.PARTNER_ID = t51.ID ) t1 where id=#{id}]]>
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Mail_activity-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Mail_activity-Get')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Mail_activity-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Mail_activity-Get')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Mail_activity_type-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Mail_activity_type-Get')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Mail_activity_type-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Mail_activity_type-Get')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Res_currency-searchDEFAULT-all') and hasPermission(#context,'iBizBusinessCentral-Res_currency-Get')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Res_currency-searchDEFAULT-all') and hasPermission(#context,'iBizBusinessCentral-Res_currency-Get')")