diff --git a/core/core-backend/src/main/java/io/dataease/datasource/dao/ext/mapper/ExtDatasourceTaskMapper.java b/core/core-backend/src/main/java/io/dataease/datasource/dao/ext/mapper/ExtDatasourceTaskMapper.java index a003b145f1..17deed40f3 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/dao/ext/mapper/ExtDatasourceTaskMapper.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/dao/ext/mapper/ExtDatasourceTaskMapper.java @@ -2,7 +2,6 @@ package io.dataease.datasource.dao.ext.mapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.dataease.datasource.dto.CoreDatasourceTaskDTO; -import io.dataease.request.GridExample; import org.apache.ibatis.annotations.*; import java.util.List; @@ -20,7 +19,7 @@ public interface ExtDatasourceTaskMapper { SELECT QRTZ_TRIGGERS.* FROM QRTZ_TRIGGERS ${ew.customSqlSegment} - """ + """ ) @Results( id = "taskWithTriggers", diff --git a/sdk/common/src/main/java/io/dataease/request/BaseGridRequest.java b/sdk/common/src/main/java/io/dataease/request/BaseGridRequest.java deleted file mode 100644 index 50c4899067..0000000000 --- a/sdk/common/src/main/java/io/dataease/request/BaseGridRequest.java +++ /dev/null @@ -1,82 +0,0 @@ -package io.dataease.request; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import org.apache.commons.lang3.StringUtils; -import org.springframework.util.CollectionUtils; -import org.springframework.util.ObjectUtils; - -import java.io.Serializable; -import java.util.List; - -public class BaseGridRequest implements Serializable { - - private String keyword; - - private List conditions; - - private List orders; - - public String getKeyword() { - return keyword; - } - - public void setKeyword(String keyword) { - this.keyword = keyword; - } - - public List getConditions() { - return conditions; - } - - public void setConditions(List conditions) { - this.conditions = conditions; - } - - public List getOrders() { - return orders; - } - - public void setOrders(List orders) { - this.orders = orders; - } - - public QueryWrapper convertQueryWrapper(QueryWrapper queryWrapper) { - if (ObjectUtils.isEmpty(queryWrapper)) { - queryWrapper = new QueryWrapper(); - } - for (int i = 0; i < conditions.size(); i++) { - ConditionEntity condition = conditions.get(i); - String operator = condition.getOperator(); - Object value = condition.getValue(); - if (StringUtils.equalsIgnoreCase("eq", operator)) { - queryWrapper.eq(condition.getField(), value); - } - if (StringUtils.equalsIgnoreCase("in", operator)) { - List list = (List) value; - queryWrapper.in(condition.getField(), list); - } - if (StringUtils.equalsIgnoreCase("between", operator)) { - List list = (List) value; - queryWrapper.between(condition.getField(), list.get(0), list.get(1)); - } - } - return queryWrapper; - } - - public GridExample convertExample() { - GridExample gridExample = new GridExample(); - if (!CollectionUtils.isEmpty(conditions)) { - GridExample.Criteria criteria = gridExample.createCriteria(); - conditions.forEach(criteria::addCondition); - } - - if (!CollectionUtils.isEmpty(orders)) { - String orderByClause = String.join(", ", orders); - gridExample.setOrderByClause(orderByClause); - } - - return gridExample; - } - - -} diff --git a/sdk/common/src/main/java/io/dataease/request/ConditionEntity.java b/sdk/common/src/main/java/io/dataease/request/ConditionEntity.java deleted file mode 100644 index 7733602e45..0000000000 --- a/sdk/common/src/main/java/io/dataease/request/ConditionEntity.java +++ /dev/null @@ -1,15 +0,0 @@ -package io.dataease.request; - -import lombok.Data; - -import java.io.Serializable; - -@Data -public class ConditionEntity implements Serializable { - - private String field; - - private String operator; - - private Object value; -} diff --git a/sdk/common/src/main/java/io/dataease/request/GridExample.java b/sdk/common/src/main/java/io/dataease/request/GridExample.java deleted file mode 100644 index 8da4c25faa..0000000000 --- a/sdk/common/src/main/java/io/dataease/request/GridExample.java +++ /dev/null @@ -1,302 +0,0 @@ -package io.dataease.request; - -import org.apache.commons.lang3.StringUtils; - -import java.util.ArrayList; -import java.util.List; - -public class GridExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - protected String extendCondition; - - public GridExample() { - oredCriteria = new ArrayList(); - } - - public String getExtendCondition() { - return extendCondition; - } - - public void setExtendCondition(String extendCondition) { - this.extendCondition = extendCondition; - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addNotNullCriterion(String condition) { - criteria.add(new Criterion(condition, null)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addSqlCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - Criterion criterion = new Criterion(condition, value); - criterion.sqlValue = true; - criteria.add(criterion); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - - - public Criteria addCondition(ConditionEntity conditionEntity){ - String field = conditionEntity.getField(); - Object value = conditionEntity.getValue(); - String operator = conditionEntity.getOperator(); - if (StringUtils.isEmpty(operator)) - operator = "like"; - switch (operator){ - case "eq": - addCriterion(field+" = ", value, field); - break; - case "ne": - addCriterion(field+" <> ", value, field); - break; - case "like": - addCriterion(field+" like ", "%"+value+"%", field); - break; - case "not like": - addCriterion(field+" not like ", "%"+value+"%", field); - break; - case "in": - List invalues = (List)value; - addCriterion(field+" in", invalues, field); - break; - case "not in": - List notinvalues = (List)value; - addCriterion(field+" not in", notinvalues, field); - break; - case "between": - List values = (List)value; - Object v1 = values.get(0); - Object v2 = values.get(1); - addCriterion(field+" between", v1, v2, field); - break; - case "gt": - addCriterion(field+" > ", value, field); - break; - case "ge": - addCriterion(field+" >= ", value, field); - break; - case "lt": - addCriterion(field+" < ", value, field); - break; - case "le": - addCriterion(field+" <= ", value, field); - break; - case "not null": - addNotNullCriterion(field + " is not null "); - break; - case "extra": - addCriterion(field); - break; - case "sql in": - addCriterion(field+" in ", value, field); - break; - } - return (Criteria) this; - } - - - - - - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - public boolean isSqlValue() { - return sqlValue; - } - - public void setSqlValue(boolean sqlValue) { - this.sqlValue = sqlValue; - } - - private boolean sqlValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if(value == null){ - this.noValue = true; - }else if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} diff --git a/sdk/common/src/main/java/io/dataease/request/GridSql.java b/sdk/common/src/main/java/io/dataease/request/GridSql.java deleted file mode 100644 index 9f2b6876c6..0000000000 --- a/sdk/common/src/main/java/io/dataease/request/GridSql.java +++ /dev/null @@ -1,4 +0,0 @@ -package io.dataease.request; - -public interface GridSql { -} diff --git a/sdk/common/src/main/java/io/dataease/request/GridSql.xml b/sdk/common/src/main/java/io/dataease/request/GridSql.xml deleted file mode 100644 index 60a23e42d6..0000000000 --- a/sdk/common/src/main/java/io/dataease/request/GridSql.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - -