diff --git a/lib/taskana-core/src/main/java/pro/taskana/ClassificationQuery.java b/lib/taskana-core/src/main/java/pro/taskana/ClassificationQuery.java index cd5d8f464..a75b0594a 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/ClassificationQuery.java +++ b/lib/taskana-core/src/main/java/pro/taskana/ClassificationQuery.java @@ -284,4 +284,164 @@ public interface ClassificationQuery extends BaseQuery { * @return the query */ ClassificationQuery custom8Like(String... custom8Like); + + /** + * Sort the query result by key. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + ClassificationQuery orderByKey(SortDirection sortDirection); + + /** + * Sort the query result by the parent classification ID. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + ClassificationQuery orderByParentId(SortDirection sortDirection); + + /** + * Sort the query result by category. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + ClassificationQuery orderByCategory(SortDirection sortDirection); + + /** + * Sort the query result by domain. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + ClassificationQuery orderByDomain(SortDirection sortDirection); + + /** + * Sort the query result by name. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + ClassificationQuery orderByName(SortDirection sortDirection); + + /** + * Sort the query result by service level. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + ClassificationQuery orderByServiceLevel(SortDirection sortDirection); + + /** + * Sort the query result by priority. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + ClassificationQuery orderByPriority(SortDirection sortDirection); + + /** + * Sort the query result by the application entry point name. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + ClassificationQuery orderByApplicationEntryPoint(SortDirection sortDirection); + + /** + * Sort the query result by custom property 1. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + ClassificationQuery orderByCustom1(SortDirection sortDirection); + + /** + * Sort the query result by custom property 2. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + ClassificationQuery orderByCustom2(SortDirection sortDirection); + + /** + * Sort the query result by custom property 3. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + ClassificationQuery orderByCustom3(SortDirection sortDirection); + + /** + * Sort the query result by custom property 4. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + ClassificationQuery orderByCustom4(SortDirection sortDirection); + + /** + * Sort the query result by custom property 5. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + ClassificationQuery orderByCustom5(SortDirection sortDirection); + + /** + * Sort the query result by custom property 6. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + ClassificationQuery orderByCustom6(SortDirection sortDirection); + + /** + * Sort the query result by custom property 7. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + ClassificationQuery orderByCustom7(SortDirection sortDirection); + + /** + * Sort the query result by custom property 8. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + ClassificationQuery orderByCustom8(SortDirection sortDirection); } diff --git a/lib/taskana-core/src/main/java/pro/taskana/WorkbasketQuery.java b/lib/taskana-core/src/main/java/pro/taskana/WorkbasketQuery.java index 0ec64f50e..11c4b20af 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/WorkbasketQuery.java +++ b/lib/taskana-core/src/main/java/pro/taskana/WorkbasketQuery.java @@ -215,4 +215,264 @@ public interface WorkbasketQuery extends BaseQuery { */ WorkbasketQuery orderByType(SortDirection sortDirection); + /** + * Sort the query result by domain. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + WorkbasketQuery orderByDomain(SortDirection sortDirection); + + /** + * Add the domains for pattern matching to your query. It will be compared in SQL with the LIKE operator. You may + * use a wildcard like % to specify the pattern. If you specify multiple arguments they are combined with the OR + * keyword. + * + * @param domain + * the domains of workbaskets as Strings + * @return the query + */ + WorkbasketQuery domainLike(String... domain); + + /** + * Sort the query result by custom property 1. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + WorkbasketQuery orderByCustom1(SortDirection sortDirection); + + /** + * Sort the query result by custom property 2. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + WorkbasketQuery orderByCustom2(SortDirection sortDirection); + + /** + * Sort the query result by custom property 3. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + WorkbasketQuery orderByCustom3(SortDirection sortDirection); + + /** + * Sort the query result by custom property 4. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + WorkbasketQuery orderByCustom4(SortDirection sortDirection); + + /** + * Sort the query result by organization level 1. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + WorkbasketQuery orderByOrgLevel1(SortDirection sortDirection); + + /** + * Sort the query result by organization level 2. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + WorkbasketQuery orderByOrgLevel2(SortDirection sortDirection); + + /** + * Sort the query result by organization level 3. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + WorkbasketQuery orderByOrgLevel3(SortDirection sortDirection); + + /** + * Sort the query result by organization level 4. + * + * @param sortDirection + * Determines whether the result is sorted in ascending or descending order. If sortDirection is null, + * the result is sorted in ascending order + * @return the query + */ + WorkbasketQuery orderByOrgLevel4(SortDirection sortDirection); + + /** + * Add the 1st custom property to your query. + * + * @param custom1 + * the 1st custom property as String + * @return the query + */ + WorkbasketQuery custom1In(String... custom1); + + /** + * Add the 1st custom property for pattern matching to your query. It will be compared in SQL with the LIKE + * operator. You may use a wildcard like % to specify the pattern. If you specify multiple arguments they are + * combined with the OR keyword. + * + * @param custom1 + * the 1st custom property of workbaskets as Strings + * @return the query + */ + WorkbasketQuery custom1Like(String... custom1); + + /** + * Add the 2nd custom property to your query. + * + * @param custom2 + * the 2nd custom property as String + * @return the query + */ + WorkbasketQuery custom2In(String... custom2); + + /** + * Add the 2nd custom property for pattern matching to your query. It will be compared in SQL with the LIKE + * operator. You may use a wildcard like % to specify the pattern. If you specify multiple arguments they are + * combined with the OR keyword. + * + * @param custom2 + * the 2nd custom property of workbaskets as Strings + * @return the query + */ + WorkbasketQuery custom2Like(String... custom2); + + /** + * Add the 3rd custom property to your query. + * + * @param custom3 + * the 3rd custom property as String + * @return the query + */ + WorkbasketQuery custom3In(String... custom3); + + /** + * Add the 3rd custom property for pattern matching to your query. It will be compared in SQL with the LIKE + * operator. You may use a wildcard like % to specify the pattern. If you specify multiple arguments they are + * combined with the OR keyword. + * + * @param custom3 + * the 3rd custom property of workbaskets as Strings + * @return the query + */ + WorkbasketQuery custom3Like(String... custom3); + + /** + * Add the 4th custom property to your query. + * + * @param custom4 + * the 4th custom property as String + * @return the query + */ + WorkbasketQuery custom4In(String... custom4); + + /** + * Add the 4th custom property for pattern matching to your query. It will be compared in SQL with the LIKE + * operator. You may use a wildcard like % to specify the pattern. If you specify multiple arguments they are + * combined with the OR keyword. + * + * @param custom4 + * the 4th custom property of workbaskets as Strings + * @return the query + */ + WorkbasketQuery custom4Like(String... custom4); + + /** + * Add the 1st organization level to your query. + * + * @param orgLevel1 + * the 1st organization level as String + * @return the query + */ + WorkbasketQuery orgLevel1In(String... orgLevel1); + + /** + * Add the 1st organization level for pattern matching to your query. It will be compared in SQL with the LIKE + * operator. You may use a wildcard like % to specify the pattern. If you specify multiple arguments they are + * combined with the OR keyword. + * + * @param orgLevel1 + * the 1st organization level as Strings + * @return the query + */ + WorkbasketQuery orgLevel1Like(String... orgLevel1); + + /** + * Add the 2nd organization level to your query. + * + * @param orgLevel2 + * the 2nd organization level as String + * @return the query + */ + WorkbasketQuery orgLevel2In(String... orgLevel2); + + /** + * Add the 2nd organization level for pattern matching to your query. It will be compared in SQL with the LIKE + * operator. You may use a wildcard like % to specify the pattern. If you specify multiple arguments they are + * combined with the OR keyword. + * + * @param orgLevel2 + * the 2nd organization level as Strings + * @return the query + */ + WorkbasketQuery orgLevel2Like(String... orgLevel2); + + /** + * Add the 3rd organization level to your query. + * + * @param orgLevel3 + * the 3rd organization level as String + * @return the query + */ + WorkbasketQuery orgLevel3In(String... orgLevel3); + + /** + * Add the 3rd organization level for pattern matching to your query. It will be compared in SQL with the LIKE + * operator. You may use a wildcard like % to specify the pattern. If you specify multiple arguments they are + * combined with the OR keyword. + * + * @param orgLevel3 + * the 3rd organization level as Strings + * @return the query + */ + WorkbasketQuery orgLevel3Like(String... orgLevel3); + + /** + * Add the 4th organization level to your query. + * + * @param orgLevel4 + * the 4th organization level as String + * @return the query + */ + WorkbasketQuery orgLevel4In(String... orgLevel4); + + /** + * Add the 4th organization level for pattern matching to your query. It will be compared in SQL with the LIKE + * operator. You may use a wildcard like % to specify the pattern. If you specify multiple arguments they are + * combined with the OR keyword. + * + * @param orgLevel4 + * the 4th organization level as Strings + * @return the query + */ + WorkbasketQuery orgLevel4Like(String... orgLevel4); } diff --git a/lib/taskana-core/src/main/java/pro/taskana/impl/ClassificationQueryImpl.java b/lib/taskana-core/src/main/java/pro/taskana/impl/ClassificationQueryImpl.java index 27c46675d..f3b43efc1 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/impl/ClassificationQueryImpl.java +++ b/lib/taskana-core/src/main/java/pro/taskana/impl/ClassificationQueryImpl.java @@ -1,5 +1,6 @@ package pro.taskana.impl; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -57,9 +58,11 @@ public class ClassificationQueryImpl implements ClassificationQuery { private String[] custom7Like; private String[] custom8In; private String[] custom8Like; + private List orderBy; ClassificationQueryImpl(TaskanaEngine taskanaEngine) { this.taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine; + this.orderBy = new ArrayList<>(); } @Override @@ -253,6 +256,86 @@ public class ClassificationQueryImpl implements ClassificationQuery { return this; } + @Override + public ClassificationQuery orderByKey(SortDirection sortDirection) { + return addOrderCriteria("KEY", sortDirection); + } + + @Override + public ClassificationQuery orderByParentId(SortDirection sortDirection) { + return addOrderCriteria("PARENT_ID", sortDirection); + } + + @Override + public ClassificationQuery orderByCategory(SortDirection sortDirection) { + return addOrderCriteria("CATEGORY", sortDirection); + } + + @Override + public ClassificationQuery orderByDomain(SortDirection sortDirection) { + return addOrderCriteria("DOMAIN", sortDirection); + } + + @Override + public ClassificationQuery orderByPriority(SortDirection sortDirection) { + return addOrderCriteria("PRIORITY", sortDirection); + } + + @Override + public ClassificationQuery orderByName(SortDirection sortDirection) { + return addOrderCriteria("NAME", sortDirection); + } + + @Override + public ClassificationQuery orderByServiceLevel(SortDirection sortDirection) { + return addOrderCriteria("SERVICE_LEVEL", sortDirection); + } + + @Override + public ClassificationQuery orderByApplicationEntryPoint(SortDirection sortDirection) { + return addOrderCriteria("APPLICATION_ENTRY_POINT", sortDirection); + } + + @Override + public ClassificationQuery orderByCustom1(SortDirection sortDirection) { + return addOrderCriteria("CUSTOM_1", sortDirection); + } + + @Override + public ClassificationQuery orderByCustom2(SortDirection sortDirection) { + return addOrderCriteria("CUSTOM_2", sortDirection); + } + + @Override + public ClassificationQuery orderByCustom3(SortDirection sortDirection) { + return addOrderCriteria("CUSTOM_3", sortDirection); + } + + @Override + public ClassificationQuery orderByCustom4(SortDirection sortDirection) { + return addOrderCriteria("CUSTOM_4", sortDirection); + } + + @Override + public ClassificationQuery orderByCustom5(SortDirection sortDirection) { + return addOrderCriteria("CUSTOM_5", sortDirection); + } + + @Override + public ClassificationQuery orderByCustom6(SortDirection sortDirection) { + return addOrderCriteria("CUSTOM_6", sortDirection); + } + + @Override + public ClassificationQuery orderByCustom7(SortDirection sortDirection) { + return addOrderCriteria("CUSTOM_7", sortDirection); + } + + @Override + public ClassificationQuery orderByCustom8(SortDirection sortDirection) { + return addOrderCriteria("CUSTOM_8", sortDirection); + } + @Override public List list() { LOGGER.debug("entry to list(), this = {}", this); @@ -314,6 +397,15 @@ public class ClassificationQueryImpl implements ClassificationQuery { } } + private ClassificationQuery addOrderCriteria(String columnName, SortDirection sortDirection) { + String orderByDirection = " ASC"; + if (sortDirection != null && SortDirection.DESCENDING.equals(sortDirection)) { + orderByDirection = " DESC"; + } + orderBy.add(columnName + orderByDirection); + return this; + } + public String[] getKey() { return key; } diff --git a/lib/taskana-core/src/main/java/pro/taskana/impl/WorkbasketQueryImpl.java b/lib/taskana-core/src/main/java/pro/taskana/impl/WorkbasketQueryImpl.java index 8efe334ab..f5aa70798 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/impl/WorkbasketQueryImpl.java +++ b/lib/taskana-core/src/main/java/pro/taskana/impl/WorkbasketQueryImpl.java @@ -36,19 +36,36 @@ public class WorkbasketQueryImpl implements WorkbasketQuery { private String[] keyIn; private String[] keyLike; private String[] keyOrNameLike; - private String[] domain; + private String[] domainIn; + private String[] domainLike; private WorkbasketType[] type; private TimeInterval[] createdIn; private TimeInterval[] modifiedIn; private String[] descriptionLike; private String[] ownerIn; private String[] ownerLike; + private String[] custom1In; + private String[] custom1Like; + private String[] custom2In; + private String[] custom2Like; + private String[] custom3In; + private String[] custom3Like; + private String[] custom4In; + private String[] custom4Like; + private String[] orgLevel1In; + private String[] orgLevel1Like; + private String[] orgLevel2In; + private String[] orgLevel2Like; + private String[] orgLevel3In; + private String[] orgLevel3Like; + private String[] orgLevel4In; + private String[] orgLevel4Like; private TaskanaEngineImpl taskanaEngineImpl; private List orderBy; WorkbasketQueryImpl(TaskanaEngine taskanaEngine) { this.taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine; - orderBy = new ArrayList<>(); + this.orderBy = new ArrayList<>(); } @Override @@ -58,14 +75,8 @@ public class WorkbasketQueryImpl implements WorkbasketQuery { } @Override - public WorkbasketQuery domainIn(String... domain) { - this.domain = domain; - return this; - } - - @Override - public WorkbasketQuery typeIn(WorkbasketType... type) { - this.type = type; + public WorkbasketQuery keyLike(String... keys) { + this.keyLike = toUpperCopy(keys); return this; } @@ -82,14 +93,26 @@ public class WorkbasketQueryImpl implements WorkbasketQuery { } @Override - public WorkbasketQuery keyLike(String... keys) { - this.keyLike = toUpperCopy(keys); + public WorkbasketQuery keyOrNameLike(String... keysOrNames) { + this.keyOrNameLike = toUpperCopy(keysOrNames); return this; } @Override - public WorkbasketQuery keyOrNameLike(String... keysOrNames) { - this.keyOrNameLike = toUpperCopy(keysOrNames); + public WorkbasketQuery domainIn(String... domain) { + this.domainIn = domain; + return this; + } + + @Override + public WorkbasketQuery domainLike(String... domain) { + this.domainLike = domain; + return this; + } + + @Override + public WorkbasketQuery typeIn(WorkbasketType... type) { + this.type = type; return this; } @@ -133,6 +156,102 @@ public class WorkbasketQueryImpl implements WorkbasketQuery { return this; } + @Override + public WorkbasketQuery custom1In(String... custom1) { + this.custom1In = custom1; + return this; + } + + @Override + public WorkbasketQuery custom1Like(String... custom1) { + this.custom1Like = toUpperCopy(custom1); + return this; + } + + @Override + public WorkbasketQuery custom2In(String... custom2) { + this.custom2In = custom2; + return this; + } + + @Override + public WorkbasketQuery custom2Like(String... custom2) { + this.custom2Like = toUpperCopy(custom2); + return this; + } + + @Override + public WorkbasketQuery custom3In(String... custom3) { + this.custom3In = custom3; + return this; + } + + @Override + public WorkbasketQuery custom3Like(String... custom3) { + this.custom3Like = toUpperCopy(custom3); + return this; + } + + @Override + public WorkbasketQuery custom4In(String... custom4) { + this.custom4In = custom4; + return this; + } + + @Override + public WorkbasketQuery custom4Like(String... custom4) { + this.custom4Like = toUpperCopy(custom4); + return this; + } + + @Override + public WorkbasketQuery orgLevel1In(String... orgLevel1) { + this.orgLevel1In = orgLevel1; + return this; + } + + @Override + public WorkbasketQuery orgLevel1Like(String... orgLevel1) { + this.orgLevel1Like = toUpperCopy(orgLevel1); + return this; + } + + @Override + public WorkbasketQuery orgLevel2In(String... orgLevel2) { + this.orgLevel2In = orgLevel2; + return this; + } + + @Override + public WorkbasketQuery orgLevel2Like(String... orgLevel2) { + this.orgLevel2Like = toUpperCopy(orgLevel2); + return this; + } + + @Override + public WorkbasketQuery orgLevel3In(String... orgLevel3) { + this.orgLevel3In = orgLevel3; + return this; + } + + @Override + public WorkbasketQuery orgLevel3Like(String... orgLevel3) { + this.orgLevel3Like = toUpperCopy(orgLevel3); + return this; + } + + @Override + public WorkbasketQuery orgLevel4In(String... orgLevel4) { + this.orgLevel4In = orgLevel4; + return this; + } + + @Override + public WorkbasketQuery orgLevel4Like(String... orgLevel4) { + this.orgLevel4Like = toUpperCopy(orgLevel4); + return this; + } + @Override public WorkbasketQuery orderByName(SortDirection sortDirection) { return addOrderCriteria("NAME", sortDirection); @@ -143,6 +262,11 @@ public class WorkbasketQueryImpl implements WorkbasketQuery { return addOrderCriteria("KEY", sortDirection); } + @Override + public WorkbasketQuery orderByDomain(SortDirection sortDirection) { + return addOrderCriteria("DOMAIN", sortDirection); + } + @Override public WorkbasketQuery orderByDescription(SortDirection sortDirection) { return addOrderCriteria("DESCRIPTION", sortDirection); @@ -158,6 +282,46 @@ public class WorkbasketQueryImpl implements WorkbasketQuery { return addOrderCriteria("TYPE", sortDirection); } + @Override + public WorkbasketQuery orderByCustom1(SortDirection sortDirection) { + return addOrderCriteria("CUSTOM_1", sortDirection); + } + + @Override + public WorkbasketQuery orderByCustom2(SortDirection sortDirection) { + return addOrderCriteria("CUSTOM_2", sortDirection); + } + + @Override + public WorkbasketQuery orderByCustom3(SortDirection sortDirection) { + return addOrderCriteria("CUSTOM_3", sortDirection); + } + + @Override + public WorkbasketQuery orderByCustom4(SortDirection sortDirection) { + return addOrderCriteria("CUSTOM_4", sortDirection); + } + + @Override + public WorkbasketQuery orderByOrgLevel1(SortDirection sortDirection) { + return addOrderCriteria("ORG_LEVEL_1", sortDirection); + } + + @Override + public WorkbasketQuery orderByOrgLevel2(SortDirection sortDirection) { + return addOrderCriteria("ORG_LEVEL_2", sortDirection); + } + + @Override + public WorkbasketQuery orderByOrgLevel3(SortDirection sortDirection) { + return addOrderCriteria("ORG_LEVEL_3", sortDirection); + } + + @Override + public WorkbasketQuery orderByOrgLevel4(SortDirection sortDirection) { + return addOrderCriteria("ORG_LEVEL_4", sortDirection); + } + @Override public WorkbasketQuery accessIdsHavePermission(WorkbasketAuthorization permission, String... accessIds) throws InvalidArgumentException { @@ -289,10 +453,6 @@ public class WorkbasketQueryImpl implements WorkbasketQuery { return keyOrNameLike; } - public String[] getDomain() { - return domain; - } - public WorkbasketType[] getType() { return type; } @@ -313,6 +473,78 @@ public class WorkbasketQueryImpl implements WorkbasketQuery { return ownerIn; } + public String[] getDomainIn() { + return domainIn; + } + + public String[] getDomainLike() { + return domainLike; + } + + public String[] getCustom1In() { + return custom1In; + } + + public String[] getCustom1Like() { + return custom1Like; + } + + public String[] getCustom2In() { + return custom2In; + } + + public String[] getCustom2Like() { + return custom2Like; + } + + public String[] getCustom3In() { + return custom3In; + } + + public String[] getCustom3Like() { + return custom3Like; + } + + public String[] getCustom4In() { + return custom4In; + } + + public String[] getCustom4Like() { + return custom4Like; + } + + public String[] getOrgLevel1In() { + return orgLevel1In; + } + + public String[] getOrgLevel1Like() { + return orgLevel1Like; + } + + public String[] getOrgLevel2In() { + return orgLevel2In; + } + + public String[] getOrgLevel2Like() { + return orgLevel2Like; + } + + public String[] getOrgLevel3In() { + return orgLevel3In; + } + + public String[] getOrgLevel3Like() { + return orgLevel3Like; + } + + public String[] getOrgLevel4In() { + return orgLevel4In; + } + + public String[] getOrgLevel4Like() { + return orgLevel4Like; + } + public String[] getOwnerLike() { return ownerLike; } @@ -352,8 +584,10 @@ public class WorkbasketQueryImpl implements WorkbasketQuery { builder.append(Arrays.toString(keyLike)); builder.append(", keyOrNameLike="); builder.append(Arrays.toString(keyOrNameLike)); - builder.append(", domain="); - builder.append(Arrays.toString(domain)); + builder.append(", domainIn="); + builder.append(Arrays.toString(domainIn)); + builder.append(", domainLike="); + builder.append(Arrays.toString(domainLike)); builder.append(", type="); builder.append(Arrays.toString(type)); builder.append(", createdIn="); @@ -366,6 +600,38 @@ public class WorkbasketQueryImpl implements WorkbasketQuery { builder.append(Arrays.toString(ownerIn)); builder.append(", ownerLike="); builder.append(Arrays.toString(ownerLike)); + builder.append(", custom1In="); + builder.append(Arrays.toString(custom1In)); + builder.append(", custom1Like="); + builder.append(Arrays.toString(custom1Like)); + builder.append(", custom2In="); + builder.append(Arrays.toString(custom2In)); + builder.append(", custom2Like="); + builder.append(Arrays.toString(custom2Like)); + builder.append(", custom3In="); + builder.append(Arrays.toString(custom3In)); + builder.append(", custom3Like="); + builder.append(Arrays.toString(custom3Like)); + builder.append(", custom4In="); + builder.append(Arrays.toString(custom4In)); + builder.append(", custom4Like="); + builder.append(Arrays.toString(custom4Like)); + builder.append(", orgLevel1In="); + builder.append(Arrays.toString(orgLevel1In)); + builder.append(", orgLevel1Like="); + builder.append(Arrays.toString(orgLevel1Like)); + builder.append(", orgLevel2In="); + builder.append(Arrays.toString(orgLevel2In)); + builder.append(", orgLevel2Like="); + builder.append(Arrays.toString(orgLevel2Like)); + builder.append(", orgLevel3In="); + builder.append(Arrays.toString(orgLevel3In)); + builder.append(", orgLevel3Like="); + builder.append(Arrays.toString(orgLevel3Like)); + builder.append(", orgLevel4In="); + builder.append(Arrays.toString(orgLevel4In)); + builder.append(", orgLevel4Like="); + builder.append(Arrays.toString(orgLevel4Like)); builder.append(", orderBy="); builder.append(orderBy); builder.append("]"); diff --git a/lib/taskana-core/src/main/java/pro/taskana/mappings/QueryMapper.java b/lib/taskana-core/src/main/java/pro/taskana/mappings/QueryMapper.java index 2e678db99..ba3b3cb5b 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/mappings/QueryMapper.java +++ b/lib/taskana-core/src/main/java/pro/taskana/mappings/QueryMapper.java @@ -165,6 +165,7 @@ public interface QueryMapper { + "AND CUSTOM_8 IN(#{item}) " + "AND ( CUSTOM_8 LIKE #{item}) " + "" + + "ORDER BY ${item} " + "") @Results({@Result(property = "id", column = "ID"), @Result(property = "key", column = "KEY"), @@ -205,12 +206,29 @@ public interface QueryMapper { + "AND UPPER(w.NAME) IN(#{item}) " + "AND (UPPER(w.NAME) LIKE #{item}) " + "AND (UPPER(w.NAME) LIKE #{item} OR UPPER(w.KEY) LIKE #{item}) " - + "AND w.DOMAIN IN(#{item}) " + + "AND w.DOMAIN IN(#{item}) " + + "AND (UPPER(w.DOMAIN) LIKE #{item}) " + "AND w.TYPE IN(#{item}) " + " AND ( ( w.CREATED >= #{item.begin} AND w.CREATED <=#{item.end} )) " + " AND ( ( w.MODIFIED >= #{item.begin} AND w.MODIFIED <=#{item.end} )) " + "AND (UPPER(w.DESCRIPTION) LIKE #{item}) " + "AND a.ACCESS_ID IN(#{item}) AND PERM_READ = 1 " + + "AND UPPER(w.CUSTOM_1) IN(#{item}) " + + "AND (UPPER(w.CUSTOM_1) LIKE #{item}) " + + "AND UPPER(w.CUSTOM_2) IN(#{item}) " + + "AND (UPPER(w.CUSTOM_2) LIKE #{item}) " + + "AND UPPER(w.CUSTOM_3) IN(#{item}) " + + "AND (UPPER(w.CUSTOM_3) LIKE #{item}) " + + "AND UPPER(w.CUSTOM_4) IN(#{item}) " + + "AND (UPPER(w.CUSTOM_4) LIKE #{item}) " + + "AND UPPER(w.ORG_LEVEL_1) IN(#{item}) " + + "AND (UPPER(w.ORG_LEVEL_1) LIKE #{item}) " + + "AND UPPER(w.ORG_LEVEL_2) IN(#{item}) " + + "AND (UPPER(w.ORG_LEVEL_2) LIKE #{item}) " + + "AND UPPER(w.ORG_LEVEL_3) IN(#{item}) " + + "AND (UPPER(w.ORG_LEVEL_3) LIKE #{item}) " + + "AND UPPER(w.ORG_LEVEL_4) IN(#{item}) " + + "AND (UPPER(w.ORG_LEVEL_4) LIKE #{item}) " + "AND " + "PERM_OPEN " + "PERM_READ" @@ -396,7 +414,8 @@ public interface QueryMapper { + "") Long countQueryObjectReferences(ObjectReferenceQueryImpl objectReference); - @Select("