from ce_activity ca
<where>
<if test="query.onlyCurrents">
- ca.is_last=${_true}
+ and ca.is_last=${_true}
</if>
<if test="query.componentUuid != null">
- ca.component_uuid=#{query.componentUuid}
+ and ca.component_uuid=#{query.componentUuid}
</if>
<if test="query.status != null">
- ca.status=#{query.status}
+ and ca.status=#{query.status}
</if>
<if test="query.type != null">
- ca.task_type=#{query.type}
+ and ca.task_type=#{query.type}
</if>
</where>
</select>
assertThat(underTest.countByQuery(db.getSession(), query)).isEqualTo(3);
query = new CeActivityQuery().setType("views");
assertThat(underTest.countByQuery(db.getSession(), query)).isEqualTo(1);
+
+ // select by multiple conditions
+ query = new CeActivityQuery().setType(REPORT).setOnlyCurrents(true).setComponentUuid("PROJECT_1");
+ assertThat(underTest.countByQuery(db.getSession(), query)).isEqualTo(1);
}
@Test