*/
package org.sonar.core.activity.db;
+import org.apache.ibatis.annotations.Param;
+
+import javax.annotation.Nullable;
+
+import java.sql.Timestamp;
import java.util.List;
/**
void insert(ActivityDto rule);
List<ActivityDto> selectAll();
+
+ List<ActivityDto> selectAfterDate(@Nullable @Param("date") Timestamp timestamp);
}
values (#{createdAt}, #{key}, #{type}, #{action}, #{author}, #{data}, #{message})
</insert>
- <select id="selectAll" parameterType="map" resultType="Activity" >
+ <select id="selectAll" parameterType="map" resultType="Activity" fetchSize="${_scrollFetchSize}" resultSetType="FORWARD_ONLY">
SELECT
created_at as "createdAt",
log_type as "type",
FROM activities
</select>
+
+ <select id="selectAfterDate" parameterType="map" resultType="Activity" fetchSize="${_scrollFetchSize}" resultSetType="FORWARD_ONLY">
+ SELECT
+ created_at as "createdAt",
+ log_type as "type",
+ user_login as "author",
+ data_field as "data",
+ log_message as "message",
+ log_key as "key",
+ log_action as "action"
+ FROM activities
+ <where>
+ <if test="date != null">
+ created_at >= #{date}
+ </if>
+ </where>
+ </select>
</mapper>