Skip to content

Commit

Permalink
EPMRPP-92598 calculate launches regardless launch mode (#1020)
Browse files Browse the repository at this point in the history
  • Loading branch information
grabsefx committed Jul 15, 2024
1 parent 8af8199 commit eed07e1
Showing 1 changed file with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,9 @@ public enum FilterTarget {
JoinEntity.of(LAUNCH, JoinType.LEFT_OUTER_JOIN, PROJECT.ID.eq(LAUNCH.PROJECT_ID)))
)
.withAggregateCriteria(
DSL.countDistinct(choose().when(LAUNCH.MODE.eq(JLaunchModeEnum.DEFAULT)
.and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)), LAUNCH.ID)).toString())
DSL.countDistinct(
choose().when(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS), LAUNCH.ID))
.toString())
.get()
)
) {
Expand Down Expand Up @@ -308,8 +309,9 @@ protected Field<Long> idField() {

new CriteriaHolderBuilder().newBuilder(LAUNCHES_QUANTITY, LAUNCHES_QUANTITY, Long.class)
.withAggregateCriteria(
DSL.countDistinct(choose().when(LAUNCH.MODE.eq(JLaunchModeEnum.DEFAULT)
.and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)), LAUNCH.ID)).toString())
DSL.countDistinct(
choose().when(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS), LAUNCH.ID))
.toString())
.get()
)
) {
Expand All @@ -326,10 +328,8 @@ public QuerySupplier getQuery() {
@Override
protected Collection<? extends SelectField> selectFields() {
return Lists.newArrayList(DSL.countDistinct(PROJECT_USER.USER_ID).as(USERS_QUANTITY),
DSL.countDistinct(choose().when(LAUNCH.MODE.eq(JLaunchModeEnum.DEFAULT)
.and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)),
LAUNCH.ID
)).as(LAUNCHES_QUANTITY),
DSL.countDistinct(choose().when(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS), LAUNCH.ID))
.as(LAUNCHES_QUANTITY),
DSL.max(LAUNCH.START_TIME).as(LAST_RUN),
PROJECT.ID,
PROJECT.CREATION_DATE,
Expand Down Expand Up @@ -1443,8 +1443,8 @@ protected Field<Long> idField() {

new CriteriaHolderBuilder().newBuilder(LAUNCHES_QUANTITY, LAUNCHES_QUANTITY, Long.class)
.withAggregateCriteria(
DSL.countDistinct(choose().when(LAUNCH.MODE.eq(JLaunchModeEnum.DEFAULT)
.and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)), LAUNCH.ID)).toString())
DSL.countDistinct(choose().when(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS), LAUNCH.ID))
.toString())
.get(),
new CriteriaHolderBuilder().newBuilder(CRITERIA_USER, USERS.LOGIN, String.class)
.get()
Expand All @@ -1471,9 +1471,7 @@ protected Collection<? extends SelectField> selectFields() {
ORGANIZATION.ORGANIZATION_TYPE,
DSL.countDistinct(ORGANIZATION_USER.USER_ID).as(USERS_QUANTITY),
DSL.countDistinct(PROJECT.ID).as(PROJECTS_QUANTITY),
DSL.countDistinct(choose()
.when(LAUNCH.MODE.eq(JLaunchModeEnum.DEFAULT)
.and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)), LAUNCH.ID))
DSL.countDistinct(choose().when(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS), LAUNCH.ID))
.as(LAUNCHES_QUANTITY),
DSL.max(LAUNCH.START_TIME).as(LAST_RUN)
);
Expand Down Expand Up @@ -1533,9 +1531,7 @@ public QuerySupplier getQuery() {
@Override
protected Collection<? extends SelectField> selectFields() {
return Lists.newArrayList(DSL.countDistinct(PROJECT_USER.USER_ID).as(USERS_QUANTITY),
DSL.countDistinct(choose().when(LAUNCH.MODE.eq(JLaunchModeEnum.DEFAULT)
.and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)),
LAUNCH.ID
DSL.countDistinct(choose().when(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS), LAUNCH.ID
)).as(LAUNCHES_QUANTITY),
DSL.max(LAUNCH.START_TIME).as(LAST_RUN),
PROJECT.ID,
Expand Down

0 comments on commit eed07e1

Please sign in to comment.