public interface TaskMonitorMapper
@Select(value="<script><if test=\"_databaseId == \'db2\'\">SELECT WORKBASKET_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> <if test=\"_databaseId == \'h2\'\">SELECT WORKBASKET_KEY, DATEDIFF(\'DAY\', CURRENT_TIMESTAMP, DUE) as AGE_IN_DAYS, COUNT(*) as NUMBER_OF_TASKS</if> FROM TASKANA.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=\"customField != null and customFieldValues != null\">AND ${customField} IN (<foreach collection=\'customFieldValues\' item=\'customFieldValue\' separator=\',\'>#{customFieldValue}</foreach>) </if>AND DUE IS NOT NULL </where><if test=\"_databaseId == \'db2\'\">GROUP BY WORKBASKET_KEY, (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP))</if> <if test=\"_databaseId == \'h2\'\">GROUP BY WORKBASKET_KEY, DATEDIFF(\'DAY\', CURRENT_TIMESTAMP, DUE)</if> <if test=\"_databaseId == \'db2\'\">with UR </if> </script>")
@Result(column="WORKBASKET_KEY",property="key") @Result(column="AGE_IN_DAYS",property="ageInDays") @Result(column="NUMBER_OF_TASKS",property="numberOfTasks")
List<MonitorQueryItem> getTaskCountOfWorkbaskets(@Param(value="workbasketIds")
List<String> workbasketIds,
@Param(value="states")
List<TaskState> states,
@Param(value="categories")
List<String> categories,
@Param(value="domains")
List<String> domains,
@Param(value="customField")
CustomField customField,
@Param(value="customFieldValues")
List<String> customFieldValues)
@Select(value="<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> FROM TASKANA.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=\"customField != null and customFieldValues != null\">AND ${customField} IN (<foreach collection=\'customFieldValues\' item=\'customFieldValue\' separator=\',\'>#{customFieldValue}</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 == \'db2\'\">with UR </if> </script>")
@Result(column="CLASSIFICATION_CATEGORY",property="key") @Result(column="AGE_IN_DAYS",property="ageInDays") @Result(column="NUMBER_OF_TASKS",property="numberOfTasks")
List<MonitorQueryItem> getTaskCountOfCategories(@Param(value="workbasketIds")
List<String> workbasketIds,
@Param(value="states")
List<TaskState> states,
@Param(value="categories")
List<String> categories,
@Param(value="domains")
List<String> domains,
@Param(value="customField")
CustomField customField,
@Param(value="customFieldValues")
List<String> customFieldValues)
@Select(value="<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> FROM TASKANA.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=\"customField != null and customFieldValues != null\">AND ${customField} IN (<foreach collection=\'customFieldValues\' item=\'customFieldValue\' separator=\',\'>#{customFieldValue}</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 == \'db2\'\">with UR </if> </script>")
@Result(column="CLASSIFICATION_KEY",property="key") @Result(column="AGE_IN_DAYS",property="ageInDays") @Result(column="NUMBER_OF_TASKS",property="numberOfTasks")
List<MonitorQueryItem> getTaskCountOfClassifications(@Param(value="workbasketIds")
List<String> workbasketIds,
@Param(value="states")
List<TaskState> states,
@Param(value="categories")
List<String> categories,
@Param(value="domains")
List<String> domains,
@Param(value="customField")
CustomField customField,
@Param(value="customFieldValues")
List<String> customFieldValues)
@Select(value="<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> FROM TASKANA.TASK AS T LEFT JOIN TASKANA.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=\"customField != null and customFieldValues != null\">AND ${customField} IN (<foreach collection=\'customFieldValues\' item=\'customFieldValue\' separator=\',\'>#{customFieldValue}</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 == \'db2\'\">with UR </if> </script>")
@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(value="workbasketIds")
List<String> workbasketIds,
@Param(value="states")
List<TaskState> states,
@Param(value="categories")
List<String> categories,
@Param(value="domains")
List<String> domains,
@Param(value="customField")
CustomField customField,
@Param(value="customFieldValues")
List<String> customFieldValues)
@Select(value="<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> FROM TASKANA.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=\"customField != null and customFieldValues != null\">AND ${customField} IN (<foreach collection=\'customFieldValues\' item=\'customFieldValue\' separator=\',\'>#{customFieldValue}</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 == \'db2\'\">with UR </if> </script>")
@Result(column="CUSTOM_FIELD",property="key") @Result(column="AGE_IN_DAYS",property="ageInDays") @Result(column="NUMBER_OF_TASKS",property="numberOfTasks")
List<MonitorQueryItem> getTaskCountOfCustomFieldValues(@Param(value="workbasketIds")
List<String> workbasketIds,
@Param(value="states")
List<TaskState> states,
@Param(value="categories")
List<String> categories,
@Param(value="domains")
List<String> domains,
@Param(value="customField")
CustomField customField,
@Param(value="customFieldValues")
List<String> customFieldValues)
@Select(value="<script>SELECT ID FROM TASKANA.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=\"customField != null and customFieldValues != null\">AND ${customField} IN (<foreach collection=\'customFieldValues\' item=\'customFieldValue\' separator=\',\'>#{customFieldValue}</foreach>) </if>AND DUE IS NOT NULL AND ( <foreach collection=\'selectedItems\' item=\'selectedItem\' separator=\' OR \'>#{selectedItem.key} = CLASSIFICATION_CATEGORY AND <if test=\"_databaseId == \'db2\'\">#{selectedItem.upperAgeLimit} >= (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) AND #{selectedItem.lowerAgeLimit} <= (DAYS(DUE) - DAYS(CURRENT_TIMESTAMP)) </if> <if test=\"_databaseId == \'h2\'\">#{selectedItem.upperAgeLimit} >= DATEDIFF(\'DAY\', CURRENT_TIMESTAMP, DUE) AND #{selectedItem.lowerAgeLimit} <= DATEDIFF(\'DAY\', CURRENT_TIMESTAMP, DUE) </if> </foreach>) </where><if test=\"_databaseId == \'db2\'\">with UR </if> </script>")
List<String> getTaskIdsOfCategoriesBySelectedItems(@Param(value="workbasketIds")
List<String> workbasketIds,
@Param(value="states")
List<TaskState> states,
@Param(value="categories")
List<String> categories,
@Param(value="domains")
List<String> domains,
@Param(value="customField")
CustomField customField,
@Param(value="customFieldValues")
List<String> customFieldValues,
@Param(value="selectedItems")
List<SelectedItem> selectedItems)
@Select(value="<script>SELECT DOMAIN, STATE, COUNT(STATE) as COUNT FROM TASKANA.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>")
@Result(column="DOMAIN",property="domain") @Result(column="STATE",property="state") @Result(column="COUNT",property="count")
List<TaskQueryItem> getTasksCountByState(@Param(value="domains")
List<String> domains,
@Param(value="states")
List<TaskState> states)
Copyright © 2018. All rights reserved.