final long now = system.now();
MassUpdate massUpdate = context.prepareMassUpdate();
- massUpdate.select("SELECT i.created_at, i.updated_at, i.issue_change_creation_date_ms, i.id FROM issue_changes i WHERE created_at_ms IS NULL");
+ massUpdate.select("SELECT i.created_at, i.updated_at, i.issue_change_creation_date, i.id FROM issue_changes i WHERE created_at_ms IS NULL");
massUpdate.update("UPDATE issue_changes SET created_at_ms=?, updated_at_ms=?, issue_change_creation_date_ms=? WHERE id=?");
massUpdate.rowPluralName("issue_changes");
massUpdate.execute(new MassUpdate.Handler() {
c.issue_change_creation_date as issueChangeCreationDate
</sql>
- <insert id="insert" parameterType="IssueChange" useGeneratedKeys="false" keyProperty="id" >
- INSERT INTO issue_changes (kee, issue_key, user_login, change_type, change_data, created_at, updated_at, issue_change_creation_date)
- VALUES (#{kee,jdbcType=VARCHAR}, #{issueKey,jdbcType=VARCHAR}, #{userLogin,jdbcType=VARCHAR}, #{changeType,jdbcType=VARCHAR}, #{changeData,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{issueChangeCreationDate,jdbcType=TIMESTAMP})
+ <insert id="insert" parameterType="IssueChange" useGeneratedKeys="false" keyProperty="id">
+ INSERT INTO issue_changes (kee, issue_key, user_login, change_type, change_data, created_at, updated_at,
+ issue_change_creation_date)
+ VALUES (#{kee,jdbcType=VARCHAR}, #{issueKey,jdbcType=VARCHAR}, #{userLogin,jdbcType=VARCHAR},
+ #{changeType,jdbcType=VARCHAR}, #{changeData,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT},
+ #{updatedAt,jdbcType=BIGINT}, #{issueChangeCreationDate,jdbcType=BIGINT})
</insert>
- <delete id="delete" parameterType="string" >
+ <delete id="delete" parameterType="string">
delete from issue_changes where kee=#{id}
</delete>
- <update id="update" parameterType="map" >
+ <update id="update" parameterType="map">
update issue_changes set change_data=#{changeData}, updated_at=#{updatedAt} where kee=#{kee}
</update>
<include refid="issueChangeColumns"/>
from issue_changes c
inner join issues i on i.kee = c.issue_key
- inner join (select p.id,p.kee from projects p where (p.root_id=#{componentId} and p.qualifier <> 'BRC') or (p.id=#{componentId})) p on p.id=i.component_id
+ inner join (select p.id,p.kee from projects p where (p.root_id=#{componentId} and p.qualifier <> 'BRC') or
+ (p.id=#{componentId})) p on p.id=i.component_id
<where>
and c.change_type=#{changeType}
and i.status <> 'CLOSED'