mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
MOB-452: Collapsed Activities iBatis mappings into two core files, with the *-insert-SqlMap.xml being overridden per dialect
- Paving way for introduction of more configuration files without config blow-out git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13734 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -6,11 +6,7 @@
|
|||||||
|
|
||||||
<sqlMapConfig>
|
<sqlMapConfig>
|
||||||
|
|
||||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/ActivityPost-common-SqlMap.xml"/>
|
<sqlMap resource="alfresco/ibatis/#resource.dialect#/activities-common-SqlMap.xml"/>
|
||||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/ActivityFeed-common-SqlMap.xml"/>
|
<sqlMap resource="alfresco/ibatis/#resource.dialect#/activities-insert-SqlMap.xml"/>
|
||||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/ActivityFeedControl-common-SqlMap.xml"/>
|
|
||||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/ActivityPost-insert-SqlMap.xml"/>
|
|
||||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/ActivityFeed-insert-SqlMap.xml"/>
|
|
||||||
<sqlMap resource="alfresco/ibatis/#resource.dialect#/ActivityFeedControl-insert-SqlMap.xml"/>
|
|
||||||
|
|
||||||
</sqlMapConfig>
|
</sqlMapConfig>
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="iBatisDataSource" class="org.springframework.aop.framework.ProxyFactoryBean">
|
<bean id="activitiesDataSource" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||||
<property name="proxyInterfaces">
|
<property name="proxyInterfaces">
|
||||||
<value>javax.sql.DataSource</value>
|
<value>javax.sql.DataSource</value>
|
||||||
</property>
|
</property>
|
||||||
@@ -38,11 +38,24 @@
|
|||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="activitiesSqlMapClient" class="org.alfresco.ibatis.HierarchicalSqlMapClientFactoryBean" singleton="true">
|
<bean id="activitiesSqlMapClient" class="org.alfresco.ibatis.HierarchicalSqlMapClientFactoryBean" singleton="true">
|
||||||
<property name="dataSource" ref="iBatisDataSource"/>
|
<property name="dataSource" ref="activitiesDataSource"/>
|
||||||
<property name="resourceLoader" ref="dialectResourceLoader" />
|
<property name="resourceLoader" ref="dialectResourceLoader" />
|
||||||
<property name="configLocation">
|
<property name="configLocation">
|
||||||
<value>classpath:alfresco/ibatis/activities-SqlMapConfig.xml</value>
|
<value>classpath:alfresco/ibatis/activities-SqlMapConfig.xml</value>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Root iBatis configuration for the DM nodes
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
<bean id="dmNodeSqlMapClient" class="org.alfresco.ibatis.HierarchicalSqlMapClientFactoryBean" singleton="true">
|
||||||
|
<property name="dataSource" ref="dataSource"/>
|
||||||
|
<property name="resourceLoader" ref="dialectResourceLoader" />
|
||||||
|
<property name="configLocation">
|
||||||
|
<value>classpath:alfresco/ibatis/dmNode-SqlMapConfig.xml</value>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
-->
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
|
@@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
|
|
||||||
<!DOCTYPE sqlMap
|
|
||||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
|
||||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
|
||||||
|
|
||||||
<sqlMap namespace="ActivityFeed">
|
|
||||||
|
|
||||||
<insert id="insert.activity.feed" parameterClass="ActivityFeed">
|
|
||||||
insert into alf_activity_feed (id, activity_type, activity_summary, activity_format, feed_user_id, post_user_id, post_date, post_id, site_network, app_tool, feed_date)
|
|
||||||
values (DEFAULT, #activityType#, #activitySummary#, #activitySummaryFormat#, #feedUserId#, #postUserId#, #postDate#, #postId#, #siteNetwork#, #appTool#, #feedDate#)
|
|
||||||
|
|
||||||
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
|
|
||||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
|
||||||
values IDENTITY_VAL_LOCAL()
|
|
||||||
</selectKey>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
</sqlMap>
|
|
@@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
|
|
||||||
<!DOCTYPE sqlMap
|
|
||||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
|
||||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
|
||||||
|
|
||||||
<sqlMap namespace="ActivityFeedControl">
|
|
||||||
|
|
||||||
<insert id="insert.activity.feedcontrol" parameterClass="FeedControl">
|
|
||||||
insert into alf_activity_feed_control (id, feed_user_id, site_network, app_tool, last_modified)
|
|
||||||
values (DEFAULT, #feedUserId#, #siteNetwork#, #appTool#, #lastModified#)
|
|
||||||
|
|
||||||
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
|
|
||||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
|
||||||
values IDENTITY_VAL_LOCAL()
|
|
||||||
</selectKey>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
</sqlMap>
|
|
@@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
|
|
||||||
<!DOCTYPE sqlMap
|
|
||||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
|
||||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
|
||||||
|
|
||||||
<sqlMap namespace="ActivityPost">
|
|
||||||
|
|
||||||
<insert id="insert.activity.post" parameterClass="ActivityPost">
|
|
||||||
insert into alf_activity_post (sequence_id, status, activity_data, post_user_id, post_date, activity_type, site_network, app_tool, job_task_node, last_modified)
|
|
||||||
values (DEFAULT, #status#, #activityData#, #userId#, #postDate#, #activityType#, #siteNetwork#, #appTool#, #jobTaskNode#, #lastModified#)
|
|
||||||
|
|
||||||
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
|
|
||||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
|
||||||
values IDENTITY_VAL_LOCAL()
|
|
||||||
</selectKey>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
</sqlMap>
|
|
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<!DOCTYPE sqlMap
|
||||||
|
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||||
|
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||||
|
|
||||||
|
<sqlMap namespace="activities">
|
||||||
|
|
||||||
|
<insert id="insert.activity.feedcontrol" parameterClass="FeedControl">
|
||||||
|
insert into alf_activity_feed_control (id, feed_user_id, site_network, app_tool, last_modified)
|
||||||
|
values (DEFAULT, #feedUserId#, #siteNetwork#, #appTool#, #lastModified#)
|
||||||
|
|
||||||
|
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
|
||||||
|
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||||
|
values IDENTITY_VAL_LOCAL()
|
||||||
|
</selectKey>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insert.activity.feed" parameterClass="ActivityFeed">
|
||||||
|
insert into alf_activity_feed (id, activity_type, activity_summary, activity_format, feed_user_id, post_user_id, post_date, post_id, site_network, app_tool, feed_date)
|
||||||
|
values (DEFAULT, #activityType#, #activitySummary#, #activitySummaryFormat#, #feedUserId#, #postUserId#, #postDate#, #postId#, #siteNetwork#, #appTool#, #feedDate#)
|
||||||
|
|
||||||
|
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
|
||||||
|
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||||
|
values IDENTITY_VAL_LOCAL()
|
||||||
|
</selectKey>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insert.activity.post" parameterClass="ActivityPost">
|
||||||
|
insert into alf_activity_post (sequence_id, status, activity_data, post_user_id, post_date, activity_type, site_network, app_tool, job_task_node, last_modified)
|
||||||
|
values (DEFAULT, #status#, #activityData#, #userId#, #postDate#, #activityType#, #siteNetwork#, #appTool#, #jobTaskNode#, #lastModified#)
|
||||||
|
|
||||||
|
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
|
||||||
|
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||||
|
values IDENTITY_VAL_LOCAL()
|
||||||
|
</selectKey>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
</sqlMap>
|
@@ -1,64 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
|
|
||||||
<!DOCTYPE sqlMap
|
|
||||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
|
||||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
|
||||||
|
|
||||||
<sqlMap namespace="ActivityFeed">
|
|
||||||
|
|
||||||
<typeAlias alias="ActivityFeed" type="org.alfresco.repo.activities.feed.ActivityFeedDAO"/>
|
|
||||||
|
|
||||||
<resultMap id="ActivityFeedResult" class="ActivityFeed">
|
|
||||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
|
||||||
<result property="feedUserId" column="feed_user_id"/>
|
|
||||||
<result property="postUserId" column="post_user_id"/>
|
|
||||||
<result property="postDate" column="post_date"/>
|
|
||||||
<result property="postId" column="post_id"/> <!-- not an explicit FK constraint, can dangle if and when activity post is deleted -->
|
|
||||||
<result property="siteNetwork" column="site_network"/>
|
|
||||||
<result property="activityType" column="activity_type"/>
|
|
||||||
<result property="activitySummary" column="activity_summary"/>
|
|
||||||
<result property="activitySummaryFormat" column="activity_format"/>
|
|
||||||
<result property="feedDate" column="feed_date"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<select id="select.activity.feed.for.feeduser" parameterClass="ActivityFeed" resultClass="ActivityFeed">
|
|
||||||
<![CDATA[
|
|
||||||
select id as id, activity_type as activityType, activity_format as activitySummaryFormat, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date as postDate
|
|
||||||
from alf_activity_feed
|
|
||||||
where feed_user_id = #feedUserId#
|
|
||||||
and post_user_id != #feedUserId#
|
|
||||||
and activity_format = #activitySummaryFormat#
|
|
||||||
order by post_date desc
|
|
||||||
]]>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="select.activity.feed.for.feeduser.and.site" parameterClass="ActivityFeed" resultClass="ActivityFeed">
|
|
||||||
<![CDATA[
|
|
||||||
select id as id, activity_type as activityType, activity_format as activitySummaryFormat, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date as postDate
|
|
||||||
from alf_activity_feed
|
|
||||||
where feed_user_id = #feedUserId#
|
|
||||||
and post_user_id != #feedUserId#
|
|
||||||
and site_network = #siteNetwork#
|
|
||||||
and activity_format = #activitySummaryFormat#
|
|
||||||
order by post_date desc
|
|
||||||
]]>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="select.activity.feed.for.site" parameterClass="ActivityFeed" resultClass="ActivityFeed">
|
|
||||||
<![CDATA[
|
|
||||||
select id as id, activity_type as activityType, activity_format as activitySummaryFormat, activity_summary as activitySummary, post_user_id as postUserId, site_network as siteNetwork, post_date as postDate
|
|
||||||
from alf_activity_feed
|
|
||||||
where (feed_user_id = '' or feed_user_id is null)
|
|
||||||
and site_network = #siteNetwork#
|
|
||||||
and activity_format = #activitySummaryFormat#
|
|
||||||
order by post_date desc
|
|
||||||
]]>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<delete id="delete.activity.feed.entries.older.than.date" parameterClass="Date">
|
|
||||||
<![CDATA[
|
|
||||||
delete from alf_activity_feed where post_date < #keepdate#
|
|
||||||
]]>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
</sqlMap>
|
|
@@ -1,46 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
|
|
||||||
<!DOCTYPE sqlMap
|
|
||||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
|
||||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
|
||||||
|
|
||||||
<sqlMap namespace="ActivityFeedControl">
|
|
||||||
|
|
||||||
<typeAlias alias="FeedControl" type="org.alfresco.repo.activities.feed.control.FeedControlDAO"/>
|
|
||||||
|
|
||||||
<resultMap id="FeedControlResult" class="FeedControl">
|
|
||||||
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
|
||||||
<result property="feedUserId" column="feed_user_id"/>
|
|
||||||
<result property="siteNetwork" column="site_network"/>
|
|
||||||
<result property="appTool" column="app_tool"/>
|
|
||||||
<result property="lastModified" column="last_modified"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<select id="select.activity.feedcontrols.for.user" parameterClass="FeedControl" resultClass="FeedControl">
|
|
||||||
<![CDATA[
|
|
||||||
select id as id, feed_user_id as feedUserId, site_network as siteNetwork, app_tool as appTool
|
|
||||||
from alf_activity_feed_control
|
|
||||||
where feed_user_id = #feedUserId#
|
|
||||||
]]>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="select.activity.feedcontrol" parameterClass="FeedControl" resultClass="long">
|
|
||||||
<![CDATA[
|
|
||||||
select id as id
|
|
||||||
from alf_activity_feed_control
|
|
||||||
where feed_user_id = #feedUserId#
|
|
||||||
and site_network = #siteNetwork#
|
|
||||||
and app_tool = #appTool#
|
|
||||||
]]>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<delete id="delete.activity.feedcontrol" parameterClass="FeedControl">
|
|
||||||
<![CDATA[
|
|
||||||
delete from alf_activity_feed_control
|
|
||||||
where feed_user_id = #feedUserId#
|
|
||||||
and site_network = #siteNetwork#
|
|
||||||
and app_tool = #appTool#
|
|
||||||
]]>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
</sqlMap>
|
|
@@ -1,103 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
|
|
||||||
<!DOCTYPE sqlMap
|
|
||||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
|
||||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
|
||||||
|
|
||||||
<sqlMap namespace="ActivityPost">
|
|
||||||
|
|
||||||
<typeAlias alias="ActivityPost" type="org.alfresco.repo.activities.post.ActivityPostDAO"/>
|
|
||||||
|
|
||||||
<resultMap id="ActivityPostResult" class="ActivityPost">
|
|
||||||
<result property="id" column="sequence_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
|
||||||
<result property="activityData" column="activity_data"/>
|
|
||||||
<result property="activityType" column="activity_type"/>
|
|
||||||
<result property="userId" column="post_user_id"/>
|
|
||||||
<result property="postDate" column="post_date"/>
|
|
||||||
<result property="jobTaskNode" column="job_task_node"/>
|
|
||||||
<result property="siteNetwork" column="site_network"/>
|
|
||||||
<result property="appTool" column="app_tool"/>
|
|
||||||
<result property="status" column="status"/>
|
|
||||||
<result property="lastModified" column="last_modified"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<select id="select.activity.posts" parameterClass="ActivityPost" resultClass="ActivityPost">
|
|
||||||
<![CDATA[
|
|
||||||
select
|
|
||||||
sequence_id as id,
|
|
||||||
activity_data as activityData,
|
|
||||||
activity_type as activityType,
|
|
||||||
post_user_id as userId,
|
|
||||||
post_date as postDate,
|
|
||||||
job_task_node as jobTaskNode,
|
|
||||||
site_network as siteNetwork,
|
|
||||||
app_tool as appTool,
|
|
||||||
status as status
|
|
||||||
from
|
|
||||||
alf_activity_post
|
|
||||||
where
|
|
||||||
job_task_node = #jobTaskNode# and
|
|
||||||
sequence_id >= #minId# and
|
|
||||||
sequence_id <= #maxId# and
|
|
||||||
status = #status#
|
|
||||||
]]>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="select.activity.posts.by.status.only" parameterClass="ActivityPost" resultClass="ActivityPost">
|
|
||||||
<![CDATA[
|
|
||||||
select
|
|
||||||
sequence_id as id,
|
|
||||||
activity_data as activityData,
|
|
||||||
activity_type as activityType,
|
|
||||||
post_user_id as userId,
|
|
||||||
post_date as postDate,
|
|
||||||
job_task_node as jobTaskNode,
|
|
||||||
site_network as siteNetwork,
|
|
||||||
app_tool as appTool,
|
|
||||||
status as status
|
|
||||||
from
|
|
||||||
alf_activity_post
|
|
||||||
where
|
|
||||||
status = #status#
|
|
||||||
]]>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="select.activity.post.max.seq" resultClass="long">
|
|
||||||
select max(sequence_id) as maxId
|
|
||||||
from alf_activity_post
|
|
||||||
where status = 'POSTED'
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="select.activity.post.min.seq" resultClass="long">
|
|
||||||
select min(sequence_id) as minId
|
|
||||||
from alf_activity_post
|
|
||||||
where status = 'POSTED'
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="select.activity.post.max.jobtasknode" resultClass="int">
|
|
||||||
select max(job_task_node) as maxJobTaskNode
|
|
||||||
from alf_activity_post
|
|
||||||
where status = 'POSTED'
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<delete id="delete.activity.posts.older.than.date" parameterClass="ActivityPost">
|
|
||||||
<![CDATA[
|
|
||||||
delete from alf_activity_post
|
|
||||||
where post_date < #postDate#
|
|
||||||
and status = #status#
|
|
||||||
]]>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<update id="update.activity.post.data" parameterClass="ActivityPost">
|
|
||||||
update alf_activity_post set status = #status#, activity_data=#activityData#, site_network=#siteNetwork#, last_modified=#lastModified#
|
|
||||||
where sequence_id = #id#
|
|
||||||
and status != #status#
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<update id="update.activity.post.status" parameterClass="ActivityPost">
|
|
||||||
update alf_activity_post set status = #status#, last_modified=#lastModified#
|
|
||||||
where sequence_id = #id#
|
|
||||||
and status != #status#
|
|
||||||
</update>
|
|
||||||
|
|
||||||
</sqlMap>
|
|
@@ -0,0 +1,193 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<!DOCTYPE sqlMap
|
||||||
|
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||||
|
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||||
|
|
||||||
|
<sqlMap namespace="activities">
|
||||||
|
|
||||||
|
<typeAlias alias="ActivityFeed" type="org.alfresco.repo.activities.feed.ActivityFeedDAO"/>
|
||||||
|
<typeAlias alias="FeedControl" type="org.alfresco.repo.activities.feed.control.FeedControlDAO"/>
|
||||||
|
<typeAlias alias="ActivityPost" type="org.alfresco.repo.activities.post.ActivityPostDAO"/>
|
||||||
|
|
||||||
|
<resultMap id="ActivityFeedResult" class="ActivityFeed">
|
||||||
|
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||||
|
<result property="feedUserId" column="feed_user_id"/>
|
||||||
|
<result property="postUserId" column="post_user_id"/>
|
||||||
|
<result property="postDate" column="post_date"/>
|
||||||
|
<result property="postId" column="post_id"/> <!-- not an explicit FK constraint, can dangle if and when activity post is deleted -->
|
||||||
|
<result property="siteNetwork" column="site_network"/>
|
||||||
|
<result property="activityType" column="activity_type"/>
|
||||||
|
<result property="activitySummary" column="activity_summary"/>
|
||||||
|
<result property="activitySummaryFormat" column="activity_format"/>
|
||||||
|
<result property="feedDate" column="feed_date"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="FeedControlResult" class="FeedControl">
|
||||||
|
<result property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||||
|
<result property="feedUserId" column="feed_user_id"/>
|
||||||
|
<result property="siteNetwork" column="site_network"/>
|
||||||
|
<result property="appTool" column="app_tool"/>
|
||||||
|
<result property="lastModified" column="last_modified"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="ActivityPostResult" class="ActivityPost">
|
||||||
|
<result property="id" column="sequence_id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||||
|
<result property="activityData" column="activity_data"/>
|
||||||
|
<result property="activityType" column="activity_type"/>
|
||||||
|
<result property="userId" column="post_user_id"/>
|
||||||
|
<result property="postDate" column="post_date"/>
|
||||||
|
<result property="jobTaskNode" column="job_task_node"/>
|
||||||
|
<result property="siteNetwork" column="site_network"/>
|
||||||
|
<result property="appTool" column="app_tool"/>
|
||||||
|
<result property="status" column="status"/>
|
||||||
|
<result property="lastModified" column="last_modified"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="select.activity.feed.for.feeduser" parameterClass="ActivityFeed" resultClass="ActivityFeed">
|
||||||
|
<![CDATA[
|
||||||
|
select id as id, activity_type as activityType, activity_format as activitySummaryFormat, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date as postDate
|
||||||
|
from alf_activity_feed
|
||||||
|
where feed_user_id = #feedUserId#
|
||||||
|
and post_user_id != #feedUserId#
|
||||||
|
and activity_format = #activitySummaryFormat#
|
||||||
|
order by post_date desc
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="select.activity.feed.for.feeduser.and.site" parameterClass="ActivityFeed" resultClass="ActivityFeed">
|
||||||
|
<![CDATA[
|
||||||
|
select id as id, activity_type as activityType, activity_format as activitySummaryFormat, activity_summary as activitySummary, feed_user_id as feedUserId, post_user_id as postUserId, site_network as siteNetwork, post_date as postDate
|
||||||
|
from alf_activity_feed
|
||||||
|
where feed_user_id = #feedUserId#
|
||||||
|
and post_user_id != #feedUserId#
|
||||||
|
and site_network = #siteNetwork#
|
||||||
|
and activity_format = #activitySummaryFormat#
|
||||||
|
order by post_date desc
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="select.activity.feed.for.site" parameterClass="ActivityFeed" resultClass="ActivityFeed">
|
||||||
|
<![CDATA[
|
||||||
|
select id as id, activity_type as activityType, activity_format as activitySummaryFormat, activity_summary as activitySummary, post_user_id as postUserId, site_network as siteNetwork, post_date as postDate
|
||||||
|
from alf_activity_feed
|
||||||
|
where (feed_user_id = '' or feed_user_id is null)
|
||||||
|
and site_network = #siteNetwork#
|
||||||
|
and activity_format = #activitySummaryFormat#
|
||||||
|
order by post_date desc
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="delete.activity.feed.entries.older.than.date" parameterClass="Date">
|
||||||
|
<![CDATA[
|
||||||
|
delete from alf_activity_feed where post_date < #keepdate#
|
||||||
|
]]>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="select.activity.feedcontrols.for.user" parameterClass="FeedControl" resultClass="FeedControl">
|
||||||
|
<![CDATA[
|
||||||
|
select id as id, feed_user_id as feedUserId, site_network as siteNetwork, app_tool as appTool
|
||||||
|
from alf_activity_feed_control
|
||||||
|
where feed_user_id = #feedUserId#
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="select.activity.feedcontrol" parameterClass="FeedControl" resultClass="long">
|
||||||
|
<![CDATA[
|
||||||
|
select id as id
|
||||||
|
from alf_activity_feed_control
|
||||||
|
where feed_user_id = #feedUserId#
|
||||||
|
and site_network = #siteNetwork#
|
||||||
|
and app_tool = #appTool#
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="delete.activity.feedcontrol" parameterClass="FeedControl">
|
||||||
|
<![CDATA[
|
||||||
|
delete from alf_activity_feed_control
|
||||||
|
where feed_user_id = #feedUserId#
|
||||||
|
and site_network = #siteNetwork#
|
||||||
|
and app_tool = #appTool#
|
||||||
|
]]>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="select.activity.posts" parameterClass="ActivityPost" resultClass="ActivityPost">
|
||||||
|
<![CDATA[
|
||||||
|
select
|
||||||
|
sequence_id as id,
|
||||||
|
activity_data as activityData,
|
||||||
|
activity_type as activityType,
|
||||||
|
post_user_id as userId,
|
||||||
|
post_date as postDate,
|
||||||
|
job_task_node as jobTaskNode,
|
||||||
|
site_network as siteNetwork,
|
||||||
|
app_tool as appTool,
|
||||||
|
status as status
|
||||||
|
from
|
||||||
|
alf_activity_post
|
||||||
|
where
|
||||||
|
job_task_node = #jobTaskNode# and
|
||||||
|
sequence_id >= #minId# and
|
||||||
|
sequence_id <= #maxId# and
|
||||||
|
status = #status#
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="select.activity.posts.by.status.only" parameterClass="ActivityPost" resultClass="ActivityPost">
|
||||||
|
<![CDATA[
|
||||||
|
select
|
||||||
|
sequence_id as id,
|
||||||
|
activity_data as activityData,
|
||||||
|
activity_type as activityType,
|
||||||
|
post_user_id as userId,
|
||||||
|
post_date as postDate,
|
||||||
|
job_task_node as jobTaskNode,
|
||||||
|
site_network as siteNetwork,
|
||||||
|
app_tool as appTool,
|
||||||
|
status as status
|
||||||
|
from
|
||||||
|
alf_activity_post
|
||||||
|
where
|
||||||
|
status = #status#
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="select.activity.post.max.seq" resultClass="long">
|
||||||
|
select max(sequence_id) as maxId
|
||||||
|
from alf_activity_post
|
||||||
|
where status = 'POSTED'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="select.activity.post.min.seq" resultClass="long">
|
||||||
|
select min(sequence_id) as minId
|
||||||
|
from alf_activity_post
|
||||||
|
where status = 'POSTED'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="select.activity.post.max.jobtasknode" resultClass="int">
|
||||||
|
select max(job_task_node) as maxJobTaskNode
|
||||||
|
from alf_activity_post
|
||||||
|
where status = 'POSTED'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="delete.activity.posts.older.than.date" parameterClass="ActivityPost">
|
||||||
|
<![CDATA[
|
||||||
|
delete from alf_activity_post
|
||||||
|
where post_date < #postDate#
|
||||||
|
and status = #status#
|
||||||
|
]]>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<update id="update.activity.post.data" parameterClass="ActivityPost">
|
||||||
|
update alf_activity_post set status = #status#, activity_data=#activityData#, site_network=#siteNetwork#, last_modified=#lastModified#
|
||||||
|
where sequence_id = #id#
|
||||||
|
and status != #status#
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="update.activity.post.status" parameterClass="ActivityPost">
|
||||||
|
update alf_activity_post set status = #status#, last_modified=#lastModified#
|
||||||
|
where sequence_id = #id#
|
||||||
|
and status != #status#
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</sqlMap>
|
@@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
|
|
||||||
<!DOCTYPE sqlMap
|
|
||||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
|
||||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
|
||||||
|
|
||||||
<sqlMap namespace="ActivityFeed">
|
|
||||||
|
|
||||||
<insert id="insert.activity.feed" parameterClass="ActivityFeed">
|
|
||||||
|
|
||||||
insert into alf_activity_feed (activity_type, activity_summary, activity_format, feed_user_id, post_user_id, post_date, post_id, site_network, app_tool, feed_date)
|
|
||||||
values (#activityType#, #activitySummary#, #activitySummaryFormat#, #feedUserId#, #postUserId#, #postDate#, #postId#, #siteNetwork#, #appTool#, #feedDate#)
|
|
||||||
|
|
||||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
|
||||||
KEY_COLUMN:GENERATED_KEY
|
|
||||||
</selectKey>
|
|
||||||
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
</sqlMap>
|
|
@@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
|
|
||||||
<!DOCTYPE sqlMap
|
|
||||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
|
||||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
|
||||||
|
|
||||||
<sqlMap namespace="ActivityFeedControl">
|
|
||||||
|
|
||||||
<insert id="insert.activity.feedcontrol" parameterClass="FeedControl">
|
|
||||||
|
|
||||||
insert into alf_activity_feed_control (feed_user_id, site_network, app_tool, last_modified)
|
|
||||||
values (#feedUserId#, #siteNetwork#, #appTool#, #lastModified#)
|
|
||||||
|
|
||||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
|
||||||
KEY_COLUMN:GENERATED_KEY
|
|
||||||
</selectKey>
|
|
||||||
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
</sqlMap>
|
|
@@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
|
|
||||||
<!DOCTYPE sqlMap
|
|
||||||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
|
||||||
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
|
||||||
|
|
||||||
<sqlMap namespace="ActivityPost">
|
|
||||||
|
|
||||||
<insert id="insert.activity.post" parameterClass="ActivityPost">
|
|
||||||
|
|
||||||
insert into alf_activity_post (status, activity_data, post_user_id, post_date, activity_type, site_network, app_tool, job_task_node, last_modified)
|
|
||||||
values (#status#, #activityData#, #userId#, #postDate#, #activityType#, #siteNetwork#, #appTool#, #jobTaskNode#, #lastModified#)
|
|
||||||
|
|
||||||
<selectKey resultClass="long" keyProperty="id" type="post">
|
|
||||||
KEY_COLUMN:GENERATED_KEY
|
|
||||||
</selectKey>
|
|
||||||
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
</sqlMap>
|
|
@@ -0,0 +1,42 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<!DOCTYPE sqlMap
|
||||||
|
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
|
||||||
|
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||||
|
|
||||||
|
<sqlMap namespace="activities">
|
||||||
|
|
||||||
|
<insert id="insert.activity.feedcontrol" parameterClass="FeedControl">
|
||||||
|
|
||||||
|
insert into alf_activity_feed_control (feed_user_id, site_network, app_tool, last_modified)
|
||||||
|
values (#feedUserId#, #siteNetwork#, #appTool#, #lastModified#)
|
||||||
|
|
||||||
|
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||||
|
KEY_COLUMN:GENERATED_KEY
|
||||||
|
</selectKey>
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insert.activity.feed" parameterClass="ActivityFeed">
|
||||||
|
|
||||||
|
insert into alf_activity_feed (activity_type, activity_summary, activity_format, feed_user_id, post_user_id, post_date, post_id, site_network, app_tool, feed_date)
|
||||||
|
values (#activityType#, #activitySummary#, #activitySummaryFormat#, #feedUserId#, #postUserId#, #postDate#, #postId#, #siteNetwork#, #appTool#, #feedDate#)
|
||||||
|
|
||||||
|
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||||
|
KEY_COLUMN:GENERATED_KEY
|
||||||
|
</selectKey>
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insert.activity.post" parameterClass="ActivityPost">
|
||||||
|
|
||||||
|
insert into alf_activity_post (status, activity_data, post_user_id, post_date, activity_type, site_network, app_tool, job_task_node, last_modified)
|
||||||
|
values (#status#, #activityData#, #userId#, #postDate#, #activityType#, #siteNetwork#, #appTool#, #jobTaskNode#, #lastModified#)
|
||||||
|
|
||||||
|
<selectKey resultClass="long" keyProperty="id" type="post">
|
||||||
|
KEY_COLUMN:GENERATED_KEY
|
||||||
|
</selectKey>
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
</sqlMap>
|
Reference in New Issue
Block a user