feature/810 Add querying by planned date for workbasket monitor reports

This commit is contained in:
Martin Rojas Miguel Angel 2019-03-13 10:31:15 +01:00 committed by Mustapha Zorgati
parent 72703068a3
commit 5d54e99b6f
15 changed files with 578 additions and 358 deletions

View File

@ -12,6 +12,7 @@ import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.impl.report.header.TimeIntervalColumnHeader;
import pro.taskana.impl.report.item.MonitorQueryItem;
import pro.taskana.impl.report.preprocessor.DaysToWorkingDaysPreProcessor;
import pro.taskana.impl.report.structure.Report;
import pro.taskana.mappings.TaskMonitorMapper;
import pro.taskana.report.CategoryReport;
@ -58,4 +59,9 @@ public class CategoryReportBuilderImpl
}
}
@Override
public Report<MonitorQueryItem, TimeIntervalColumnHeader> buildPlannedDateBasedReport()
throws NotAuthorizedException, InvalidArgumentException {
throw new java.lang.UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -1,10 +1,7 @@
package pro.taskana.impl;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pro.taskana.TaskanaEngine;
import pro.taskana.TaskanaRole;
import pro.taskana.exceptions.InvalidArgumentException;
@ -16,6 +13,9 @@ import pro.taskana.impl.report.preprocessor.DaysToWorkingDaysPreProcessor;
import pro.taskana.mappings.TaskMonitorMapper;
import pro.taskana.report.ClassificationReport;
import pro.taskana.report.ClassificationReport.DetailedClassificationReport;
import pro.taskana.report.Report;
import java.util.List;
/**
* The implementation of ClassificationReportBuilder.
@ -48,10 +48,10 @@ public class ClassificationReportBuilderImpl
this.taskanaEngine.openConnection();
ClassificationReport report = new ClassificationReport(this.columnHeaders);
List<MonitorQueryItem> monitorQueryItems = this.taskMonitorMapper.getTaskCountOfClassifications(
this.workbasketIds, this.states, this.categories, this.domains, this.classificationIds,
this.excludedClassificationIds, this.customAttributeFilter);
this.workbasketIds, this.states, this.categories, this.domains, this.classificationIds,
this.excludedClassificationIds, this.customAttributeFilter);
report.addItems(monitorQueryItems,
new DaysToWorkingDaysPreProcessor<>(this.columnHeaders, this.inWorkingDays));
new DaysToWorkingDaysPreProcessor<>(this.columnHeaders, this.inWorkingDays));
return report;
} finally {
this.taskanaEngine.returnConnection();
@ -67,11 +67,11 @@ public class ClassificationReportBuilderImpl
this.taskanaEngine.openConnection();
DetailedClassificationReport report = new DetailedClassificationReport(this.columnHeaders);
List<DetailedMonitorQueryItem> detailedMonitorQueryItems = this.taskMonitorMapper
.getTaskCountOfDetailedClassifications(this.workbasketIds, this.states, this.categories, this.domains,
this.classificationIds, this.excludedClassificationIds, this.customAttributeFilter);
.getTaskCountOfDetailedClassifications(this.workbasketIds, this.states, this.categories, this.domains,
this.classificationIds, this.excludedClassificationIds, this.customAttributeFilter);
report.addItems(detailedMonitorQueryItems,
new DaysToWorkingDaysPreProcessor<>(this.columnHeaders, this.inWorkingDays));
new DaysToWorkingDaysPreProcessor<>(this.columnHeaders, this.inWorkingDays));
return report;
} finally {
@ -80,4 +80,8 @@ public class ClassificationReportBuilderImpl
}
}
@Override
public Report<MonitorQueryItem, TimeIntervalColumnHeader> buildPlannedDateBasedReport() throws NotAuthorizedException, InvalidArgumentException {
throw new java.lang.UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -13,6 +13,7 @@ import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.impl.report.header.TimeIntervalColumnHeader;
import pro.taskana.impl.report.item.MonitorQueryItem;
import pro.taskana.impl.report.preprocessor.DaysToWorkingDaysPreProcessor;
import pro.taskana.impl.report.structure.Report;
import pro.taskana.mappings.TaskMonitorMapper;
import pro.taskana.report.CustomFieldValueReport;
@ -66,4 +67,10 @@ public class CustomFieldValueReportBuilderImpl
}
}
@Override
public Report<MonitorQueryItem, TimeIntervalColumnHeader> buildPlannedDateBasedReport()
throws NotAuthorizedException, InvalidArgumentException {
throw new java.lang.UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -8,8 +8,11 @@ import org.slf4j.LoggerFactory;
import pro.taskana.TaskState;
import pro.taskana.TaskanaEngine;
import pro.taskana.TaskanaRole;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.impl.report.header.TaskStatusColumnHeader;
import pro.taskana.impl.report.item.TaskQueryItem;
import pro.taskana.impl.report.structure.Report;
import pro.taskana.mappings.TaskMonitorMapper;
import pro.taskana.report.TaskStatusReport;
@ -57,4 +60,10 @@ public class TaskStatusReportBuilderImpl implements TaskStatusReport.Builder {
}
}
@Override
public Report<TaskQueryItem, TaskStatusColumnHeader> buildPlannedDateBasedReport()
throws NotAuthorizedException, InvalidArgumentException {
throw new java.lang.UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -59,6 +59,25 @@ public class WorkbasketReportBuilderImpl
}
}
@Override
public WorkbasketReport buildPlannedDateBasedReport() throws NotAuthorizedException, InvalidArgumentException {
LOGGER.debug("entry to buildPlannedDateReport(), this = {}", this);
this.taskanaEngine.checkRoleMembership(TaskanaRole.MONITOR, TaskanaRole.ADMIN);
try {
this.taskanaEngine.openConnection();
WorkbasketReport report = new WorkbasketReport(this.columnHeaders);
List<MonitorQueryItem> monitorQueryItems = this.taskMonitorMapper.getTaskCountOfWorkbasketsBasedOnPlannedDate(
this.workbasketIds, this.states, this.categories, this.domains, this.classificationIds,
this.excludedClassificationIds, this.customAttributeFilter, this.combinedClassificationFilter);
report.addItems(monitorQueryItems,
new DaysToWorkingDaysPreProcessor<>(this.columnHeaders, this.inWorkingDays));
return report;
} finally {
this.taskanaEngine.returnConnection();
LOGGER.debug("exit from buildPlannedDateReport().");
}
}
@Override
public WorkbasketReport.Builder combinedClassificationFilterIn(
List<CombinedClassificationFilter> combinedClassificationFilter) {

View File

@ -105,5 +105,6 @@ public abstract class Report<I extends QueryItem, H extends ColumnHeader<? super
public interface Builder<I extends QueryItem, H extends ColumnHeader<? super I>> {
Report<I, H> buildReport() throws NotAuthorizedException, InvalidArgumentException;
Report<I, H> buildPlannedDateBasedReport() throws NotAuthorizedException, InvalidArgumentException;
}
}

View File

@ -24,362 +24,417 @@ import pro.taskana.impl.report.item.TaskQueryItem;
public interface TaskMonitorMapper {
@Select("<script>"
+ "<if test=\"_databaseId == 'db2'\">SELECT T.WORKBASKET_KEY, (DAYS(T.DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'h2'\">SELECT T.WORKBASKET_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, T.DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'postgres'\">SELECT T.WORKBASKET_KEY, DATE_PART('DAY', T.DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "FROM TASK AS T LEFT JOIN ATTACHMENT AS A ON T.ID = A.TASK_ID "
+ "<where>"
+ "<if test=\"workbasketIds != null\">"
+ "T.WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
+ "</if>"
+ "<if test=\"states != null\">"
+ "AND T.STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "<if test=\"categories != null\">"
+ "AND T.CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
+ "</if>"
+ "<if test=\"domains != null\">"
+ "AND T.DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='classificationIds != null'>"
+ "AND CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
+ "</if>"
+ "<if test='excludedClassificationIds != null'>"
+ "AND CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
+ "</if>"
+ "<if test='customAttributeFilter != null'>"
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(${key} = '${customAttributeFilter.get(key)}')</foreach>) "
+ "</if>"
+ "<if test=\"combinedClassificationFilter != null\">"
+ "AND <foreach collection='combinedClassificationFilter' item='item' separator='OR'> "
+ "T.CLASSIFICATION_ID = #{item.taskClassificationId}"
+ "<if test=\"item.attachmentClassificationId != null\">"
+ "AND A.CLASSIFICATION_ID = #{item.attachmentClassificationId}"
+ "</if>"
+ "</foreach>"
+ "</if>"
+ "AND T.DUE IS NOT NULL "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">GROUP BY T.WORKBASKET_KEY, (DAYS(T.DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
+ "<if test=\"_databaseId == 'h2'\">GROUP BY T.WORKBASKET_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, T.DUE)</if> "
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY T.WORKBASKET_KEY, DATE_PART('DAY', T.DUE - CURRENT_TIMESTAMP)</if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
+ "<if test=\"_databaseId == 'db2'\">SELECT T.WORKBASKET_KEY, (DAYS(T.DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'h2'\">SELECT T.WORKBASKET_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, T.DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'postgres'\">SELECT T.WORKBASKET_KEY, DATE_PART('DAY', T.DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "FROM TASK AS T LEFT JOIN ATTACHMENT AS A ON T.ID = A.TASK_ID "
+ "<where>"
+ "<if test=\"workbasketIds != null\">"
+ "T.WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
+ "</if>"
+ "<if test=\"states != null\">"
+ "AND T.STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "<if test=\"categories != null\">"
+ "AND T.CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
+ "</if>"
+ "<if test=\"domains != null\">"
+ "AND T.DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='classificationIds != null'>"
+ "AND CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
+ "</if>"
+ "<if test='excludedClassificationIds != null'>"
+ "AND CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
+ "</if>"
+ "<if test='customAttributeFilter != null'>"
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(${key} = '${customAttributeFilter.get(key)}')</foreach>) "
+ "</if>"
+ "<if test=\"combinedClassificationFilter != null\">"
+ "AND <foreach collection='combinedClassificationFilter' item='item' separator='OR'> "
+ "T.CLASSIFICATION_ID = #{item.taskClassificationId}"
+ "<if test=\"item.attachmentClassificationId != null\">"
+ "AND A.CLASSIFICATION_ID = #{item.attachmentClassificationId}"
+ "</if>"
+ "</foreach>"
+ "</if>"
+ "AND T.DUE IS NOT NULL "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">GROUP BY T.WORKBASKET_KEY, (DAYS(T.DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
+ "<if test=\"_databaseId == 'h2'\">GROUP BY T.WORKBASKET_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, T.DUE)</if> "
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY T.WORKBASKET_KEY, DATE_PART('DAY', T.DUE - CURRENT_TIMESTAMP)</if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(column = "WORKBASKET_KEY", property = "key"),
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
@Result(column = "WORKBASKET_KEY", property = "key"),
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
List<MonitorQueryItem> getTaskCountOfWorkbaskets(@Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@Param("domains") List<String> domains,
@Param("classificationIds") List<String> classificationIds,
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
@Param("customAttributeFilter") Map<CustomField, String> customAttributeFilter,
@Param("combinedClassificationFilter") List<CombinedClassificationFilter> combinedClassificationFilter);
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@Param("domains") List<String> domains,
@Param("classificationIds") List<String> classificationIds,
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
@Param("customAttributeFilter") Map<CustomField, String> customAttributeFilter,
@Param("combinedClassificationFilter") List<CombinedClassificationFilter> combinedClassificationFilter);
@Select("<script>"
+ "<if test=\"_databaseId == 'db2'\">SELECT CLASSIFICATION_CATEGORY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'h2'\">SELECT CLASSIFICATION_CATEGORY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'postgres'\">SELECT CLASSIFICATION_CATEGORY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "FROM TASK "
+ "<where>"
+ "<if test=\"workbasketIds != null\">"
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
+ "</if>"
+ "<if test=\"states != null\">"
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "<if test=\"categories != null\">"
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
+ "</if>"
+ "<if test=\"domains != null\">"
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='classificationIds != null'>"
+ "AND CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
+ "</if>"
+ "<if test='excludedClassificationIds != null'>"
+ "AND CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
+ "</if>"
+ "<if test='customAttributeFilter != null'>"
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(${key} = '${customAttributeFilter.get(key)}')</foreach>) "
+ "</if>"
+ "AND DUE IS NOT NULL "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">GROUP BY CLASSIFICATION_CATEGORY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
+ "<if test=\"_databaseId == 'h2'\">GROUP BY CLASSIFICATION_CATEGORY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY CLASSIFICATION_CATEGORY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
+ "<if test=\"_databaseId == 'db2'\">SELECT T.WORKBASKET_KEY, (DAYS(T.PLANNED) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'h2'\">SELECT T.WORKBASKET_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, T.PLANNED) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'postgres'\">SELECT T.WORKBASKET_KEY, DATE_PART('DAY', T.PLANNED - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "FROM TASK AS T LEFT JOIN ATTACHMENT AS A ON T.ID = A.TASK_ID "
+ "<where>"
+ "<if test=\"workbasketIds != null\">"
+ "T.WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
+ "</if>"
+ "<if test=\"states != null\">"
+ "AND T.STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "<if test=\"categories != null\">"
+ "AND T.CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
+ "</if>"
+ "<if test=\"domains != null\">"
+ "AND T.DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='classificationIds != null'>"
+ "AND CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
+ "</if>"
+ "<if test='excludedClassificationIds != null'>"
+ "AND CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
+ "</if>"
+ "<if test='customAttributeFilter != null'>"
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(${key} = '${customAttributeFilter.get(key)}')</foreach>) "
+ "</if>"
+ "<if test=\"combinedClassificationFilter != null\">"
+ "AND <foreach collection='combinedClassificationFilter' item='item' separator='OR'> "
+ "T.CLASSIFICATION_ID = #{item.taskClassificationId}"
+ "<if test=\"item.attachmentClassificationId != null\">"
+ "AND A.CLASSIFICATION_ID = #{item.attachmentClassificationId}"
+ "</if>"
+ "</foreach>"
+ "</if>"
+ "AND T.PLANNED IS NOT NULL "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">GROUP BY T.WORKBASKET_KEY, (DAYS(T.PLANNED) - DAYS(CURRENT_TIMESTAMP))</if> "
+ "<if test=\"_databaseId == 'h2'\">GROUP BY T.WORKBASKET_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, T.PLANNED)</if> "
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY T.WORKBASKET_KEY, DATE_PART('DAY', T.PLANNED - CURRENT_TIMESTAMP)</if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(column = "CLASSIFICATION_CATEGORY", property = "key"),
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
@Result(column = "WORKBASKET_KEY", property = "key"),
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
List<MonitorQueryItem> getTaskCountOfWorkbasketsBasedOnPlannedDate(@Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@Param("domains") List<String> domains,
@Param("classificationIds") List<String> classificationIds,
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
@Param("customAttributeFilter") Map<CustomField, String> customAttributeFilter,
@Param("combinedClassificationFilter") List<CombinedClassificationFilter> combinedClassificationFilter);
@Select("<script>"
+ "<if test=\"_databaseId == 'db2'\">SELECT CLASSIFICATION_CATEGORY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'h2'\">SELECT CLASSIFICATION_CATEGORY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'postgres'\">SELECT CLASSIFICATION_CATEGORY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "FROM TASK "
+ "<where>"
+ "<if test=\"workbasketIds != null\">"
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
+ "</if>"
+ "<if test=\"states != null\">"
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "<if test=\"categories != null\">"
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
+ "</if>"
+ "<if test=\"domains != null\">"
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='classificationIds != null'>"
+ "AND CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
+ "</if>"
+ "<if test='excludedClassificationIds != null'>"
+ "AND CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
+ "</if>"
+ "<if test='customAttributeFilter != null'>"
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(${key} = '${customAttributeFilter.get(key)}')</foreach>) "
+ "</if>"
+ "AND DUE IS NOT NULL "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">GROUP BY CLASSIFICATION_CATEGORY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
+ "<if test=\"_databaseId == 'h2'\">GROUP BY CLASSIFICATION_CATEGORY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY CLASSIFICATION_CATEGORY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(column = "CLASSIFICATION_CATEGORY", property = "key"),
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
List<MonitorQueryItem> getTaskCountOfCategories(@Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@Param("domains") List<String> domains,
@Param("classificationIds") List<String> classificationIds,
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
@Param("customAttributeFilter") Map<CustomField, String> customAttributeFilter);
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@Param("domains") List<String> domains,
@Param("classificationIds") List<String> classificationIds,
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
@Param("customAttributeFilter") Map<CustomField, String> customAttributeFilter);
@Select("<script>"
+ "<if test=\"_databaseId == 'db2'\">SELECT CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'h2'\">SELECT CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'postgres'\">SELECT CLASSIFICATION_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "FROM TASK "
+ "<where>"
+ "<if test=\"workbasketIds != null\">"
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
+ "</if>"
+ "<if test=\"states != null\">"
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "<if test=\"categories != null\">"
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
+ "</if>"
+ "<if test=\"domains != null\">"
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='classificationIds != null'>"
+ "AND CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
+ "</if>"
+ "<if test='excludedClassificationIds != null'>"
+ "AND CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
+ "</if>"
+ "<if test='customAttributeFilter != null'>"
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(${key} = '${customAttributeFilter.get(key)}')</foreach>) "
+ "</if>"
+ "AND DUE IS NOT NULL "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">GROUP BY CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
+ "<if test=\"_databaseId == 'h2'\">GROUP BY CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY CLASSIFICATION_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
+ "<if test=\"_databaseId == 'db2'\">SELECT CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'h2'\">SELECT CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'postgres'\">SELECT CLASSIFICATION_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "FROM TASK "
+ "<where>"
+ "<if test=\"workbasketIds != null\">"
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
+ "</if>"
+ "<if test=\"states != null\">"
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "<if test=\"categories != null\">"
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
+ "</if>"
+ "<if test=\"domains != null\">"
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='classificationIds != null'>"
+ "AND CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
+ "</if>"
+ "<if test='excludedClassificationIds != null'>"
+ "AND CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
+ "</if>"
+ "<if test='customAttributeFilter != null'>"
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(${key} = '${customAttributeFilter.get(key)}')</foreach>) "
+ "</if>"
+ "AND DUE IS NOT NULL "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">GROUP BY CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
+ "<if test=\"_databaseId == 'h2'\">GROUP BY CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY CLASSIFICATION_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(column = "CLASSIFICATION_KEY", property = "key"),
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
@Result(column = "CLASSIFICATION_KEY", property = "key"),
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
List<MonitorQueryItem> getTaskCountOfClassifications(@Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@Param("domains") List<String> domains,
@Param("classificationIds") List<String> classificationIds,
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
@Param("customAttributeFilter") Map<CustomField, String> customAttributeFilter);
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@Param("domains") List<String> domains,
@Param("classificationIds") List<String> classificationIds,
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
@Param("customAttributeFilter") Map<CustomField, String> customAttributeFilter);
@Select("<script>"
+ "<if test=\"_databaseId == 'db2'\">SELECT T.CLASSIFICATION_KEY as TASK_CLASSIFICATION_KEY, A.CLASSIFICATION_KEY as ATTACHMENT_CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'h2'\">SELECT T.CLASSIFICATION_KEY as TASK_CLASSIFICATION_KEY, A.CLASSIFICATION_KEY as ATTACHMENT_CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'postgres'\">SELECT T.CLASSIFICATION_KEY as TASK_CLASSIFICATION_KEY, A.CLASSIFICATION_KEY as ATTACHMENT_CLASSIFICATION_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "FROM TASK AS T LEFT JOIN ATTACHMENT AS A ON T.ID = A.TASK_ID "
+ "<where>"
+ "<if test=\"workbasketIds != null\">"
+ "T.WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
+ "</if>"
+ "<if test=\"states != null\">"
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "<if test=\"categories != null\">"
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
+ "</if>"
+ "<if test=\"domains != null\">"
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='classificationIds != null'>"
+ "AND CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
+ "</if>"
+ "<if test='excludedClassificationIds != null'>"
+ "AND CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
+ "</if>"
+ "<if test='customAttributeFilter != null'>"
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(${key} = '${customAttributeFilter.get(key)}')</foreach>) "
+ "</if>"
+ "AND DUE IS NOT NULL "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">GROUP BY T.CLASSIFICATION_KEY, A.CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
+ "<if test=\"_databaseId == 'h2'\">GROUP BY T.CLASSIFICATION_KEY, A.CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY T.CLASSIFICATION_KEY, A.CLASSIFICATION_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
+ "<if test=\"_databaseId == 'db2'\">SELECT T.CLASSIFICATION_KEY as TASK_CLASSIFICATION_KEY, A.CLASSIFICATION_KEY as ATTACHMENT_CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'h2'\">SELECT T.CLASSIFICATION_KEY as TASK_CLASSIFICATION_KEY, A.CLASSIFICATION_KEY as ATTACHMENT_CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'postgres'\">SELECT T.CLASSIFICATION_KEY as TASK_CLASSIFICATION_KEY, A.CLASSIFICATION_KEY as ATTACHMENT_CLASSIFICATION_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "FROM TASK AS T LEFT JOIN ATTACHMENT AS A ON T.ID = A.TASK_ID "
+ "<where>"
+ "<if test=\"workbasketIds != null\">"
+ "T.WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
+ "</if>"
+ "<if test=\"states != null\">"
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "<if test=\"categories != null\">"
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
+ "</if>"
+ "<if test=\"domains != null\">"
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='classificationIds != null'>"
+ "AND CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
+ "</if>"
+ "<if test='excludedClassificationIds != null'>"
+ "AND CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
+ "</if>"
+ "<if test='customAttributeFilter != null'>"
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(${key} = '${customAttributeFilter.get(key)}')</foreach>) "
+ "</if>"
+ "AND DUE IS NOT NULL "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">GROUP BY T.CLASSIFICATION_KEY, A.CLASSIFICATION_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
+ "<if test=\"_databaseId == 'h2'\">GROUP BY T.CLASSIFICATION_KEY, A.CLASSIFICATION_KEY, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY T.CLASSIFICATION_KEY, A.CLASSIFICATION_KEY, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(column = "TASK_CLASSIFICATION_KEY", property = "key"),
@Result(column = "ATTACHMENT_CLASSIFICATION_KEY", property = "attachmentKey"),
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
@Result(column = "TASK_CLASSIFICATION_KEY", property = "key"),
@Result(column = "ATTACHMENT_CLASSIFICATION_KEY", property = "attachmentKey"),
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
List<DetailedMonitorQueryItem> getTaskCountOfDetailedClassifications(
@Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@Param("domains") List<String> domains,
@Param("classificationIds") List<String> classificationIds,
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
@Param("customAttributeFilter") Map<CustomField, String> customAttributeFilter);
@Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@Param("domains") List<String> domains,
@Param("classificationIds") List<String> classificationIds,
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
@Param("customAttributeFilter") Map<CustomField, String> customAttributeFilter);
@Select("<script>"
+ "<if test=\"_databaseId == 'db2'\">SELECT ${customField} as CUSTOM_FIELD, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'h2'\">SELECT ${customField} as CUSTOM_FIELD, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'postgres'\">SELECT ${customField} as CUSTOM_FIELD, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "FROM TASK "
+ "<where>"
+ "<if test=\"workbasketIds != null\">"
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
+ "</if>"
+ "<if test=\"states != null\">"
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "<if test=\"categories != null\">"
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
+ "</if>"
+ "<if test=\"domains != null\">"
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='classificationIds != null'>"
+ "AND CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
+ "</if>"
+ "<if test='excludedClassificationIds != null'>"
+ "AND CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
+ "</if>"
+ "<if test='customAttributeFilter != null'>"
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(${key} = '${customAttributeFilter.get(key)}')</foreach>) "
+ "</if>"
+ "AND DUE IS NOT NULL "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">GROUP BY ${customField}, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
+ "<if test=\"_databaseId == 'h2'\">GROUP BY ${customField}, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY ${customField}, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
+ "<if test=\"_databaseId == 'db2'\">SELECT ${customField} as CUSTOM_FIELD, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'h2'\">SELECT ${customField} as CUSTOM_FIELD, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "<if test=\"_databaseId == 'postgres'\">SELECT ${customField} as CUSTOM_FIELD, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> "
+ "FROM TASK "
+ "<where>"
+ "<if test=\"workbasketIds != null\">"
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
+ "</if>"
+ "<if test=\"states != null\">"
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "<if test=\"categories != null\">"
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
+ "</if>"
+ "<if test=\"domains != null\">"
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='classificationIds != null'>"
+ "AND CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
+ "</if>"
+ "<if test='excludedClassificationIds != null'>"
+ "AND CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
+ "</if>"
+ "<if test='customAttributeFilter != null'>"
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(${key} = '${customAttributeFilter.get(key)}')</foreach>) "
+ "</if>"
+ "AND DUE IS NOT NULL "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">GROUP BY ${customField}, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> "
+ "<if test=\"_databaseId == 'h2'\">GROUP BY ${customField}, DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE)</if> "
+ "<if test=\"_databaseId == 'postgres'\">GROUP BY ${customField}, DATE_PART('DAY', DUE - CURRENT_TIMESTAMP)</if> "
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
@Results({
@Result(column = "CUSTOM_FIELD", property = "key"),
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
@Result(column = "CUSTOM_FIELD", property = "key"),
@Result(column = "AGE_IN_DAYS", property = "ageInDays"),
@Result(column = "NUMBER_OF_TASKS", property = "numberOfTasks")})
List<MonitorQueryItem> getTaskCountOfCustomFieldValues(
@Param("customField") CustomField customField,
@Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@Param("domains") List<String> domains,
@Param("classificationIds") List<String> classificationIds,
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
@Param("customAttributeFilter") Map<CustomField, String> customAttributeFilter);
@Param("customField") CustomField customField,
@Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@Param("domains") List<String> domains,
@Param("classificationIds") List<String> classificationIds,
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
@Param("customAttributeFilter") Map<CustomField, String> customAttributeFilter);
@Select("<script>"
+ "SELECT T.ID FROM TASK T "
+ "<if test=\"joinWithAttachments\">"
+ "LEFT JOIN ATTACHMENT A ON T.ID = A.TASK_ID "
+ "</if>"
+ "<where>"
+ "<if test=\"workbasketIds != null\">"
+ "T.WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
+ "</if>"
+ "<if test=\"states != null\">"
+ "AND T.STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "<if test=\"categories != null\">"
+ "AND T.CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
+ "</if>"
+ "<if test=\"domains != null\">"
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='classificationIds != null'>"
+ "AND T.CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
+ "</if>"
+ "<if test='excludedClassificationIds != null'>"
+ "AND T.CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
+ "</if>"
+ "<if test='customAttributeFilter != null'>"
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(${key} = '${customAttributeFilter.get(key)}')</foreach>) "
+ "</if>"
+ "AND T.DUE IS NOT NULL AND ( "
+ "<foreach collection='selectedItems' item='selectedItem' separator=' OR '>"
+ "#{selectedItem.key} = T.${groupedBy} AND "
+ "<if test=\"joinWithAttachments\">"
+ "A.CLASSIFICATION_KEY = #{selectedItem.subKey} AND "
+ "</if>"
+ "<if test=\"_databaseId == 'db2'\">"
+ "#{selectedItem.upperAgeLimit} >= (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) AND "
+ "#{selectedItem.lowerAgeLimit} &lt;= (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) "
+ "</if> "
+ "<if test=\"_databaseId == 'h2'\">"
+ "#{selectedItem.upperAgeLimit} >= DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) AND "
+ "#{selectedItem.lowerAgeLimit} &lt;= DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) "
+ "</if> "
+ "<if test=\"_databaseId == 'postgres'\">"
+ "#{selectedItem.upperAgeLimit} >= DATE_PART('day', DUE - CURRENT_TIMESTAMP ) AND "
+ "#{selectedItem.lowerAgeLimit} &lt;= DATE_PART('day', DUE - CURRENT_TIMESTAMP ) "
+ "</if> "
+ "</foreach>) "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
+ "SELECT T.ID FROM TASK T "
+ "<if test=\"joinWithAttachments\">"
+ "LEFT JOIN ATTACHMENT A ON T.ID = A.TASK_ID "
+ "</if>"
+ "<where>"
+ "<if test=\"workbasketIds != null\">"
+ "T.WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
+ "</if>"
+ "<if test=\"states != null\">"
+ "AND T.STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "<if test=\"categories != null\">"
+ "AND T.CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
+ "</if>"
+ "<if test=\"domains != null\">"
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='classificationIds != null'>"
+ "AND T.CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
+ "</if>"
+ "<if test='excludedClassificationIds != null'>"
+ "AND T.CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
+ "</if>"
+ "<if test='customAttributeFilter != null'>"
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(${key} = '${customAttributeFilter.get(key)}')</foreach>) "
+ "</if>"
+ "AND T.DUE IS NOT NULL AND ( "
+ "<foreach collection='selectedItems' item='selectedItem' separator=' OR '>"
+ "#{selectedItem.key} = T.${groupedBy} AND "
+ "<if test=\"joinWithAttachments\">"
+ "A.CLASSIFICATION_KEY = #{selectedItem.subKey} AND "
+ "</if>"
+ "<if test=\"_databaseId == 'db2'\">"
+ "#{selectedItem.upperAgeLimit} >= (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) AND "
+ "#{selectedItem.lowerAgeLimit} &lt;= (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) "
+ "</if> "
+ "<if test=\"_databaseId == 'h2'\">"
+ "#{selectedItem.upperAgeLimit} >= DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) AND "
+ "#{selectedItem.lowerAgeLimit} &lt;= DATEDIFF('DAY', CURRENT_TIMESTAMP, DUE) "
+ "</if> "
+ "<if test=\"_databaseId == 'postgres'\">"
+ "#{selectedItem.upperAgeLimit} >= DATE_PART('day', DUE - CURRENT_TIMESTAMP ) AND "
+ "#{selectedItem.lowerAgeLimit} &lt;= DATE_PART('day', DUE - CURRENT_TIMESTAMP ) "
+ "</if> "
+ "</foreach>) "
+ "</where>"
+ "<if test=\"_databaseId == 'db2'\">with UR </if> "
+ "</script>")
List<String> getTaskIdsForSelectedItems(@Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@Param("domains") List<String> domains,
@Param("classificationIds") List<String> classificationIds,
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
@Param("customAttributeFilter") Map<CustomField, String> customAttributeFilter,
@Param("groupedBy") String groupedBy, @Param("selectedItems") List<SelectedItem> selectedItems,
@Param("joinWithAttachments") boolean joinWithAttachments);
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories,
@Param("domains") List<String> domains,
@Param("classificationIds") List<String> classificationIds,
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
@Param("customAttributeFilter") Map<CustomField, String> customAttributeFilter,
@Param("groupedBy") String groupedBy, @Param("selectedItems") List<SelectedItem> selectedItems,
@Param("joinWithAttachments") boolean joinWithAttachments);
@Select("<script>"
+ "SELECT DOMAIN, STATE, COUNT(STATE) as COUNT "
+ "FROM TASK "
+ "<where>"
+ "<if test='domains != null'>"
+ "DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='states != null'>"
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "</where>"
+ "GROUP BY DOMAIN, STATE"
+ "</script>")
+ "SELECT DOMAIN, STATE, COUNT(STATE) as COUNT "
+ "FROM TASK "
+ "<where>"
+ "<if test='domains != null'>"
+ "DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='states != null'>"
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "</where>"
+ "GROUP BY DOMAIN, STATE"
+ "</script>")
@Results({
@Result(column = "DOMAIN", property = "domain"),
@Result(column = "STATE", property = "state"),
@Result(column = "COUNT", property = "count"),
@Result(column = "DOMAIN", property = "domain"),
@Result(column = "STATE", property = "state"),
@Result(column = "COUNT", property = "count"),
})
List<TaskQueryItem> getTasksCountByState(@Param("domains") List<String> domains,
@Param("states") List<TaskState> states);
@Param("states") List<TaskState> states);
@Select("<script>"
+ "SELECT DISTINCT ${customField} "
+ "FROM TASK "
+ "<where>"
+ "<if test='workbasketIds != null'>"
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
+ "</if>"
+ "<if test='states != null'>"
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "<if test='categories != null'>"
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
+ "</if>"
+ "<if test='domains != null'>"
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='classificationIds != null'>"
+ "AND CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
+ "</if>"
+ "<if test='excludedClassificationIds != null'>"
+ "AND CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
+ "</if>"
+ "<if test='customAttributeFilter != null'>"
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(${key} = '${customAttributeFilter.get(key)}')</foreach>) "
+ "</if>"
+ "</where>"
+ "</script>")
+ "SELECT DISTINCT ${customField} "
+ "FROM TASK "
+ "<where>"
+ "<if test='workbasketIds != null'>"
+ "WORKBASKET_ID IN (<foreach collection='workbasketIds' item='workbasketId' separator=','>#{workbasketId}</foreach>) "
+ "</if>"
+ "<if test='states != null'>"
+ "AND STATE IN (<foreach collection='states' item='state' separator=','>#{state}</foreach>) "
+ "</if>"
+ "<if test='categories != null'>"
+ "AND CLASSIFICATION_CATEGORY IN (<foreach collection='categories' item='category' separator=','>#{category}</foreach>) "
+ "</if>"
+ "<if test='domains != null'>"
+ "AND DOMAIN IN (<foreach collection='domains' item='domain' separator=','>#{domain}</foreach>) "
+ "</if>"
+ "<if test='classificationIds != null'>"
+ "AND CLASSIFICATION_ID IN (<foreach collection='classificationIds' item='classificationId' separator=','>#{classificationId}</foreach>) "
+ "</if>"
+ "<if test='excludedClassificationIds != null'>"
+ "AND CLASSIFICATION_ID NOT IN (<foreach collection='excludedClassificationIds' item='excludedClassificationId' separator=','>#{excludedClassificationId}</foreach>) "
+ "</if>"
+ "<if test='customAttributeFilter != null'>"
+ "AND (<foreach collection='customAttributeFilter.keys' item='key' separator=' AND '>(${key} = '${customAttributeFilter.get(key)}')</foreach>) "
+ "</if>"
+ "</where>"
+ "</script>")
List<String> getCustomAttributeValuesForReport(@Param("workbasketIds") List<String> workbasketIds,
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories, @Param("domains") List<String> domains,
@Param("classificationIds") List<String> classificationIds,
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
@Param("customAttributeFilter") Map<CustomField, String> customAttributeFilter,
@Param("customField") CustomField customField);
@Param("states") List<TaskState> states,
@Param("categories") List<String> categories, @Param("domains") List<String> domains,
@Param("classificationIds") List<String> classificationIds,
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
@Param("customAttributeFilter") Map<CustomField, String> customAttributeFilter,
@Param("customField") CustomField customField);
@Select("<script>"
+ "SELECT A.AGE_IN_DAYS, A.ORG_LEVEL_1, A.ORG_LEVEL_2, A.ORG_LEVEL_3, A.ORG_LEVEL_4, "

View File

@ -33,6 +33,12 @@ public class WorkbasketReport extends Report<MonitorQueryItem, TimeIntervalColum
@Override
WorkbasketReport buildReport() throws NotAuthorizedException, InvalidArgumentException;
/**
* buildPlannedDateBasedReport is querying grouping by plannedDate instead of due date.
*/
@Override
WorkbasketReport buildPlannedDateBasedReport() throws NotAuthorizedException, InvalidArgumentException;
/**
* Adds a list of {@link CombinedClassificationFilter} to the builder. The created report contains only tasks with a
* pair of a classificationId for a task and a classificationId for the corresponding attachment in this list.

View File

@ -47,7 +47,7 @@ public class ProvideWorkbasketReportAccTest extends AbstractReportAccTest {
@WithAccessId(
userName = "monitor")
@Test
public void testGetTotalNumbersOfTasksOfWorkbasketReport()
public void testGetTotalNumbersOfTasksOfWorkbasketReportBasedOnDueDate()
throws InvalidArgumentException, NotAuthorizedException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
@ -367,6 +367,34 @@ public class ProvideWorkbasketReportAccTest extends AbstractReportAccTest {
assertArrayEquals(new int[] {1, 0, 0, 0, 3}, row3);
}
@WithAccessId(
userName = "monitor")
@Test
public void testGetTotalNumbersOfTasksOfWorkbasketReportBasedOnPlannedDateWithReportLineItemDefinitions()
throws InvalidArgumentException, NotAuthorizedException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
WorkbasketReport report = taskMonitorService.createWorkbasketReportBuilder()
.withColumnHeaders(columnHeaders)
.buildPlannedDateBasedReport();
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(reportToString(report));
}
assertNotNull(report);
assertEquals(3, report.rowSize());
assertEquals(20, report.getRow("USER_1_1").getTotalValue());
assertEquals(20, report.getRow("USER_1_2").getTotalValue());
assertEquals(10, report.getRow("USER_1_3").getTotalValue());
assertEquals(2, report.getRow("USER_1_1").getCells()[2]);
assertEquals(1, report.getRow("USER_1_2").getCells()[1]);
assertEquals(50, report.getSumRow().getTotalValue());
}
private List<TimeIntervalColumnHeader> getListOfColumnHeaders() {
List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -11));

View File

@ -66,7 +66,7 @@ public class WorkbasketReportBuilderImplTest {
}
@Test
public void testGetTotalNumbersOfWorkbasketReport() throws InvalidArgumentException, NotAuthorizedException {
public void testGetTotalNumbersOfWorkbasketReportBasedOnDueDate() throws InvalidArgumentException, NotAuthorizedException {
List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
List<TaskState> states = Arrays.asList(TaskState.CLAIMED, TaskState.READY);
List<String> categories = Collections.singletonList("EXTERN");
@ -223,7 +223,7 @@ public class WorkbasketReportBuilderImplTest {
}
@Test(expected = InvalidArgumentException.class)
public void testlistTaskIdsForSelectedItemsIsEmptyResult()
public void testListTaskIdsForSelectedItemsIsEmptyResult()
throws NotAuthorizedException, InvalidArgumentException {
List<SelectedItem> selectedItems = new ArrayList<>();
List<String> result = cut.createWorkbasketReportBuilder()
@ -290,4 +290,55 @@ public class WorkbasketReportBuilderImplTest {
.listCustomAttributeValuesForCustomAttributeName(CustomField.CUSTOM_14);
assertNotNull(result);
}
@Test
public void testGetTotalNumbersOfWorkbasketReportBasedOnCreatedDate() throws InvalidArgumentException, NotAuthorizedException {
List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
List<TaskState> states = Arrays.asList(TaskState.CLAIMED, TaskState.READY);
List<String> categories = Collections.singletonList("EXTERN");
List<String> domains = Collections.singletonList("DOMAIN_A");
List<String> classificationIds = Collections.singletonList("L10000");
List<String> excludedClassificationIds = Collections.singletonList("L20000");
Map<CustomField, String> customAttributeFilter = new HashMap<>();
customAttributeFilter.put(CustomField.CUSTOM_1, "Geschaeftsstelle A");
List<CombinedClassificationFilter> combinedClassificationFilter = Arrays
.asList(new CombinedClassificationFilter("CLI:000000000000000000000000000000000003",
"CLI:000000000000000000000000000000000008"));
List<MonitorQueryItem> expectedResult = new ArrayList<>();
MonitorQueryItem monitorQueryItem = new MonitorQueryItem();
monitorQueryItem.setKey("WBI:000000000000000000000000000000000001");
monitorQueryItem.setNumberOfTasks(1);
expectedResult.add(monitorQueryItem);
doReturn(expectedResult).when(taskMonitorMapperMock).getTaskCountOfWorkbasketsBasedOnPlannedDate(workbasketIds, states,
categories, domains, classificationIds, excludedClassificationIds, customAttributeFilter,
combinedClassificationFilter);
WorkbasketReport actualResult = cut.createWorkbasketReportBuilder()
.workbasketIdIn(workbasketIds)
.stateIn(states)
.categoryIn(categories)
.domainIn(domains)
.classificationIdIn(classificationIds)
.excludedClassificationIdIn(excludedClassificationIds)
.customAttributeFilterIn(customAttributeFilter)
.combinedClassificationFilterIn(combinedClassificationFilter)
.buildPlannedDateBasedReport();
verify(taskanaEngineImplMock, times(1))
.openConnection();
verify(taskanaEngineImplMock, times(1)).checkRoleMembership(any());
verify(taskanaEngineImplMock, times(2)).getConfiguration();
verify(taskanaEngineConfiguration, times(1)).isGermanPublicHolidaysEnabled();
verify(taskanaEngineConfiguration, times(1)).getCustomHolidays();
verify(taskMonitorMapperMock, times(1)).getTaskCountOfWorkbasketsBasedOnPlannedDate(any(), any(), any(), any(),
any(), any(), any(), any());
verify(taskanaEngineImplMock, times(1)).returnConnection();
verifyNoMoreInteractions(taskanaEngineImplMock, taskMonitorMapperMock, taskanaEngineConfiguration);
assertNotNull(actualResult);
assertEquals(
actualResult.getRow("WBI:000000000000000000000000000000000001").getTotalValue(), 1);
assertEquals(actualResult.getSumRow().getTotalValue(), 1);
}
}

View File

@ -29,10 +29,10 @@ INSERT INTO ATTACHMENT VALUES('ATT:000000000000000000000000000000000010', 'TKI:0
INSERT INTO ATTACHMENT VALUES('ATT:000000000000000000000000000000000011', 'TKI:000000000000000000000000000000000045', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'L99000' ,'CLI:000000000000000000000000000000000009', '' , '' , '' , '' , '' , '' , CURRENT_TIMESTAMP, null );
-- TASK TABLE (ID , EXTERNAL_ID , CREATED , CLAIMED , COMPLETED , MODIFIED , PLANNED , DUE , NAME , CREATOR , DESCRIPTION , NOTE , PRIORITY, STATE , CLASSIFICATION_CATEGORY , CLASSIFICATION_KEY, CLASSIFICATION_ID , WORKBASKET_ID , WORKBASKET_KEY, DOMAIN , BUSINESS_PROCESS_ID, PARENT_BUSINESS_PROCESS_ID, OWNER , POR_COMPANY , POR_SYSTEM , POR_INSTANCE , POR_TYPE , POR_VALUE , IS_READ, IS_TRANSFERRED, CALLBACK_INFO, CUSTOM_ATTRIBUTES, CUSTOM_1 , CUSTOM_2 , CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8, CUSTOM_9 ,CUSTOM_10 ,CUSTOM_11 ,CUSTOM_12 ,CUSTOM_13 ,CUSTOM_14 ,CUSTOM_15 ,CUSTOM_16 );
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000001', 'ETI:000000000000000000000000000000000001', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, RELATIVE_DATE(-70000), 'Task01', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_01' );
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000002', 'ETI:000000000000000000000000000000000002', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, RELATIVE_DATE(-14000), 'Task02', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_02' );
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000001', 'ETI:000000000000000000000000000000000001', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, RELATIVE_DATE(-5), RELATIVE_DATE(-70000), 'Task01', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_01' );
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000002', 'ETI:000000000000000000000000000000000002', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, RELATIVE_DATE(-6), RELATIVE_DATE(-14000), 'Task02', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_02' );
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000003', 'ETI:000000000000000000000000000000000003', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, RELATIVE_DATE(-2800) , 'Task03', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_03' );
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000004', 'ETI:000000000000000000000000000000000004', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, RELATIVE_DATE(-1400) , 'Task04', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_04' );
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000004', 'ETI:000000000000000000000000000000000004', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, RELATIVE_DATE(-5), RELATIVE_DATE(-1400) , 'Task04', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_C', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle C' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_04' );
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000005', 'ETI:000000000000000000000000000000000005', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, RELATIVE_DATE(-1400) , 'Task05', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L20000' , 'CLI:000000000000000000000000000000000002', 'WBI:000000000000000000000000000000000003', 'USER_1_3' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_05' );
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000006', 'ETI:000000000000000000000000000000000006', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, RELATIVE_DATE(-700) , 'Task06', 'teamlead_1', 'Some description.', 'Some custom Note', 1 , 'READY' , 'AUTOMATIC' , 'L30000' , 'CLI:000000000000000000000000000000000003', 'WBI:000000000000000000000000000000000001', 'USER_1_1' , 'DOMAIN_B', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle B' , 'Teilkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_06' );
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000007', 'ETI:000000000000000000000000000000000007', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, null , CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, RELATIVE_DATE(-700) , 'Task07', 'teamlead_2', 'Some description.', 'Some custom Note', 1 , 'READY' , 'EXTERN' , 'L10000' , 'CLI:000000000000000000000000000000000001', 'WBI:000000000000000000000000000000000002', 'USER_1_2' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'John', 'MyCompany1', 'MySystem1', 'MyInstance1', 'MyType1', 'MyValue1', true , false , null , null , 'Geschaeftsstelle A' , 'Vollkasko' , null , null , null , null , null , null , null , null , null , null , null , null , null , 'VALUE_07' );

View File

@ -35,6 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
@ -47,6 +48,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>

View File

@ -46,14 +46,18 @@ public class MonitorController {
@RequestParam(required = false) List<TaskState> states) throws NotAuthorizedException,
InvalidArgumentException {
LOGGER.debug("Entry to getTasksStatusReport()");
ResponseEntity<ReportResource> response = new ResponseEntity<>(reportAssembler.toResource(
taskMonitorService.createTaskStatusReportBuilder().stateIn(states).domainIn(domains).buildReport(),
domains, states), HttpStatus.OK);
ReportResource report = reportAssembler.toResource(
taskMonitorService.createTaskStatusReportBuilder()
.stateIn(states)
.domainIn(domains)
.buildReport(),
domains, states);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Exit from getTasksStatusReport(), returning {}", response);
LOGGER.debug("Exit from getTasksStatusReport(), returning {}", report);
}
return response;
return ResponseEntity.status(HttpStatus.OK)
.body(report);
}
@GetMapping(path = "/tasks-workbasket-report")
@ -63,16 +67,40 @@ public class MonitorController {
@RequestParam(value = "states") List<TaskState> states)
throws NotAuthorizedException, InvalidArgumentException {
LOGGER.debug("Entry to getTasksWorkbasketReport()");
ResponseEntity<?> response = new ResponseEntity<>(reportAssembler.toResource(
ReportResource report = reportAssembler.toResource(
taskMonitorService.createWorkbasketReportBuilder()
.stateIn(states)
.withColumnHeaders(getTasksWorkbasketsTimeInterval(daysInPast)).buildReport(), daysInPast, states),
HttpStatus.OK);
.withColumnHeaders(getTasksWorkbasketsTimeInterval(daysInPast)).buildReport(), daysInPast, states);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Exit from getTasksWorkbasketReport(), returning {}", response);
LOGGER.debug("Exit from getTasksWorkbasketReport(), returning {}", report);
}
return response;
return ResponseEntity.status(HttpStatus.OK)
.body(report);
}
@GetMapping(path = "/tasks-workbasket-planned-date-report")
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ResponseEntity<?> getTasksWorkbasketPlannedDateReport(
@RequestParam(value = "daysInPast") int daysInPast,
@RequestParam(value = "states") List<TaskState> states)
throws NotAuthorizedException, InvalidArgumentException {
LOGGER.debug("Entry to getTasksWorkbasketPlannedDateReport()");
ReportResource report = reportAssembler.toResource(
taskMonitorService.createWorkbasketReportBuilder()
.stateIn(states)
.withColumnHeaders(getTasksWorkbasketsTimeInterval(daysInPast)).buildPlannedDateBasedReport(),
daysInPast, states);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Exit from getTasksWorkbasketPlannedDateReport(), returning {}", report);
}
return ResponseEntity.status(HttpStatus.OK)
.body(report);
}
@GetMapping(path = "/tasks-classification-report")
@ -80,15 +108,18 @@ public class MonitorController {
public ResponseEntity<ReportResource> getTasksClassificationReport()
throws NotAuthorizedException, InvalidArgumentException {
LOGGER.debug("Entry to getTasksClassificationReport()");
ResponseEntity<ReportResource> response = new ResponseEntity<>(reportAssembler.toResource(
ReportResource report = reportAssembler.toResource(
taskMonitorService.createClassificationReportBuilder()
.withColumnHeaders(getTaskClassificationTimeInterval())
.buildReport()), HttpStatus.OK);
.buildReport());
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Exit from getTasksClassificationReport(), returning {}", response);
LOGGER.debug("Exit from getTasksClassificationReport(), returning {}", report);
}
return response;
return ResponseEntity.status(HttpStatus.OK)
.body(report);
}
@GetMapping(path = "/timestamp-report")

View File

@ -9,4 +9,5 @@
<taskana-remove-confirmation></taskana-remove-confirmation>
<taskana-progress-bar [ngClass]="{hidden: currentProgressValue === 0}" currentValue={{currentProgressValue}}></taskana-progress-bar>
</div>
</div>
<taskana-type-ahead></taskana-type-ahead>
</div>

View File

@ -23,7 +23,7 @@ export class RestConnectorService {
getWorkbasketStatistics(): Observable<ReportData> {
return this.httpClient.get<ReportData>(environment.taskanaRestUrl
+ monitorUrl + 'tasks-workbasket-report?daysInPast=5&states=READY,CLAIMED,COMPLETED');
+ monitorUrl + 'tasks-workbasket-planned-date-report?daysInPast=5&states=READY,CLAIMED,COMPLETED');
}
getClassificationTasksReport(): Observable<ReportData> {