Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPMRPP-92598 calculate launches regardless launch mode #1020

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading