TSK-69: Offer all values of a DB-Column with filter by Query.
This commit is contained in:
parent
b07a35b5e5
commit
1809c95265
|
@ -31,6 +31,18 @@ public interface BaseQuery<T> {
|
|||
*/
|
||||
List<T> list(int offset, int limit);
|
||||
|
||||
/**
|
||||
* This method will return all currently existing values of a DB-Table once. The order of the returning values can
|
||||
* be configured ASC oder DEC - DEFAULT at NULL is ASC. <br>
|
||||
* All called orderBy()-Methods will be override. Just the current column-values will be ordered itself by the given
|
||||
* direction.
|
||||
*
|
||||
* @param dbColumnName
|
||||
* column name of a existing DB Table.
|
||||
* @return a list of all existing values.
|
||||
*/
|
||||
List<String> listValues(String dbColumnName, SortDirection sortDirection);
|
||||
|
||||
/**
|
||||
* This method will return all results for page X with a size of Y of the current query.<br>
|
||||
* Negative pageNumber/size will be changed to 0 and the last page got maybe less elements. In case of a TaskQuery,
|
||||
|
|
|
@ -23,10 +23,12 @@ import pro.taskana.impl.util.LoggerUtils;
|
|||
*/
|
||||
public class ClassificationQueryImpl implements ClassificationQuery {
|
||||
|
||||
private static final String LINK_TO_MAPPER = "pro.taskana.mappings.QueryMapper.queryClassification";
|
||||
private static final String LINK_TO_SUMMARYMAPPER = "pro.taskana.mappings.QueryMapper.queryClassificationSummaries";
|
||||
private static final String LINK_TO_COUNTER = "pro.taskana.mappings.QueryMapper.countQueryClassifications";
|
||||
private static final String LINK_TO_VALUEMAPPER = "pro.taskana.mappings.QueryMapper.queryClassificationColumnValues";
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ClassificationQueryImpl.class);
|
||||
private TaskanaEngineImpl taskanaEngine;
|
||||
private String columnName;
|
||||
private String[] key;
|
||||
private String[] parentId;
|
||||
private String[] category;
|
||||
|
@ -354,7 +356,7 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
|||
List<ClassificationSummary> result = null;
|
||||
try {
|
||||
taskanaEngine.openConnection();
|
||||
result = taskanaEngine.getSqlSession().selectList(LINK_TO_MAPPER, this);
|
||||
result = taskanaEngine.getSqlSession().selectList(LINK_TO_SUMMARYMAPPER, this);
|
||||
return result;
|
||||
} finally {
|
||||
taskanaEngine.returnConnection();
|
||||
|
@ -373,7 +375,7 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
|||
try {
|
||||
taskanaEngine.openConnection();
|
||||
RowBounds rowBounds = new RowBounds(offset, limit);
|
||||
result = taskanaEngine.getSqlSession().selectList(LINK_TO_MAPPER, this, rowBounds);
|
||||
result = taskanaEngine.getSqlSession().selectList(LINK_TO_SUMMARYMAPPER, this, rowBounds);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
if (e instanceof PersistenceException) {
|
||||
|
@ -395,13 +397,34 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> listValues(String columnName, SortDirection sortDirection) {
|
||||
LOGGER.debug("Entry to listValues(dbColumnName={}) this = {}", columnName, this);
|
||||
List<String> result = null;
|
||||
try {
|
||||
taskanaEngine.openConnection();
|
||||
this.columnName = columnName;
|
||||
this.orderBy.clear();
|
||||
this.addOrderCriteria(columnName, sortDirection);
|
||||
result = taskanaEngine.getSqlSession().selectList(LINK_TO_VALUEMAPPER, this);
|
||||
return result;
|
||||
} finally {
|
||||
taskanaEngine.returnConnection();
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
int numberOfResultObjects = result == null ? 0 : result.size();
|
||||
LOGGER.debug("Exit from listValues. Returning {} resulting Objects: {} ", numberOfResultObjects,
|
||||
LoggerUtils.listToString(result));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassificationSummary single() {
|
||||
LOGGER.debug("entry to single(), this = {}", this);
|
||||
ClassificationSummary result = null;
|
||||
try {
|
||||
taskanaEngine.openConnection();
|
||||
result = taskanaEngine.getSqlSession().selectOne(LINK_TO_MAPPER, this);
|
||||
result = taskanaEngine.getSqlSession().selectOne(LINK_TO_SUMMARYMAPPER, this);
|
||||
return result;
|
||||
} finally {
|
||||
taskanaEngine.returnConnection();
|
||||
|
@ -546,6 +569,10 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
|||
return custom8Like;
|
||||
}
|
||||
|
||||
public String getColumnName() {
|
||||
return columnName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long count() {
|
||||
LOGGER.debug("entry to count(), this = {}", this);
|
||||
|
@ -630,5 +657,4 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
|||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package pro.taskana.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -20,19 +21,22 @@ import pro.taskana.impl.util.LoggerUtils;
|
|||
*/
|
||||
public class ObjectReferenceQueryImpl implements ObjectReferenceQuery {
|
||||
|
||||
private static final String LINK_TO_MAPPER = "pro.taskana.mappings.QueryMapper.queryObjectReference";
|
||||
private static final String LINK_TO_MAPPER = "pro.taskana.mappings.QueryMapper.queryObjectReferences";
|
||||
private static final String LINK_TO_COUNTER = "pro.taskana.mappings.QueryMapper.countQueryObjectReferences";
|
||||
private static final String LINK_TO_VALUEMAPPER = "pro.taskana.mappings.QueryMapper.queryObjectReferenceColumnValues";
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ObjectReferenceQueryImpl.class);
|
||||
|
||||
private TaskanaEngineImpl taskanaEngine;
|
||||
private String columnName;
|
||||
private String[] company;
|
||||
private String[] system;
|
||||
private String[] systemInstance;
|
||||
private String[] type;
|
||||
private String[] value;
|
||||
private List<String> orderBy;
|
||||
|
||||
ObjectReferenceQueryImpl(TaskanaEngine taskanaEngine) {
|
||||
this.taskanaEngine = (TaskanaEngineImpl) taskanaEngine;
|
||||
this.orderBy = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -83,6 +87,27 @@ public class ObjectReferenceQueryImpl implements ObjectReferenceQuery {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> listValues(String columnName, SortDirection sortDirection) {
|
||||
LOGGER.debug("Entry to listValues(dbColumnName={}) this = {}", columnName, this);
|
||||
List<String> result = null;
|
||||
try {
|
||||
taskanaEngine.openConnection();
|
||||
this.columnName = columnName;
|
||||
this.orderBy.clear();
|
||||
this.addOrderCriteria(columnName, sortDirection);
|
||||
result = taskanaEngine.getSqlSession().selectList(LINK_TO_VALUEMAPPER, this);
|
||||
return result;
|
||||
} finally {
|
||||
taskanaEngine.returnConnection();
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
int numberOfResultObjects = result == null ? 0 : result.size();
|
||||
LOGGER.debug("Exit from listValues. Returning {} resulting Objects: {} ", numberOfResultObjects,
|
||||
LoggerUtils.listToString(result));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ObjectReference> list(int offset, int limit) {
|
||||
LOGGER.debug("entry to list(offset = {}, limit = {}), this = {}", offset, limit, this);
|
||||
|
@ -166,6 +191,10 @@ public class ObjectReferenceQueryImpl implements ObjectReferenceQuery {
|
|||
this.value = value;
|
||||
}
|
||||
|
||||
public String getColumnName() {
|
||||
return columnName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long count() {
|
||||
LOGGER.debug("entry to count(), this = {}", this);
|
||||
|
@ -180,6 +209,15 @@ public class ObjectReferenceQueryImpl implements ObjectReferenceQuery {
|
|||
}
|
||||
}
|
||||
|
||||
private ObjectReferenceQuery addOrderCriteria(String colName, SortDirection sortDirection) {
|
||||
String orderByDirection = " ASC";
|
||||
if (sortDirection != null && SortDirection.DESCENDING.equals(sortDirection)) {
|
||||
orderByDirection = " DESC";
|
||||
}
|
||||
orderBy.add(colName + orderByDirection);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
|
|
@ -29,11 +29,13 @@ import pro.taskana.impl.util.LoggerUtils;
|
|||
*/
|
||||
public class TaskQueryImpl implements TaskQuery {
|
||||
|
||||
private static final String LINK_TO_MAPPER = "pro.taskana.mappings.QueryMapper.queryTasks";
|
||||
private static final String LINK_TO_MAPPER = "pro.taskana.mappings.QueryMapper.queryTaskSummaries";
|
||||
private static final String LINK_TO_COUNTER = "pro.taskana.mappings.QueryMapper.countQueryTasks";
|
||||
private static final String LINK_TO_VALUEMAPPER = "pro.taskana.mappings.QueryMapper.queryTaskColumnValues";
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(TaskQueryImpl.class);
|
||||
private TaskanaEngineImpl taskanaEngine;
|
||||
private TaskServiceImpl taskService;
|
||||
private String columnName;
|
||||
private String[] nameIn;
|
||||
private String[] nameLike;
|
||||
private String[] creatorIn;
|
||||
|
@ -685,6 +687,27 @@ public class TaskQueryImpl implements TaskQuery {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> listValues(String columnName, SortDirection sortDirection) {
|
||||
LOGGER.debug("Entry to listValues(dbColumnName={}) this = {}", columnName, this);
|
||||
List<String> result = null;
|
||||
try {
|
||||
taskanaEngine.openConnection();
|
||||
this.columnName = columnName;
|
||||
this.orderBy.clear();
|
||||
this.addOrderCriteria(columnName, sortDirection);
|
||||
result = taskanaEngine.getSqlSession().selectList(LINK_TO_VALUEMAPPER, this);
|
||||
return result;
|
||||
} finally {
|
||||
taskanaEngine.returnConnection();
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
int numberOfResultObjects = result == null ? 0 : result.size();
|
||||
LOGGER.debug("Exit from listValues. Returning {} resulting Objects: {} ", numberOfResultObjects,
|
||||
LoggerUtils.listToString(result));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskSummary> list(int offset, int limit) {
|
||||
LOGGER.debug("entry to list(offset = {}, limit = {}), this = {}", offset, limit, this);
|
||||
|
@ -1032,6 +1055,10 @@ public class TaskQueryImpl implements TaskQuery {
|
|||
return workbasketIdIn;
|
||||
}
|
||||
|
||||
public String getColumnName() {
|
||||
return columnName;
|
||||
}
|
||||
|
||||
private TaskQuery addOrderCriteria(String columnName, SortDirection sortDirection) {
|
||||
String orderByDirection = " ASC";
|
||||
if (sortDirection != null && SortDirection.DESCENDING.equals(sortDirection)) {
|
||||
|
|
|
@ -22,9 +22,11 @@ import pro.taskana.impl.util.LoggerUtils;
|
|||
*/
|
||||
public class WorkbasketAccessItemQueryImpl implements WorkbasketAccessItemQuery {
|
||||
|
||||
private static final String LINK_TO_MAPPER = "pro.taskana.mappings.QueryMapper.queryWorkbasketAccessItem";
|
||||
private static final String LINK_TO_MAPPER = "pro.taskana.mappings.QueryMapper.queryWorkbasketAccessItems";
|
||||
private static final String LINK_TO_COUNTER = "pro.taskana.mappings.QueryMapper.countQueryWorkbasketAccessItems";
|
||||
private static final String LINK_TO_VALUEMAPPER = "pro.taskana.mappings.QueryMapper.queryWorkbasketAccessItemColumnValues";
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(WorkbasketQueryImpl.class);
|
||||
private String columnName;
|
||||
private String[] accessIdIn;
|
||||
private String[] workbasketIdIn;
|
||||
private String[] idIn;
|
||||
|
@ -91,6 +93,27 @@ public class WorkbasketAccessItemQueryImpl implements WorkbasketAccessItemQuery
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> listValues(String columnName, SortDirection sortDirection) {
|
||||
LOGGER.debug("Entry to listValues(dbColumnName={}) this = {}", columnName, this);
|
||||
List<String> result = null;
|
||||
try {
|
||||
taskanaEngine.openConnection();
|
||||
this.columnName = columnName;
|
||||
this.orderBy.clear();
|
||||
this.addOrderCriteria(columnName, sortDirection);
|
||||
result = taskanaEngine.getSqlSession().selectList(LINK_TO_VALUEMAPPER, this);
|
||||
return result;
|
||||
} finally {
|
||||
taskanaEngine.returnConnection();
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
int numberOfResultObjects = result == null ? 0 : result.size();
|
||||
LOGGER.debug("Exit from listValues. Returning {} resulting Objects: {} ", numberOfResultObjects,
|
||||
LoggerUtils.listToString(result));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WorkbasketAccessItem> list(int offset, int limit) {
|
||||
LOGGER.debug("entry to list(offset = {}, limit = {}), this = {}", offset, limit, this);
|
||||
|
@ -173,6 +196,10 @@ public class WorkbasketAccessItemQueryImpl implements WorkbasketAccessItemQuery
|
|||
return orderBy;
|
||||
}
|
||||
|
||||
public String getColumnName() {
|
||||
return columnName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
|
|
@ -30,9 +30,11 @@ import pro.taskana.security.CurrentUserContext;
|
|||
*/
|
||||
public class WorkbasketQueryImpl implements WorkbasketQuery {
|
||||
|
||||
private static final String LINK_TO_MAPPER = "pro.taskana.mappings.QueryMapper.queryWorkbasket";
|
||||
private static final String LINK_TO_MAPPER = "pro.taskana.mappings.QueryMapper.queryWorkbasketSummaries";
|
||||
private static final String LINK_TO_COUNTER = "pro.taskana.mappings.QueryMapper.countQueryWorkbaskets";
|
||||
private static final String LINK_TO_VALUEMAPPER = "pro.taskana.mappings.QueryMapper.queryWorkbasketColumnValues";
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(WorkbasketQueryImpl.class);
|
||||
private String columnName;
|
||||
private String[] accessId;
|
||||
private WorkbasketPermission permission;
|
||||
private String[] nameIn;
|
||||
|
@ -371,6 +373,28 @@ public class WorkbasketQueryImpl implements WorkbasketQuery {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> listValues(String columnName, SortDirection sortDirection) {
|
||||
LOGGER.debug("Entry to listValues(dbColumnName={}) this = {}", columnName, this);
|
||||
List<String> result = null;
|
||||
try {
|
||||
taskanaEngine.openConnection();
|
||||
this.columnName = columnName;
|
||||
addAccessIdsOfCallerToQuery();
|
||||
this.orderBy.clear();
|
||||
this.addOrderCriteria(columnName, sortDirection);
|
||||
result = taskanaEngine.getSqlSession().selectList(LINK_TO_VALUEMAPPER, this);
|
||||
return result;
|
||||
} finally {
|
||||
taskanaEngine.returnConnection();
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
int numberOfResultObjects = result == null ? 0 : result.size();
|
||||
LOGGER.debug("Exit from listValues. Returning {} resulting Objects: {} ", numberOfResultObjects,
|
||||
LoggerUtils.listToString(result));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WorkbasketSummary> list(int offset, int limit) {
|
||||
LOGGER.debug("entry to list(offset = {}, limit = {}), this = {}", offset, limit, this);
|
||||
|
@ -544,6 +568,10 @@ public class WorkbasketQueryImpl implements WorkbasketQuery {
|
|||
return orderBy;
|
||||
}
|
||||
|
||||
public String getColumnName() {
|
||||
return columnName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long count() {
|
||||
LOGGER.debug("entry to count(), this = {}", this);
|
||||
|
|
|
@ -130,7 +130,7 @@ public interface QueryMapper {
|
|||
@Result(property = "custom8", column = "CUSTOM_8"),
|
||||
@Result(property = "custom9", column = "CUSTOM_9"),
|
||||
@Result(property = "custom10", column = "CUSTOM_10")})
|
||||
List<TaskSummaryImpl> queryTasks(TaskQueryImpl taskQuery);
|
||||
List<TaskSummaryImpl> queryTaskSummaries(TaskQueryImpl taskQuery);
|
||||
|
||||
@Select("<script>SELECT ID, KEY, PARENT_ID, CATEGORY, TYPE, DOMAIN, VALID_IN_DOMAIN, CREATED, NAME, DESCRIPTION, PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8 "
|
||||
+ "FROM CLASSIFICATION "
|
||||
|
@ -177,7 +177,7 @@ public interface QueryMapper {
|
|||
@Result(property = "domain", column = "DOMAIN"),
|
||||
@Result(property = "name", column = "NAME"),
|
||||
@Result(property = "parentId", column = "PARENT_ID")})
|
||||
List<ClassificationSummaryImpl> queryClassification(ClassificationQueryImpl classificationQuery);
|
||||
List<ClassificationSummaryImpl> queryClassificationSummaries(ClassificationQueryImpl classificationQuery);
|
||||
|
||||
@Select("<script>SELECT ID, COMPANY, SYSTEM, SYSTEM_INSTANCE, TYPE, VALUE "
|
||||
+ "FROM OBJECT_REFERENCE "
|
||||
|
@ -196,7 +196,7 @@ public interface QueryMapper {
|
|||
@Result(property = "systemInstance", column = "SYSTEM_INSTANCE"),
|
||||
@Result(property = "type", column = "TYPE"),
|
||||
@Result(property = "value", column = "VALUE")})
|
||||
List<ObjectReference> queryObjectReference(ObjectReferenceQueryImpl objectReference);
|
||||
List<ObjectReference> queryObjectReferences(ObjectReferenceQueryImpl objectReference);
|
||||
|
||||
@Select("<script>"
|
||||
+ "SELECT DISTINCT "
|
||||
|
@ -267,7 +267,7 @@ public interface QueryMapper {
|
|||
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"),
|
||||
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"),
|
||||
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")})
|
||||
List<WorkbasketSummaryImpl> queryWorkbasket(WorkbasketQueryImpl workbasketQuery);
|
||||
List<WorkbasketSummaryImpl> queryWorkbasketSummaries(WorkbasketQueryImpl workbasketQuery);
|
||||
|
||||
@Select("<script>"
|
||||
+ "SELECT "
|
||||
|
@ -302,7 +302,7 @@ public interface QueryMapper {
|
|||
@Result(property = "permCustom10", column = "PERM_CUSTOM_10"),
|
||||
@Result(property = "permCustom11", column = "PERM_CUSTOM_11"),
|
||||
@Result(property = "permCustom12", column = "PERM_CUSTOM_12")})
|
||||
List<WorkbasketAccessItemImpl> queryWorkbasketAccessItem(WorkbasketAccessItemQueryImpl accessItemQuery);
|
||||
List<WorkbasketAccessItemImpl> queryWorkbasketAccessItems(WorkbasketAccessItemQueryImpl accessItemQuery);
|
||||
|
||||
@Select("<script>SELECT COUNT(ID) FROM TASK t "
|
||||
+ "<where>"
|
||||
|
@ -485,4 +485,192 @@ public interface QueryMapper {
|
|||
+ "</script>")
|
||||
Long countQueryWorkbasketAccessItems(WorkbasketAccessItemQueryImpl accessItem);
|
||||
|
||||
@Select("<script>SELECT DISTINCT ${columnName} "
|
||||
+ "FROM TASK t "
|
||||
+ "<where>"
|
||||
+ "<if test='taskIds != null'>AND t.ID IN(<foreach item='item' collection='taskIds' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='createdIn !=null'> AND ( <foreach item='item' collection='createdIn' separator=' OR ' > ( <if test='item.begin!=null'> t.CREATED >= #{item.begin} </if> <if test='item.begin!=null and item.end!=null'> AND </if><if test='item.end!=null'> t.CREATED <=#{item.end} </if>)</foreach>)</if> "
|
||||
+ "<if test='claimedIn !=null'> AND ( <foreach item='item' collection='claimedIn' separator=' OR ' > ( <if test='item.begin!=null'> t.CLAIMED >= #{item.begin} </if> <if test='item.begin!=null and item.end!=null'> AND </if><if test='item.end!=null'> t.CLAIMED <=#{item.end} </if>)</foreach>)</if> "
|
||||
+ "<if test='completedIn !=null'> AND ( <foreach item='item' collection='completedIn' separator=' OR ' > ( <if test='item.begin!=null'> t.COMPLETED >= #{item.begin} </if> <if test='item.begin!=null and item.end!=null'> AND </if><if test='item.end!=null'> t.COMPLETED <=#{item.end} </if>)</foreach>)</if> "
|
||||
+ "<if test='modifiedIn !=null'> AND ( <foreach item='item' collection='modifiedIn' separator=' OR ' > ( <if test='item.begin!=null'> t.MODIFIED >= #{item.begin} </if> <if test='item.begin!=null and item.end!=null'> AND </if><if test='item.end!=null'> t.MODIFIED <=#{item.end} </if>)</foreach>)</if> "
|
||||
+ "<if test='plannedIn !=null'> AND ( <foreach item='item' collection='plannedIn' separator=' OR ' > ( <if test='item.begin!=null'> t.PLANNED >= #{item.begin} </if> <if test='item.begin!=null and item.end!=null'> AND </if><if test='item.end!=null'> t.PLANNED <=#{item.end} </if>)</foreach>)</if> "
|
||||
+ "<if test='dueIn !=null'> AND ( <foreach item='item' collection='dueIn' separator=' OR ' > ( <if test='item.begin!=null'> t.DUE >= #{item.begin} </if> <if test='item.begin!=null and item.end!=null'> AND </if><if test='item.end!=null'> t.DUE <=#{item.end} </if>)</foreach>)</if> "
|
||||
+ "<if test='nameIn != null'>AND t.NAME IN(<foreach item='item' collection='nameIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='nameLike != null'>AND (<foreach item='item' collection='nameLike' separator=' OR '>UPPER(t.NAME) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='creatorIn != null'>AND t.CREATOR IN(<foreach item='item' collection='creatorIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='creatorLike != null'>AND (<foreach item='item' collection='creatorLike' separator=' OR '>UPPER(t.CREATOR) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='description != null'>AND (<foreach item='item' collection='description' separator=' OR '>t.DESCRIPTION LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='note != null'>AND (<foreach item='item' collection='note' separator=' OR '>t.NOTE LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='priority != null'>AND t.PRIORITY IN(<foreach item='item' collection='priority' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='stateIn != null'>AND t.STATE IN(<foreach item='item' collection='stateIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='workbasketIdIn != null'>AND t.WORKBASKET_ID IN(<foreach item='item' collection='workbasketIdIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='workbasketKeyDomainIn != null'>AND (<foreach item='item' collection='workbasketKeyDomainIn' separator=' OR '>(t.WORKBASKET_KEY = #{item.key} AND t.DOMAIN = #{item.domain})</foreach>)</if> "
|
||||
+ "<if test='classificationKeyIn != null'>AND t.CLASSIFICATION_KEY IN(<foreach item='item' collection='classificationKeyIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='classificationKeyLike != null'>AND (<foreach item='item' collection='classificationKeyLike' separator=' OR '>UPPER(t.CLASSIFICATION_KEY) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='classificationCategoryIn != null'>AND t.CLASSIFICATION_CATEGORY IN(<foreach item='item' collection='classificationCategoryIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='classificationCategoryLike != null'>AND (<foreach item='item' collection='classificationCategoryLike' separator=' OR '>UPPER(t.CLASSIFICATION_CATEGORY) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='ownerIn != null'>AND t.OWNER IN(<foreach item='item' collection='ownerIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='ownerLike != null'>AND (<foreach item='item' collection='ownerLike' separator=' OR '>UPPER(t.OWNER) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='isRead != null'>AND t.IS_READ = #{isRead}</if> "
|
||||
+ "<if test='isTransferred != null'>AND t.IS_TRANSFERRED = #{isTransferred}</if> "
|
||||
+ "<if test='porCompanyIn != null'>AND t.POR_COMPANY IN(<foreach item='item' collection='porCompanyIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='porCompanyLike != null'>AND (<foreach item='item' collection='porCompanyLike' separator=' OR '>UPPER(t.POR_COMPANY) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='porSystemIn != null'>AND t.POR_SYSTEM IN(<foreach item='item' collection='porSystemIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='porSystemLike != null'>AND (<foreach item='item' collection='porSystemLike' separator=' OR '>UPPER(t.POR_SYSTEM) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='porSystemInstanceIn != null'>AND t.POR_INSTANCE IN(<foreach item='item' collection='porSystemInstanceIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='porSystemInstanceLike != null'>AND (<foreach item='item' collection='porSystemInstanceLike' separator=' OR '>UPPER(t.POR_INSTANCE) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='porTypeIn != null'>AND t.POR_TYPE IN(<foreach item='item' collection='porTypeIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='porTypeLike != null'>AND (<foreach item='item' collection='porTypeLike' separator=' OR '>UPPER(t.POR_TYPE) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='porValueIn != null'>AND t.POR_VALUE IN(<foreach item='item' collection='porValueIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='porValueLike != null'>AND (<foreach item='item' collection='porValueLike' separator=' OR '>UPPER(t.POR_VALUE) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='parentBusinessProcessIdIn != null'>AND t.PARENT_BUSINESS_PROCESS_ID IN(<foreach item='item' collection='parentBusinessProcessIdIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='parentBusinessProcessIdLike != null'>AND (<foreach item='item' collection='parentBusinessProcessIdLike' separator=' OR '>UPPER(t.PARENT_BUSINESS_PROCESS_ID) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='businessProcessIdIn != null'>AND t.BUSINESS_PROCESS_ID IN(<foreach item='item' collection='businessProcessIdIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='businessProcessIdLike != null'>AND (<foreach item='item' collection='businessProcessIdLike' separator=' OR '>UPPER(t.BUSINESS_PROCESS_ID) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom1In != null'>AND t.CUSTOM_1 IN(<foreach item='item' collection='custom1In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='custom1Like != null'>AND (<foreach item='item' collection='custom1Like' separator=' OR '>UPPER(t.CUSTOM_1) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom2In != null'>AND t.CUSTOM_2 IN(<foreach item='item' collection='custom2In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='custom2Like != null'>AND (<foreach item='item' collection='custom2Like' separator=' OR '>UPPER(t.CUSTOM_2) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom3In != null'>AND t.CUSTOM_3 IN(<foreach item='item' collection='custom3In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='custom3Like != null'>AND (<foreach item='item' collection='custom3Like' separator=' OR '>UPPER(t.CUSTOM_3) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom4In != null'>AND t.CUSTOM_4 IN(<foreach item='item' collection='custom4In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='custom4Like != null'>AND (<foreach item='item' collection='custom4Like' separator=' OR '>UPPER(t.CUSTOM_4) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom5In != null'>AND t.CUSTOM_5 IN(<foreach item='item' collection='custom5In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='custom5Like != null'>AND (<foreach item='item' collection='custom5Like' separator=' OR '>UPPER(t.CUSTOM_5) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom6In != null'>AND t.CUSTOM_6 IN(<foreach item='item' collection='custom6In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='custom6Like != null'>AND (<foreach item='item' collection='custom6Like' separator=' OR '>UPPER(t.CUSTOM_6) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom7In != null'>AND t.CUSTOM_7 IN(<foreach item='item' collection='custom7In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='custom7Like != null'>AND (<foreach item='item' collection='custom7Like' separator=' OR '>UPPER(t.CUSTOM_7) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom8In != null'>AND t.CUSTOM_8 IN(<foreach item='item' collection='custom8In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='custom8Like != null'>AND (<foreach item='item' collection='custom8Like' separator=' OR '>UPPER(t.CUSTOM_8) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom9In != null'>AND t.CUSTOM_9 IN(<foreach item='item' collection='custom9In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='custom9Like != null'>AND (<foreach item='item' collection='custom9Like' separator=' OR '>UPPER(t.CUSTOM_9) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom10In != null'>AND t.CUSTOM_10 IN(<foreach item='item' collection='custom10In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='custom10Like != null'>AND (<foreach item='item' collection='custom10Like' separator=' OR '>UPPER(t.CUSTOM_10) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='customFields != null'>AND (t.CUSTOM_1 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_2 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_3 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_4 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_5 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_6 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_7 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_8 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_9 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_10 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>))</if> "
|
||||
+ "</where>"
|
||||
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> "
|
||||
+ "</script>")
|
||||
List<String> queryTaskColumnValues(TaskQueryImpl taskQuery);
|
||||
|
||||
@Select("<script>SELECT DISTINCT ${columnName} "
|
||||
+ "FROM CLASSIFICATION"
|
||||
+ "<where>"
|
||||
+ "<if test='key != null'>AND KEY IN(<foreach item='item' collection='key' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='parentId != null'>AND PARENT_ID IN(<foreach item='item' collection='parentId' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='category != null'>AND CATEGORY IN(<foreach item='item' collection='category' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='type != null'>AND TYPE IN(<foreach item='item' collection='type' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='domain != null'>AND DOMAIN IN(<foreach item='item' collection='domain' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='validInDomain != null'>AND VALID_IN_DOMAIN = #{validInDomain}</if> "
|
||||
+ "<if test='createdIn !=null'> AND ( <foreach item='item' collection='createdIn' separator=' OR ' > ( <if test='item.begin!=null'> CREATED >= #{item.begin} </if> <if test='item.begin!=null and item.end!=null'> AND </if><if test='item.end!=null'> CREATED <=#{item.end} </if>)</foreach>)</if> "
|
||||
+ "<if test='modifiedIn !=null'> AND ( <foreach item='item' collection='modifiedIn' separator=' OR ' > ( <if test='item.begin!=null'> MODIFIED >= #{item.begin} </if> <if test='item.begin!=null and item.end!=null'> AND </if><if test='item.end!=null'> MODIFIED <=#{item.end} </if>)</foreach>)</if> "
|
||||
+ "<if test='nameIn != null'>AND NAME IN(<foreach item='item' collection='nameIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='nameLike != null'>AND (<foreach item='item' collection='nameLike' separator=' OR '>NAME LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='descriptionLike != null'>AND DESCRIPTION like #{descriptionLike}</if> "
|
||||
+ "<if test='priority != null'>AND PRIORITY IN(<foreach item='item' collection='priority' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='serviceLevelIn != null'>AND SERVICE_LEVEL IN(<foreach item='item' collection='serviceLevelIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='serviceLevelLike != null'>AND (<foreach item='item' collection='serviceLevelLike' separator=' OR ' >SERVICE_LEVEL LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='applicationEntryPointIn != null'>AND APPLICATION_ENTRY_POINT IN(<foreach item='item' collection='applicationEntryPoint' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='applicationEntryPointLike != null'>AND (<foreach item='item' collection='applicationEntryPointLike' separator=' OR ' >APPLICATION_ENTRY_POINT LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom1In != null'>AND CUSTOM_1 IN(<foreach item='item' collection='custom1In' separator=',' >#{item}</foreach>) </if> "
|
||||
+ "<if test='custom1Like != null'>AND (<foreach item='item' collection='custom1Like' separator=' OR ' >CUSTOM_1 LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom2In != null'>AND CUSTOM_2 IN(<foreach item='item' collection='custom2In' separator=',' >#{item}</foreach>) </if> "
|
||||
+ "<if test='custom2Like != null'>AND (<foreach item='item' collection='custom2Like' separator=' OR ' > CUSTOM_2 LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom3In != null'>AND CUSTOM_3 IN(<foreach item='item' collection='custom3In' separator=',' >#{item}</foreach>) </if> "
|
||||
+ "<if test='custom3Like != null'>AND (<foreach item='item' collection='custom3Like' separator=' OR ' > CUSTOM_3 LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom4In != null'>AND CUSTOM_4 IN(<foreach item='item' collection='custom4In' separator=',' >#{item}</foreach>) </if> "
|
||||
+ "<if test='custom4Like != null'>AND (<foreach item='item' collection='custom4Like' separator=' OR ' > CUSTOM_4 LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom5In != null'>AND CUSTOM_5 IN(<foreach item='item' collection='custom5In' separator=',' >#{item}</foreach>) </if> "
|
||||
+ "<if test='custom5Like != null'>AND (<foreach item='item' collection='custom5Like' separator=' OR ' > CUSTOM_5 LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom6In != null'>AND CUSTOM_6 IN(<foreach item='item' collection='custom6In' separator=',' >#{item}</foreach>) </if> "
|
||||
+ "<if test='custom6Like != null'>AND (<foreach item='item' collection='custom6Like' separator=' OR ' > CUSTOM_6 LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom7In != null'>AND CUSTOM_7 IN(<foreach item='item' collection='custom7In' separator=',' >#{item}</foreach>) </if> "
|
||||
+ "<if test='custom7Like != null'>AND (<foreach item='item' collection='custom7Like' separator=' OR ' > CUSTOM_7 LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom8In != null'>AND CUSTOM_8 IN(<foreach item='item' collection='custom8In' separator=',' >#{item}</foreach>) </if> "
|
||||
+ "<if test='custom8Like != null'>AND (<foreach item='item' collection='custom8Like' separator=' OR ' > CUSTOM_8 LIKE #{item}</foreach>)</if> "
|
||||
+ "</where>"
|
||||
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> "
|
||||
+ "</script>")
|
||||
List<String> queryClassificationColumnValues(ClassificationQueryImpl classificationQuery);
|
||||
|
||||
@Select("<script>SELECT DISTINCT ${columnName} "
|
||||
+ "FROM OBJECT_REFERENCE "
|
||||
+ "<where>"
|
||||
+ "<if test='company != null'>AND COMPANY IN(<foreach item='item' collection='company' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='system != null'>AND SYSTEM IN(<foreach item='item' collection='system' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='systemInstance != null'>AND SYSTEM_INSTANCE IN(<foreach item='item' collection='systemInstance' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='type != null'>AND TYPE IN(<foreach item='item' collection='type' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='value != null'>AND VALUE IN(<foreach item='item' collection='value' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "</where>"
|
||||
+ "</script>")
|
||||
List<String> queryObjectReferenceColumnValues(ObjectReferenceQueryImpl objectReference);
|
||||
|
||||
@Select("<script>SELECT DISTINCT ${columnName} "
|
||||
+ "FROM WORKBASKET w "
|
||||
+ "LEFT OUTER JOIN WORKBASKET_ACCESS_LIST a on (w.ID = a.WORKBASKET_ID AND a.ACCESS_ID IN (<if test='accessId != null'><foreach item='item' collection='accessId' separator=',' >#{item}</foreach></if>))"
|
||||
+ "<where>"
|
||||
+ "<if test='ownerIn != null'>AND w.OWNER IN(<foreach item='item' collection='ownerIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='ownerLike != null'>AND (<foreach item='item' collection='ownerLike' separator=' OR ' >UPPER(w.OWNER) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='keyIn != null'>AND UPPER(w.KEY) IN(<foreach item='item' collection='keyIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='keyLike != null'>AND (<foreach item='item' collection='keyLike' separator=' OR ' >UPPER(w.KEY) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='nameIn != null'>AND UPPER(w.NAME) IN(<foreach item='item' collection='nameIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='nameLike != null'>AND (<foreach item='item' collection='nameLike' separator=' OR ' >UPPER(w.NAME) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='keyOrNameLike != null'>AND (<foreach item='item' collection='keyOrNameLike' separator=' OR ' >UPPER(w.NAME) LIKE #{item} OR UPPER(w.KEY) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='domainIn != null'>AND w.DOMAIN IN(<foreach item='item' collection='domainIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='domainLike != null'>AND (<foreach item='item' collection='domainLike' separator=' OR ' >UPPER(w.DOMAIN) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='type!= null'>AND w.TYPE IN(<foreach item='item' collection='type' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='createdIn !=null'> AND ( <foreach item='item' collection='createdIn' separator=' OR ' > ( <if test='item.begin!=null'> w.CREATED >= #{item.begin} </if> <if test='item.begin!=null and item.end!=null'> AND </if><if test='item.end!=null'> w.CREATED <=#{item.end} </if>)</foreach>)</if> "
|
||||
+ "<if test='modifiedIn !=null'> AND ( <foreach item='item' collection='modifiedIn' separator=' OR ' > ( <if test='item.begin!=null'> w.MODIFIED >= #{item.begin} </if> <if test='item.begin!=null and item.end!=null'> AND </if><if test='item.end!=null'> w.MODIFIED <=#{item.end} </if>)</foreach>)</if> "
|
||||
+ "<if test='descriptionLike != null'>AND (<foreach item='item' collection='descriptionLike' separator=' OR '>UPPER(w.DESCRIPTION) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom1In != null'>AND UPPER(w.CUSTOM_1) IN(<foreach item='item' collection='custom1In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='custom1Like != null'>AND (<foreach item='item' collection='custom1Like' separator=' OR ' >UPPER(w.CUSTOM_1) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom2In != null'>AND UPPER(w.CUSTOM_2) IN(<foreach item='item' collection='custom2In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='custom2Like != null'>AND (<foreach item='item' collection='custom2Like' separator=' OR ' >UPPER(w.CUSTOM_2) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom3In != null'>AND UPPER(w.CUSTOM_3) IN(<foreach item='item' collection='custom3In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='custom3Like != null'>AND (<foreach item='item' collection='custom3Like' separator=' OR ' >UPPER(w.CUSTOM_3) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='custom4In != null'>AND UPPER(w.CUSTOM_4) IN(<foreach item='item' collection='custom4In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='custom4Like != null'>AND (<foreach item='item' collection='custom4Like' separator=' OR ' >UPPER(w.CUSTOM_4) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='orgLevel1In != null'>AND UPPER(w.ORG_LEVEL_1) IN(<foreach item='item' collection='orgLevel1In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='orgLevel1Like != null'>AND (<foreach item='item' collection='orgLevel1Like' separator=' OR ' >UPPER(w.ORG_LEVEL_1) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='orgLevel2In != null'>AND UPPER(w.ORG_LEVEL_2) IN(<foreach item='item' collection='orgLevel2In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='orgLevel2Like != null'>AND (<foreach item='item' collection='orgLevel2Like' separator=' OR ' >UPPER(w.ORG_LEVEL_2) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='orgLevel3In != null'>AND UPPER(w.ORG_LEVEL_3) IN(<foreach item='item' collection='orgLevel3In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='orgLevel3Like != null'>AND (<foreach item='item' collection='orgLevel3Like' separator=' OR ' >UPPER(w.ORG_LEVEL_3) LIKE #{item}</foreach>)</if> "
|
||||
+ "<if test='orgLevel4In != null'>AND UPPER(w.ORG_LEVEL_4) IN(<foreach item='item' collection='orgLevel4In' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='orgLevel4Like != null'>AND (<foreach item='item' collection='orgLevel4Like' separator=' OR ' >UPPER(w.ORG_LEVEL_4) LIKE #{item}</foreach>)</if> "
|
||||
+ "AND (PERM_READ = 1 "
|
||||
+ "<if test='permission != null'>OR "
|
||||
+ "<if test=\"permission.name().equals('READ')\">PERM_READ</if> "
|
||||
+ "<if test=\"permission.name().equals('OPEN')\">PERM_OPEN</if> "
|
||||
+ "<if test=\"permission.name().equals('APPEND')\">PERM_APPEND</if>"
|
||||
+ "<if test=\"permission.name().equals('TRANSFER')\">PERM_TRANSFER</if>"
|
||||
+ "<if test=\"permission.name().equals('DISTRIBUTE')\">PERM_DISTRIBUTE</if>"
|
||||
+ "<if test=\"permission.name().equals('CUSTOM_1')\">PERM_CUSTOM_1</if>"
|
||||
+ "<if test=\"permission.name().equals('CUSTOM_2')\">PERM_CUSTOM_2</if>"
|
||||
+ "<if test=\"permission.name().equals('CUSTOM_3')\">PERM_CUSTOM_3</if>"
|
||||
+ "<if test=\"permission.name().equals('CUSTOM_4')\">PERM_CUSTOM_4</if>"
|
||||
+ "<if test=\"permission.name().equals('CUSTOM_5')\">PERM_CUSTOM_5</if>"
|
||||
+ "<if test=\"permission.name().equals('CUSTOM_6')\">PERM_CUSTOM_6</if>"
|
||||
+ "<if test=\"permission.name().equals('CUSTOM_7')\">PERM_CUSTOM_7</if>"
|
||||
+ "<if test=\"permission.name().equals('CUSTOM_8')\">PERM_CUSTOM_8</if>"
|
||||
+ "<if test=\"permission.name().equals('CUSTOM_9')\">PERM_CUSTOM_9</if>"
|
||||
+ "<if test=\"permission.name().equals('CUSTOM_10')\">PERM_CUSTOM_10</if>"
|
||||
+ "<if test=\"permission.name().equals('CUSTOM_11')\">PERM_CUSTOM_11</if>"
|
||||
+ "<if test=\"permission.name().equals('CUSTOM_12')\">PERM_CUSTOM_12</if> = 1 "
|
||||
+ "</if>)"
|
||||
+ "</where>"
|
||||
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='orderItem' collection='orderBy' separator=',' >${orderItem}</foreach></if> "
|
||||
+ "</script>")
|
||||
List<String> queryWorkbasketColumnValues(WorkbasketQueryImpl workbasketQuery);
|
||||
|
||||
@Select("<script>SELECT DISTINCT ${columnName} "
|
||||
+ "FROM WORKBASKET_ACCESS_LIST "
|
||||
+ "<where>"
|
||||
+ "<if test='idIn != null'>AND ID IN(<foreach item='item' collection='idIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='workbasketIdIn != null'>AND WORKBASKET_ID IN(<foreach item='item' collection='workbasketIdIn' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='accessIdIn != null'>AND ACCESS_ID IN(<foreach item='item' collection='accessIdIn' separator=',' >#{item}</foreach>) </if> "
|
||||
+ "</where>"
|
||||
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='orderItem' collection='orderBy' separator=',' >${orderItem}</foreach></if> "
|
||||
+ "</script>")
|
||||
List<String> queryWorkbasketAccessItemColumnValues(WorkbasketAccessItemQueryImpl accessItemQuery);
|
||||
}
|
||||
|
|
|
@ -27,6 +27,39 @@ public class QueryClassificationAccTest extends AbstractAccTest {
|
|||
super();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQueryClassificationValuesForColumnName()
|
||||
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
|
||||
ClassificationService classificationService = taskanaEngine.getClassificationService();
|
||||
List<String> columnValueList = classificationService.createClassificationQuery()
|
||||
.listValues("NAME", null);
|
||||
assertNotNull(columnValueList);
|
||||
assertEquals(15, columnValueList.size());
|
||||
|
||||
columnValueList = classificationService.createClassificationQuery()
|
||||
.listValues("TYPE", null);
|
||||
assertNotNull(columnValueList);
|
||||
assertEquals(3, columnValueList.size());
|
||||
|
||||
columnValueList = classificationService.createClassificationQuery()
|
||||
.domainIn("")
|
||||
.listValues("TYPE", null);
|
||||
assertNotNull(columnValueList);
|
||||
assertEquals(2, columnValueList.size());
|
||||
|
||||
columnValueList = classificationService.createClassificationQuery()
|
||||
.domainIn("")
|
||||
.listValues("CREATED", null);
|
||||
assertNotNull(columnValueList);
|
||||
|
||||
columnValueList = classificationService.createClassificationQuery()
|
||||
.domainIn("")
|
||||
.validInDomainEquals(false)
|
||||
.listValues("VALID_IN_DOMAIN", null);
|
||||
assertNotNull(columnValueList);
|
||||
assertEquals(1, columnValueList.size()); // all are false in ""
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFindClassificationsByCategoryAndDomain()
|
||||
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
|
||||
|
|
|
@ -26,6 +26,23 @@ public class QueryObjectReferenceAccTest extends AbstractAccTest {
|
|||
super();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQueryObjectReferenceValuesForColumnName() {
|
||||
TaskQuery taskQuery = taskanaEngine.getTaskService().createTaskQuery();
|
||||
List<String> columnValues = taskQuery.createObjectReferenceQuery()
|
||||
.listValues("COMPANY", null);
|
||||
assertEquals(3, columnValues.size());
|
||||
|
||||
columnValues = taskQuery.createObjectReferenceQuery()
|
||||
.listValues("SYSTEM", null);
|
||||
assertEquals(3, columnValues.size());
|
||||
|
||||
columnValues = taskQuery.createObjectReferenceQuery()
|
||||
.systemIn("System1")
|
||||
.listValues("SYSTEM", null);
|
||||
assertEquals(1, columnValues.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFindObjectReferenceByCompany()
|
||||
throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package acceptance.task;
|
||||
|
||||
import static org.hamcrest.core.IsEqual.equalTo;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
@ -52,6 +53,22 @@ public class QueryTasksAccTest extends AbstractAccTest {
|
|||
super();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQueryTaskValuesForColumnName() {
|
||||
TaskService taskService = taskanaEngine.getTaskService();
|
||||
List<String> columnValueList = taskService.createTaskQuery()
|
||||
.ownerLike("%user%")
|
||||
.orderByOwner(desc)
|
||||
.listValues("OWNER", null);
|
||||
assertNotNull(columnValueList);
|
||||
assertEquals(3, columnValueList.size());
|
||||
|
||||
columnValueList = taskService.createTaskQuery()
|
||||
.listValues("STATE", null);
|
||||
assertNotNull(columnValueList);
|
||||
assertEquals(3, columnValueList.size());
|
||||
}
|
||||
|
||||
@WithAccessId(
|
||||
userName = "teamlead_1",
|
||||
groupNames = {"group_1", "group_2"})
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package acceptance.workbasket;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -33,6 +36,25 @@ public class QueryWorkbasketAccTest extends AbstractAccTest {
|
|||
super();
|
||||
}
|
||||
|
||||
@WithAccessId(
|
||||
userName = "teamlead_1",
|
||||
groupNames = {"group_1"})
|
||||
@Test
|
||||
public void testQueryWorkbasketValuesForColumnName() throws NotAuthorizedException {
|
||||
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
|
||||
List<String> columnValueList = workbasketService.createWorkbasketQuery()
|
||||
.listValues("NAME", null);
|
||||
assertNotNull(columnValueList);
|
||||
assertEquals(9, columnValueList.size());
|
||||
|
||||
columnValueList = workbasketService.createWorkbasketQuery()
|
||||
.nameLike("%korb%")
|
||||
.orderByName(asc)
|
||||
.listValues("NAME", SortDirection.DESCENDING); // will override
|
||||
assertNotNull(columnValueList);
|
||||
assertEquals(3, columnValueList.size());
|
||||
}
|
||||
|
||||
@WithAccessId(
|
||||
userName = "teamlead_1",
|
||||
groupNames = {"group_1"})
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package acceptance.workbasket;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
@ -34,6 +37,26 @@ public class QueryWorkbasketAccessItemsAccTest extends AbstractAccTest {
|
|||
super();
|
||||
}
|
||||
|
||||
@WithAccessId(
|
||||
userName = "dummy",
|
||||
groupNames = {"businessadmin"})
|
||||
@Test
|
||||
public void testQueryWorkbasketAccessItemValuesForColumnName() throws NotAuthorizedException {
|
||||
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
|
||||
List<String> columnValueList = workbasketService.createWorkbasketAccessItemQuery()
|
||||
.listValues("WORKBASKET_ID", null);
|
||||
assertNotNull(columnValueList);
|
||||
assertEquals(23, columnValueList.size());
|
||||
|
||||
columnValueList = workbasketService.createWorkbasketAccessItemQuery()
|
||||
.listValues("ACCESS_ID", null);
|
||||
assertNotNull(columnValueList);
|
||||
assertEquals(9, columnValueList.size());
|
||||
|
||||
long countEntries = workbasketService.createWorkbasketAccessItemQuery().count();
|
||||
assertTrue(columnValueList.size() < countEntries); // DISTINCT
|
||||
}
|
||||
|
||||
@WithAccessId(
|
||||
userName = "dummy",
|
||||
groupNames = {"businessadmin"})
|
||||
|
@ -53,10 +76,10 @@ public class QueryWorkbasketAccessItemsAccTest extends AbstractAccTest {
|
|||
public void testQueryAccessItemsForAccessIdsNotAuthorized()
|
||||
throws SQLException, NotAuthorizedException, InvalidArgumentException {
|
||||
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
|
||||
List<WorkbasketAccessItem> results = workbasketService.createWorkbasketAccessItemQuery()
|
||||
workbasketService.createWorkbasketAccessItemQuery()
|
||||
.accessIdIn("user_1_1", "group_1")
|
||||
.list();
|
||||
fail("NotAuthorizedException was expected");
|
||||
fail("NotAuthorizedException was expected.");
|
||||
}
|
||||
|
||||
@WithAccessId(
|
||||
|
|
|
@ -282,4 +282,9 @@ public class TestClassificationQuery implements ClassificationQuery {
|
|||
public ClassificationQuery modifiedWithin(TimeInterval... modifiedIn) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> listValues(String dbColumnName, SortDirection sortDirection) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue