forked from github/dataease
commit
2228f30fb4
21
backend/src/main/java/io/dataease/base/domain/UserKey.java
Normal file
21
backend/src/main/java/io/dataease/base/domain/UserKey.java
Normal file
@ -0,0 +1,21 @@
|
||||
package io.dataease.base.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UserKey implements Serializable {
|
||||
private Long id;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private String accessKey;
|
||||
|
||||
private String secretKey;
|
||||
|
||||
private Long createTime;
|
||||
|
||||
private String status;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,590 @@
|
||||
package io.dataease.base.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class UserKeyExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public UserKeyExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
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<Criteria> 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<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> 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 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 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 andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Long value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Long value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Long value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Long value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Long> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Long> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIsNull() {
|
||||
addCriterion("user_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIsNotNull() {
|
||||
addCriterion("user_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdEqualTo(Long value) {
|
||||
addCriterion("user_id =", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotEqualTo(Long value) {
|
||||
addCriterion("user_id <>", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdGreaterThan(Long value) {
|
||||
addCriterion("user_id >", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("user_id >=", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLessThan(Long value) {
|
||||
addCriterion("user_id <", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("user_id <=", value, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdIn(List<Long> values) {
|
||||
addCriterion("user_id in", values, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotIn(List<Long> values) {
|
||||
addCriterion("user_id not in", values, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdBetween(Long value1, Long value2) {
|
||||
addCriterion("user_id between", value1, value2, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("user_id not between", value1, value2, "userId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccessKeyIsNull() {
|
||||
addCriterion("access_key is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccessKeyIsNotNull() {
|
||||
addCriterion("access_key is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccessKeyEqualTo(String value) {
|
||||
addCriterion("access_key =", value, "accessKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccessKeyNotEqualTo(String value) {
|
||||
addCriterion("access_key <>", value, "accessKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccessKeyGreaterThan(String value) {
|
||||
addCriterion("access_key >", value, "accessKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccessKeyGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("access_key >=", value, "accessKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccessKeyLessThan(String value) {
|
||||
addCriterion("access_key <", value, "accessKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccessKeyLessThanOrEqualTo(String value) {
|
||||
addCriterion("access_key <=", value, "accessKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccessKeyLike(String value) {
|
||||
addCriterion("access_key like", value, "accessKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccessKeyNotLike(String value) {
|
||||
addCriterion("access_key not like", value, "accessKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccessKeyIn(List<String> values) {
|
||||
addCriterion("access_key in", values, "accessKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccessKeyNotIn(List<String> values) {
|
||||
addCriterion("access_key not in", values, "accessKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccessKeyBetween(String value1, String value2) {
|
||||
addCriterion("access_key between", value1, value2, "accessKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccessKeyNotBetween(String value1, String value2) {
|
||||
addCriterion("access_key not between", value1, value2, "accessKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSecretKeyIsNull() {
|
||||
addCriterion("secret_key is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSecretKeyIsNotNull() {
|
||||
addCriterion("secret_key is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSecretKeyEqualTo(String value) {
|
||||
addCriterion("secret_key =", value, "secretKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSecretKeyNotEqualTo(String value) {
|
||||
addCriterion("secret_key <>", value, "secretKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSecretKeyGreaterThan(String value) {
|
||||
addCriterion("secret_key >", value, "secretKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSecretKeyGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("secret_key >=", value, "secretKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSecretKeyLessThan(String value) {
|
||||
addCriterion("secret_key <", value, "secretKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSecretKeyLessThanOrEqualTo(String value) {
|
||||
addCriterion("secret_key <=", value, "secretKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSecretKeyLike(String value) {
|
||||
addCriterion("secret_key like", value, "secretKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSecretKeyNotLike(String value) {
|
||||
addCriterion("secret_key not like", value, "secretKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSecretKeyIn(List<String> values) {
|
||||
addCriterion("secret_key in", values, "secretKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSecretKeyNotIn(List<String> values) {
|
||||
addCriterion("secret_key not in", values, "secretKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSecretKeyBetween(String value1, String value2) {
|
||||
addCriterion("secret_key between", value1, value2, "secretKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSecretKeyNotBetween(String value1, String value2) {
|
||||
addCriterion("secret_key not between", value1, value2, "secretKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNull() {
|
||||
addCriterion("create_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNotNull() {
|
||||
addCriterion("create_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeEqualTo(Long value) {
|
||||
addCriterion("create_time =", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Long value) {
|
||||
addCriterion("create_time <>", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThan(Long value) {
|
||||
addCriterion("create_time >", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("create_time >=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThan(Long value) {
|
||||
addCriterion("create_time <", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Long value) {
|
||||
addCriterion("create_time <=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIn(List<Long> values) {
|
||||
addCriterion("create_time in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotIn(List<Long> values) {
|
||||
addCriterion("create_time not in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeBetween(Long value1, Long value2) {
|
||||
addCriterion("create_time between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
|
||||
addCriterion("create_time not between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNull() {
|
||||
addCriterion("`status` is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNotNull() {
|
||||
addCriterion("`status` is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusEqualTo(String value) {
|
||||
addCriterion("`status` =", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotEqualTo(String value) {
|
||||
addCriterion("`status` <>", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThan(String value) {
|
||||
addCriterion("`status` >", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("`status` >=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThan(String value) {
|
||||
addCriterion("`status` <", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(String value) {
|
||||
addCriterion("`status` <=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLike(String value) {
|
||||
addCriterion("`status` like", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotLike(String value) {
|
||||
addCriterion("`status` not like", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIn(List<String> values) {
|
||||
addCriterion("`status` in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotIn(List<String> values) {
|
||||
addCriterion("`status` not in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusBetween(String value1, String value2) {
|
||||
addCriterion("`status` between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotBetween(String value1, String value2) {
|
||||
addCriterion("`status` not between", value1, value2, "status");
|
||||
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;
|
||||
|
||||
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 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);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package io.dataease.base.mapper;
|
||||
|
||||
import io.dataease.base.domain.UserKey;
|
||||
import io.dataease.base.domain.UserKeyExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface UserKeyMapper {
|
||||
long countByExample(UserKeyExample example);
|
||||
|
||||
int deleteByExample(UserKeyExample example);
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(UserKey record);
|
||||
|
||||
int insertSelective(UserKey record);
|
||||
|
||||
List<UserKey> selectByExample(UserKeyExample example);
|
||||
|
||||
UserKey selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") UserKey record, @Param("example") UserKeyExample example);
|
||||
|
||||
int updateByExample(@Param("record") UserKey record, @Param("example") UserKeyExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(UserKey record);
|
||||
|
||||
int updateByPrimaryKey(UserKey record);
|
||||
}
|
228
backend/src/main/java/io/dataease/base/mapper/UserKeyMapper.xml
Normal file
228
backend/src/main/java/io/dataease/base/mapper/UserKeyMapper.xml
Normal file
@ -0,0 +1,228 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="io.dataease.base.mapper.UserKeyMapper">
|
||||
<resultMap id="BaseResultMap" type="io.dataease.base.domain.UserKey">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="user_id" jdbcType="BIGINT" property="userId" />
|
||||
<result column="access_key" jdbcType="VARCHAR" property="accessKey" />
|
||||
<result column="secret_key" jdbcType="VARCHAR" property="secretKey" />
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, access_key, secret_key, create_time, `status`
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="io.dataease.base.domain.UserKeyExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from user_key
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user_key
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from user_key
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="io.dataease.base.domain.UserKeyExample">
|
||||
delete from user_key
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="io.dataease.base.domain.UserKey">
|
||||
insert into user_key (id, user_id, access_key,
|
||||
secret_key, create_time, `status`
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{accessKey,jdbcType=VARCHAR},
|
||||
#{secretKey,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{status,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="io.dataease.base.domain.UserKey">
|
||||
insert into user_key
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="accessKey != null">
|
||||
access_key,
|
||||
</if>
|
||||
<if test="secretKey != null">
|
||||
secret_key,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status`,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="accessKey != null">
|
||||
#{accessKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="secretKey != null">
|
||||
#{secretKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="io.dataease.base.domain.UserKeyExample" resultType="java.lang.Long">
|
||||
select count(*) from user_key
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update user_key
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.accessKey != null">
|
||||
access_key = #{record.accessKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.secretKey != null">
|
||||
secret_key = #{record.secretKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.status != null">
|
||||
`status` = #{record.status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update user_key
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
user_id = #{record.userId,jdbcType=BIGINT},
|
||||
access_key = #{record.accessKey,jdbcType=VARCHAR},
|
||||
secret_key = #{record.secretKey,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||
`status` = #{record.status,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.UserKey">
|
||||
update user_key
|
||||
<set>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="accessKey != null">
|
||||
access_key = #{accessKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="secretKey != null">
|
||||
secret_key = #{secretKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status` = #{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.UserKey">
|
||||
update user_key
|
||||
set user_id = #{userId,jdbcType=BIGINT},
|
||||
access_key = #{accessKey,jdbcType=VARCHAR},
|
||||
secret_key = #{secretKey,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=BIGINT},
|
||||
`status` = #{status,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,12 @@
|
||||
package io.dataease.commons.constants;
|
||||
|
||||
public class DeTypeConstants {
|
||||
|
||||
public final static Integer DE_STRING = 0;
|
||||
public final static Integer DE_TIME = 1;
|
||||
public final static Integer DE_INT = 2;
|
||||
public final static Integer DE_FLOAT = 3;
|
||||
public final static Integer DE_BOOL = 4;
|
||||
public final static Integer DE_Binary = 5;
|
||||
|
||||
}
|
@ -68,7 +68,6 @@ public class SqlFilter implements Filter {
|
||||
}
|
||||
br.close();
|
||||
} catch (IOException e) {
|
||||
System.out.println("IOException: " + e);
|
||||
}
|
||||
return str;
|
||||
|
||||
|
@ -68,7 +68,7 @@ public class ExcelReaderUtil {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
String file ="全国现有确诊趋势.xlsx";
|
||||
String file ="下单渠道.xlsx";
|
||||
ExcelReaderUtil.readExcel(file, new FileInputStream("/Users/taojinlong/Desktop/" + file));
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,6 @@ public class LicenseController {
|
||||
return ResultHolder.success(null);
|
||||
}
|
||||
F2CLicenseResponse f2CLicenseResponse = defaultLicenseService.validateLicense();
|
||||
System.out.println(new Gson().toJson(f2CLicenseResponse));
|
||||
switch (f2CLicenseResponse.getStatus()) {
|
||||
case no_record:
|
||||
return ResultHolder.success(f2CLicenseResponse);
|
||||
|
@ -8,6 +8,7 @@ import lombok.Setter;
|
||||
@Setter
|
||||
public class SqlServerConfigration extends JdbcDTO {
|
||||
private String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
|
||||
private String schema;
|
||||
|
||||
public String getJdbc(){
|
||||
return "jdbc:sqlserver://HOSTNAME:PORT;DatabaseName=DATABASE".replace("HOSTNAME", getHost()).replace("PORT", getPort().toString()).replace("DATABASE", getDataBase());
|
||||
|
@ -108,7 +108,9 @@ public class JdbcProvider extends DatasourceProvider {
|
||||
int columType = metaData.getColumnType(j + 1);
|
||||
switch (columType) {
|
||||
case Types.DATE:
|
||||
row[j] = rs.getDate(j + 1).toString();
|
||||
if(rs.getDate(j + 1) != null){
|
||||
row[j] = rs.getDate(j + 1).toString();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
row[j] = rs.getString(j + 1);
|
||||
@ -287,7 +289,7 @@ public class JdbcProvider extends DatasourceProvider {
|
||||
}
|
||||
tableFiled.setRemarks(remarks);
|
||||
tableFiled.setFieldSize(Integer.valueOf(resultSet.getString("COLUMN_SIZE")));
|
||||
String dbType = resultSet.getString("TYPE_NAME");
|
||||
String dbType = resultSet.getString("TYPE_NAME").toUpperCase();
|
||||
tableFiled.setFieldType(dbType);
|
||||
if(dbType.equalsIgnoreCase("LONG")){tableFiled.setFieldSize(65533);}
|
||||
if(StringUtils.isNotEmpty(dbType) && dbType.toLowerCase().contains("date") && tableFiled.getFieldSize() < 50 ){
|
||||
@ -506,7 +508,9 @@ public class JdbcProvider extends DatasourceProvider {
|
||||
return "show tables;";
|
||||
case sqlServer:
|
||||
SqlServerConfigration sqlServerConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), SqlServerConfigration.class);
|
||||
return "SELECT TABLE_NAME FROM DATABASE.INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE';".replace("DATABASE", sqlServerConfigration.getDataBase());
|
||||
return "SELECT TABLE_NAME FROM DATABASE.INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA = 'DS_SCHEMA' ;"
|
||||
.replace("DATABASE", sqlServerConfigration.getDataBase())
|
||||
.replace("DS_SCHEMA", sqlServerConfigration.getSchema());
|
||||
case oracle:
|
||||
OracleConfigration oracleConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), OracleConfigration.class);
|
||||
if(StringUtils.isEmpty(oracleConfigration.getSchema())){
|
||||
@ -523,6 +527,8 @@ public class JdbcProvider extends DatasourceProvider {
|
||||
switch (datasourceType) {
|
||||
case oracle:
|
||||
return "select * from all_users";
|
||||
case sqlServer:
|
||||
return "select name from sys.schemas;";
|
||||
default:
|
||||
return "show tables;";
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
package io.dataease.dto.chart;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author gin
|
||||
* @Date 2021/8/9 10:14 上午
|
||||
*/
|
||||
@Data
|
||||
public class AxisChartDataDTO {
|
||||
private BigDecimal value;
|
||||
private List<ChartDimensionDTO> dimensionList;
|
||||
private List<ChartQuotaDTO> quotaList;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package io.dataease.dto.chart;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author gin
|
||||
* @Date 2021/8/9 10:15 上午
|
||||
*/
|
||||
@Data
|
||||
public class ChartDimensionDTO {
|
||||
private String id;
|
||||
private String value;
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package io.dataease.dto.chart;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author gin
|
||||
* @Date 2021/8/9 10:16 上午
|
||||
*/
|
||||
@Data
|
||||
public class ChartQuotaDTO {
|
||||
private String id;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package io.dataease.dto.chart;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author gin
|
||||
* @Date 2021/8/9 10:14 上午
|
||||
*/
|
||||
@Data
|
||||
public class ScatterChartDataDTO {
|
||||
private Object[] value;
|
||||
private List<ChartDimensionDTO> dimensionList;
|
||||
private List<ChartQuotaDTO> quotaList;
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package io.dataease.plugins.server;
|
||||
|
||||
import io.dataease.commons.utils.AuthUtils;
|
||||
import io.dataease.plugins.config.SpringContextUtil;
|
||||
import io.dataease.plugins.xpack.ukey.dto.request.XpackUkeyDto;
|
||||
import io.dataease.plugins.xpack.ukey.service.UkeyXpackService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.ServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
@RequestMapping("/plugin/ukey")
|
||||
@RestController
|
||||
public class XUserKeysServer {
|
||||
|
||||
|
||||
@PostMapping("info")
|
||||
public List<XpackUkeyDto> getUserKeysInfo() {
|
||||
|
||||
UkeyXpackService ukeyXpackService = SpringContextUtil.getBean(UkeyXpackService.class);
|
||||
Long userId = AuthUtils.getUser().getUserId();
|
||||
return ukeyXpackService.getUserKeysInfo(userId);
|
||||
}
|
||||
|
||||
@PostMapping("validate")
|
||||
public String validate(ServletRequest request) {
|
||||
// return ApiKeyHandler.getUser(WebUtils.toHttp(request));
|
||||
return null;
|
||||
}
|
||||
|
||||
@PostMapping("generate")
|
||||
public void generateUserKey() {
|
||||
UkeyXpackService ukeyXpackService = SpringContextUtil.getBean(UkeyXpackService.class);
|
||||
Long userId = AuthUtils.getUser().getUserId();
|
||||
ukeyXpackService.generateUserKey(userId);
|
||||
}
|
||||
|
||||
@PostMapping("delete/{id}")
|
||||
public void deleteUserKey(@PathVariable Long id) {
|
||||
UkeyXpackService ukeyXpackService = SpringContextUtil.getBean(UkeyXpackService.class);
|
||||
ukeyXpackService.deleteUserKey(id);
|
||||
}
|
||||
|
||||
@PostMapping("changeStatus/{id}")
|
||||
public void changeStatus(@PathVariable Long id) {
|
||||
UkeyXpackService ukeyXpackService = SpringContextUtil.getBean(UkeyXpackService.class);
|
||||
ukeyXpackService.switchStatus(id);
|
||||
}
|
||||
|
||||
/*@GetMapping("active/{id}")
|
||||
public void activeUserKey(@PathVariable Long id) {
|
||||
UkeyXpackService ukeyXpackService = SpringContextUtil.getBean(UkeyXpackService.class);
|
||||
ukeyXpackService.activeUserKey(id);
|
||||
}
|
||||
|
||||
@GetMapping("disable/{id}")
|
||||
public void disabledUserKey(@PathVariable Long id) {
|
||||
UkeyXpackService ukeyXpackService = SpringContextUtil.getBean(UkeyXpackService.class);
|
||||
ukeyXpackService.disableUserKey(id);
|
||||
}*/
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package io.dataease.provider;
|
||||
|
||||
import io.dataease.base.domain.DatasetTableField;
|
||||
import io.dataease.base.domain.Datasource;
|
||||
import io.dataease.controller.request.chart.ChartExtFilterRequest;
|
||||
import io.dataease.dto.chart.ChartCustomFilterDTO;
|
||||
import io.dataease.dto.chart.ChartViewFieldDTO;
|
||||
@ -12,21 +13,18 @@ import java.util.List;
|
||||
* @Date 2021/5/17 2:42 下午
|
||||
*/
|
||||
public abstract class QueryProvider {
|
||||
|
||||
public abstract Integer transFieldType(String field);
|
||||
|
||||
public abstract String createQueryCountSQL(String table);
|
||||
|
||||
public abstract String createQueryCountSQLAsTmp(String sql);
|
||||
|
||||
public abstract String createSQLPreview(String sql, String orderBy);
|
||||
|
||||
public abstract String createQuerySQL(String table, List<DatasetTableField> fields, boolean isGroup);
|
||||
public abstract String createQuerySQL(String table, List<DatasetTableField> fields, boolean isGroup, Datasource ds);
|
||||
|
||||
public abstract String createQuerySQLAsTmp(String sql, List<DatasetTableField> fields, boolean isGroup);
|
||||
|
||||
public abstract String createQuerySQLWithPage(String table, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize, boolean isGroup);
|
||||
public abstract String createQuerySQLWithPage(String table, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize, boolean isGroup, Datasource ds);
|
||||
|
||||
public abstract String createQueryTableWithLimit(String table, List<DatasetTableField> fields, Integer limit, boolean isGroup);
|
||||
public abstract String createQueryTableWithLimit(String table, List<DatasetTableField> fields, Integer limit, boolean isGroup, Datasource ds);
|
||||
|
||||
public abstract String createQuerySqlWithLimit(String sql, List<DatasetTableField> fields, Integer limit, boolean isGroup);
|
||||
|
||||
|
@ -2,6 +2,7 @@ package io.dataease.provider.doris;
|
||||
|
||||
import io.dataease.base.domain.DatasetTableField;
|
||||
import io.dataease.base.domain.DatasetTableFieldExample;
|
||||
import io.dataease.base.domain.Datasource;
|
||||
import io.dataease.base.mapper.DatasetTableFieldMapper;
|
||||
import io.dataease.controller.request.chart.ChartExtFilterRequest;
|
||||
import io.dataease.dto.chart.ChartCustomFilterDTO;
|
||||
@ -70,23 +71,13 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createQueryCountSQL(String table) {
|
||||
return MessageFormat.format("SELECT count(*) FROM {0}", table);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createQueryCountSQLAsTmp(String sql) {
|
||||
return createQueryCountSQL(" (" + sql + ") AS tmp ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createSQLPreview(String sql, String orderBy) {
|
||||
return "SELECT * FROM (" + sql + ") AS tmp ORDER BY " + orderBy + " LIMIT 0,1000";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createQuerySQL(String table, List<DatasetTableField> fields, boolean isGroup) {
|
||||
public String createQuerySQL(String table, List<DatasetTableField> fields, boolean isGroup, Datasource ds) {
|
||||
SQLObj tableObj = SQLObj.builder()
|
||||
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(DorisConstants.KEYWORD_TABLE, table))
|
||||
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
||||
@ -159,17 +150,17 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
|
||||
@Override
|
||||
public String createQuerySQLAsTmp(String sql, List<DatasetTableField> fields, boolean isGroup) {
|
||||
return createQuerySQL("(" + sql + ")", fields, isGroup);
|
||||
return createQuerySQL("(" + sql + ")", fields, isGroup, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createQuerySQLWithPage(String table, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize, boolean isGroup) {
|
||||
return createQuerySQL(table, fields, isGroup) + " LIMIT " + (page - 1) * pageSize + "," + realSize;
|
||||
public String createQuerySQLWithPage(String table, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize, boolean isGroup, Datasource ds) {
|
||||
return createQuerySQL(table, fields, isGroup, null) + " LIMIT " + (page - 1) * pageSize + "," + realSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createQueryTableWithLimit(String table, List<DatasetTableField> fields, Integer limit, boolean isGroup) {
|
||||
return createQuerySQL(table, fields, isGroup) + " LIMIT 0," + limit;
|
||||
public String createQueryTableWithLimit(String table, List<DatasetTableField> fields, Integer limit, boolean isGroup, Datasource ds) {
|
||||
return createQuerySQL(table, fields, isGroup, null) + " LIMIT 0," + limit;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2,6 +2,7 @@ package io.dataease.provider.mysql;
|
||||
|
||||
import io.dataease.base.domain.DatasetTableField;
|
||||
import io.dataease.base.domain.DatasetTableFieldExample;
|
||||
import io.dataease.base.domain.Datasource;
|
||||
import io.dataease.base.mapper.DatasetTableFieldMapper;
|
||||
import io.dataease.controller.request.chart.ChartExtFilterRequest;
|
||||
import io.dataease.dto.chart.ChartCustomFilterDTO;
|
||||
@ -70,23 +71,13 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createQueryCountSQL(String table) {
|
||||
return MessageFormat.format("SELECT COUNT(*) FROM {0}", table);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createQueryCountSQLAsTmp(String sql) {
|
||||
return createQueryCountSQL(" (" + sqlFix(sql) + ") AS tmp ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createSQLPreview(String sql, String orderBy) {
|
||||
return "SELECT * FROM (" + sqlFix(sql) + ") AS tmp ORDER BY null " + " LIMIT 0,1000";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createQuerySQL(String table, List<DatasetTableField> fields, boolean isGroup) {
|
||||
public String createQuerySQL(String table, List<DatasetTableField> fields, boolean isGroup, Datasource ds) {
|
||||
SQLObj tableObj = SQLObj.builder()
|
||||
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(MySQLConstants.KEYWORD_TABLE, table))
|
||||
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
||||
@ -150,17 +141,17 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
|
||||
@Override
|
||||
public String createQuerySQLAsTmp(String sql, List<DatasetTableField> fields, boolean isGroup) {
|
||||
return createQuerySQL("(" + sqlFix(sql) + ")", fields, isGroup);
|
||||
return createQuerySQL("(" + sqlFix(sql) + ")", fields, isGroup, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createQuerySQLWithPage(String table, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize, boolean isGroup) {
|
||||
return createQuerySQL(table, fields, isGroup) + " LIMIT " + (page - 1) * pageSize + "," + realSize;
|
||||
public String createQuerySQLWithPage(String table, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize, boolean isGroup, Datasource ds) {
|
||||
return createQuerySQL(table, fields, isGroup, null) + " LIMIT " + (page - 1) * pageSize + "," + realSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createQueryTableWithLimit(String table, List<DatasetTableField> fields, Integer limit, boolean isGroup) {
|
||||
return createQuerySQL(table, fields, isGroup) + " LIMIT 0," + limit;
|
||||
public String createQueryTableWithLimit(String table, List<DatasetTableField> fields, Integer limit, boolean isGroup, Datasource ds) {
|
||||
return createQuerySQL(table, fields, isGroup, null) + " LIMIT 0," + limit;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2,6 +2,7 @@ package io.dataease.provider.oracle;
|
||||
|
||||
import io.dataease.base.domain.DatasetTableField;
|
||||
import io.dataease.base.domain.DatasetTableFieldExample;
|
||||
import io.dataease.base.domain.Datasource;
|
||||
import io.dataease.base.mapper.DatasetTableFieldMapper;
|
||||
import io.dataease.controller.request.chart.ChartExtFilterRequest;
|
||||
import io.dataease.dto.chart.ChartCustomFilterDTO;
|
||||
@ -82,23 +83,13 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createQueryCountSQL(String table) {
|
||||
return MessageFormat.format("SELECT COUNT(*) FROM {0}", table);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createQueryCountSQLAsTmp(String sql) {
|
||||
return createQueryCountSQL(" (" + sqlFix(sql) + ") DE_TMP ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createSQLPreview(String sql, String orderBy) {
|
||||
return "SELECT * FROM (" + sqlFix(sql) + ") DE_TMP " + " WHERE rownum <= 1000";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createQuerySQL(String table, List<DatasetTableField> fields, boolean isGroup) {
|
||||
public String createQuerySQL(String table, List<DatasetTableField> fields, boolean isGroup, Datasource ds) {
|
||||
SQLObj tableObj = SQLObj.builder()
|
||||
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(OracleConstants.KEYWORD_TABLE, table))
|
||||
.tableAlias(String.format(OracleConstants.ALIAS_FIX, String.format(TABLE_ALIAS_PREFIX, 0)))
|
||||
@ -179,19 +170,19 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
|
||||
@Override
|
||||
public String createQuerySQLAsTmp(String sql, List<DatasetTableField> fields, boolean isGroup) {
|
||||
return createQuerySQL("(" + sqlFix(sql) + ")", fields, isGroup);
|
||||
return createQuerySQL("(" + sqlFix(sql) + ")", fields, isGroup, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createQuerySQLWithPage(String table, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize, boolean isGroup) {
|
||||
public String createQuerySQLWithPage(String table, List<DatasetTableField> fields, Integer page, Integer pageSize, Integer realSize, boolean isGroup, Datasource ds) {
|
||||
List<SQLObj> xFields = xFields(table, fields);
|
||||
|
||||
return MessageFormat.format("SELECT {0} FROM ( SELECT DE_TMP.*, rownum r FROM ( {1} ) DE_TMP WHERE rownum <= {2} ) WHERE r > {3} ",
|
||||
sqlColumn(xFields), createQuerySQL(table, fields, isGroup), Integer.valueOf(page * realSize).toString(), Integer.valueOf((page - 1) * pageSize).toString());
|
||||
sqlColumn(xFields), createQuerySQL(table, fields, isGroup, null), Integer.valueOf(page * realSize).toString(), Integer.valueOf((page - 1) * pageSize).toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createQueryTableWithLimit(String table, List<DatasetTableField> fields, Integer limit, boolean isGroup) {
|
||||
public String createQueryTableWithLimit(String table, List<DatasetTableField> fields, Integer limit, boolean isGroup, Datasource ds) {
|
||||
return String.format("SELECT %s.* from %s WHERE rownum <= %s ", table, table, limit.toString());
|
||||
}
|
||||
|
||||
@ -641,10 +632,10 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
public String createRawQuerySQL(String table, List<DatasetTableField> fields) {
|
||||
String[] array = fields.stream().map(f -> {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.append(" ").append(f.getOriginName());
|
||||
stringBuilder.append(" \"").append(f.getOriginName()).append("\"");
|
||||
return stringBuilder.toString();
|
||||
}).toArray(String[]::new);
|
||||
return MessageFormat.format("SELECT {0} FROM {1} ORDER BY null", StringUtils.join(array, ","), table);
|
||||
return MessageFormat.format("SELECT {0} FROM {1} ORDER BY null", StringUtils.join(array, ","), "\"" + table + "\"");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -0,0 +1,43 @@
|
||||
package io.dataease.provider.sqlserver;
|
||||
|
||||
import io.dataease.provider.SQLConstants;
|
||||
|
||||
import static io.dataease.datasource.constants.DatasourceTypes.sqlServer;
|
||||
|
||||
/**
|
||||
* @Author gin
|
||||
* @Date 2021/7/8 7:22 下午
|
||||
*/
|
||||
public class SqlServerSQLConstants extends SQLConstants {
|
||||
public static final String KEYWORD_TABLE = sqlServer.getKeywordPrefix() + "%s" + sqlServer.getKeywordSuffix();
|
||||
|
||||
public static final String KEYWORD_FIX = "%s." + sqlServer.getKeywordPrefix() + "%s" + sqlServer.getKeywordSuffix();
|
||||
|
||||
public static final String UNIX_TIMESTAMP = "CAST(DATEDIFF(ss,'1970-01-01 08:00:00', %s) as bigint ) * 1000 ";
|
||||
|
||||
public static final String DATE_FORMAT = "CONVERT(varchar(100), %s, %s)";
|
||||
|
||||
public static final String FROM_UNIXTIME = "convert(varchar, %s ,120)";
|
||||
|
||||
public static final String CONVERT = "CONVERT(%s, %s)";
|
||||
|
||||
public static final String LONG_TO_DATE = "DATEADD(second,%s,'1970-01-01 08:00:00')";
|
||||
|
||||
public static final String STRING_TO_DATE = "CONVERT(datetime, %s ,120)";
|
||||
|
||||
public static final String DEFAULT_INT_FORMAT = "DECIMAL(20,0)";
|
||||
|
||||
public static final String DEFAULT_FLOAT_FORMAT = "DECIMAL(20,2)";
|
||||
|
||||
public static final String WHERE_VALUE_NULL = "(NULL,'')";
|
||||
|
||||
public static final String WHERE_VALUE_VALUE = "'%s'";
|
||||
|
||||
public static final String AGG_COUNT = "COUNT(*)";
|
||||
|
||||
public static final String AGG_FIELD = "%s(%s)";
|
||||
|
||||
public static final String WHERE_BETWEEN = "'%s' AND '%s'";
|
||||
|
||||
public static final String BRACKETS = "(%s)";
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -365,6 +365,11 @@ public class ChartViewService {
|
||||
mapChart = transStackChartData(xAxis, yAxis, view, data, extStack);
|
||||
} else if (StringUtils.containsIgnoreCase(view.getType(), "scatter")) {
|
||||
mapChart = transScatterData(xAxis, yAxis, view, data, extBubble);
|
||||
} else if (StringUtils.containsIgnoreCase(view.getType(), "radar")) {
|
||||
mapChart = transRadarChartData(xAxis, yAxis, view, data);
|
||||
} else if (StringUtils.containsIgnoreCase(view.getType(), "text")
|
||||
|| StringUtils.containsIgnoreCase(view.getType(), "gauge")) {
|
||||
mapChart = transNormalChartData(xAxis, yAxis, view, data);
|
||||
} else {
|
||||
mapChart = transChartData(xAxis, yAxis, view, data);
|
||||
}
|
||||
@ -421,6 +426,101 @@ public class ChartViewService {
|
||||
private Map<String, Object> transChartData(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, ChartViewWithBLOBs view, List<String[]> data) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
List<String> x = new ArrayList<>();
|
||||
List<Series> series = new ArrayList<>();
|
||||
for (ChartViewFieldDTO y : yAxis) {
|
||||
Series series1 = new Series();
|
||||
series1.setName(y.getName());
|
||||
series1.setType(view.getType());
|
||||
series1.setData(new ArrayList<>());
|
||||
series.add(series1);
|
||||
}
|
||||
for (int i1 = 0; i1 < data.size(); i1++) {
|
||||
String[] d = data.get(i1);
|
||||
|
||||
StringBuilder a = new StringBuilder();
|
||||
for (int i = xAxis.size(); i < xAxis.size() + yAxis.size(); i++) {
|
||||
List<ChartDimensionDTO> dimensionList = new ArrayList<>();
|
||||
List<ChartQuotaDTO> quotaList = new ArrayList<>();
|
||||
AxisChartDataDTO axisChartDataDTO = new AxisChartDataDTO();
|
||||
|
||||
for (int j = 0; j < xAxis.size(); j++) {
|
||||
ChartDimensionDTO chartDimensionDTO = new ChartDimensionDTO();
|
||||
chartDimensionDTO.setId(xAxis.get(j).getId());
|
||||
chartDimensionDTO.setValue(d[j]);
|
||||
dimensionList.add(chartDimensionDTO);
|
||||
}
|
||||
axisChartDataDTO.setDimensionList(dimensionList);
|
||||
|
||||
int j = i - xAxis.size();
|
||||
ChartQuotaDTO chartQuotaDTO = new ChartQuotaDTO();
|
||||
chartQuotaDTO.setId(yAxis.get(j).getId());
|
||||
quotaList.add(chartQuotaDTO);
|
||||
axisChartDataDTO.setQuotaList(quotaList);
|
||||
try {
|
||||
axisChartDataDTO.setValue(new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]));
|
||||
} catch (Exception e) {
|
||||
axisChartDataDTO.setValue(new BigDecimal(0));
|
||||
}
|
||||
series.get(j).getData().add(axisChartDataDTO);
|
||||
}
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
if (i == xAxis.size() - 1) {
|
||||
a.append(d[i]);
|
||||
} else {
|
||||
a.append(d[i]).append("\n");
|
||||
}
|
||||
}
|
||||
x.add(a.toString());
|
||||
}
|
||||
|
||||
map.put("x", x);
|
||||
map.put("series", series);
|
||||
return map;
|
||||
}
|
||||
|
||||
// 常规图形
|
||||
private Map<String, Object> transNormalChartData(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, ChartViewWithBLOBs view, List<String[]> data) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
List<String> x = new ArrayList<>();
|
||||
List<Series> series = new ArrayList<>();
|
||||
for (ChartViewFieldDTO y : yAxis) {
|
||||
Series series1 = new Series();
|
||||
series1.setName(y.getName());
|
||||
series1.setType(view.getType());
|
||||
series1.setData(new ArrayList<>());
|
||||
series.add(series1);
|
||||
}
|
||||
for (String[] d : data) {
|
||||
StringBuilder a = new StringBuilder();
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
if (i == xAxis.size() - 1) {
|
||||
a.append(d[i]);
|
||||
} else {
|
||||
a.append(d[i]).append("\n");
|
||||
}
|
||||
}
|
||||
x.add(a.toString());
|
||||
for (int i = xAxis.size(); i < xAxis.size() + yAxis.size(); i++) {
|
||||
int j = i - xAxis.size();
|
||||
try {
|
||||
series.get(j).getData().add(new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]));
|
||||
} catch (Exception e) {
|
||||
series.get(j).getData().add(new BigDecimal(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
map.put("x", x);
|
||||
map.put("series", series);
|
||||
return map;
|
||||
}
|
||||
|
||||
// radar图
|
||||
private Map<String, Object> transRadarChartData(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, ChartViewWithBLOBs view, List<String[]> data) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
List<String> x = new ArrayList<>();
|
||||
List<Series> series = new ArrayList<>();
|
||||
for (ChartViewFieldDTO y : yAxis) {
|
||||
@ -464,7 +564,9 @@ public class ChartViewService {
|
||||
List<Series> series = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(extStack)) {
|
||||
AxisChartDataDTO defaultAxisChartDataDTO = new AxisChartDataDTO();
|
||||
BigDecimal defaultValue = StringUtils.containsIgnoreCase(view.getType(), "line") ? new BigDecimal(0) : null;
|
||||
defaultAxisChartDataDTO.setValue(defaultValue);
|
||||
// 构建横轴
|
||||
for (String[] d : data) {
|
||||
StringBuilder a = new StringBuilder();
|
||||
@ -489,7 +591,7 @@ public class ChartViewService {
|
||||
series1.setType(view.getType());
|
||||
List<Object> list = new ArrayList<>();
|
||||
for (int i = 0; i < x.size(); i++) {
|
||||
list.add(defaultValue);
|
||||
list.add(defaultAxisChartDataDTO);
|
||||
}
|
||||
series1.setData(list);
|
||||
series.add(series1);
|
||||
@ -509,9 +611,31 @@ public class ChartViewService {
|
||||
}
|
||||
if (StringUtils.equals(a.toString(), x.get(i))) {
|
||||
if (row.length > xAxis.size() + extStack.size()) {
|
||||
List<ChartDimensionDTO> dimensionList = new ArrayList<>();
|
||||
List<ChartQuotaDTO> quotaList = new ArrayList<>();
|
||||
AxisChartDataDTO axisChartDataDTO = new AxisChartDataDTO();
|
||||
|
||||
ChartQuotaDTO chartQuotaDTO = new ChartQuotaDTO();
|
||||
chartQuotaDTO.setId(yAxis.get(0).getId());
|
||||
quotaList.add(chartQuotaDTO);
|
||||
axisChartDataDTO.setQuotaList(quotaList);
|
||||
|
||||
for (int k = 0; k < xAxis.size(); k++) {
|
||||
ChartDimensionDTO chartDimensionDTO = new ChartDimensionDTO();
|
||||
chartDimensionDTO.setId(xAxis.get(k).getId());
|
||||
chartDimensionDTO.setValue(row[k]);
|
||||
dimensionList.add(chartDimensionDTO);
|
||||
}
|
||||
ChartDimensionDTO chartDimensionDTO = new ChartDimensionDTO();
|
||||
chartDimensionDTO.setId(extStack.get(0).getId());
|
||||
chartDimensionDTO.setValue(row[xAxis.size()]);
|
||||
dimensionList.add(chartDimensionDTO);
|
||||
axisChartDataDTO.setDimensionList(dimensionList);
|
||||
|
||||
String s = row[xAxis.size() + extStack.size()];
|
||||
if (StringUtils.isNotEmpty(s)) {
|
||||
ss.getData().set(i, new BigDecimal(s));
|
||||
axisChartDataDTO.setValue(new BigDecimal(s));
|
||||
ss.getData().set(i, axisChartDataDTO);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -528,8 +652,35 @@ public class ChartViewService {
|
||||
series1.setData(new ArrayList<>());
|
||||
series.add(series1);
|
||||
}
|
||||
for (String[] d : data) {
|
||||
for (int i1 = 0; i1 < data.size(); i1++) {
|
||||
String[] d = data.get(i1);
|
||||
|
||||
StringBuilder a = new StringBuilder();
|
||||
for (int i = xAxis.size(); i < xAxis.size() + yAxis.size(); i++) {
|
||||
List<ChartDimensionDTO> dimensionList = new ArrayList<>();
|
||||
List<ChartQuotaDTO> quotaList = new ArrayList<>();
|
||||
AxisChartDataDTO axisChartDataDTO = new AxisChartDataDTO();
|
||||
|
||||
for (int j = 0; j < xAxis.size(); j++) {
|
||||
ChartDimensionDTO chartDimensionDTO = new ChartDimensionDTO();
|
||||
chartDimensionDTO.setId(xAxis.get(j).getId());
|
||||
chartDimensionDTO.setValue(d[j]);
|
||||
dimensionList.add(chartDimensionDTO);
|
||||
}
|
||||
axisChartDataDTO.setDimensionList(dimensionList);
|
||||
|
||||
int j = i - xAxis.size();
|
||||
ChartQuotaDTO chartQuotaDTO = new ChartQuotaDTO();
|
||||
chartQuotaDTO.setId(yAxis.get(j).getId());
|
||||
quotaList.add(chartQuotaDTO);
|
||||
axisChartDataDTO.setQuotaList(quotaList);
|
||||
try {
|
||||
axisChartDataDTO.setValue(new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]));
|
||||
} catch (Exception e) {
|
||||
axisChartDataDTO.setValue(new BigDecimal(0));
|
||||
}
|
||||
series.get(j).getData().add(axisChartDataDTO);
|
||||
}
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
if (i == xAxis.size() - 1) {
|
||||
a.append(d[i]);
|
||||
@ -538,14 +689,6 @@ public class ChartViewService {
|
||||
}
|
||||
}
|
||||
x.add(a.toString());
|
||||
for (int i = xAxis.size(); i < xAxis.size() + yAxis.size(); i++) {
|
||||
int j = i - xAxis.size();
|
||||
try {
|
||||
series.get(j).getData().add(new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]));
|
||||
} catch (Exception e) {
|
||||
series.get(j).getData().add(new BigDecimal(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -567,7 +710,66 @@ public class ChartViewService {
|
||||
series1.setData(new ArrayList<>());
|
||||
series.add(series1);
|
||||
}
|
||||
for (String[] d : data) {
|
||||
for (int i1 = 0; i1 < data.size(); i1++) {
|
||||
String[] d = data.get(i1);
|
||||
|
||||
StringBuilder a = new StringBuilder();
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
if (i == xAxis.size() - 1) {
|
||||
a.append(d[i]);
|
||||
} else {
|
||||
a.append(d[i]).append("\n");
|
||||
}
|
||||
}
|
||||
x.add(a.toString());
|
||||
for (int i = xAxis.size(); i < xAxis.size() + yAxis.size(); i++) {
|
||||
List<ChartDimensionDTO> dimensionList = new ArrayList<>();
|
||||
List<ChartQuotaDTO> quotaList = new ArrayList<>();
|
||||
ScatterChartDataDTO scatterChartDataDTO = new ScatterChartDataDTO();
|
||||
|
||||
for (int j = 0; j < xAxis.size(); j++) {
|
||||
ChartDimensionDTO chartDimensionDTO = new ChartDimensionDTO();
|
||||
chartDimensionDTO.setId(xAxis.get(j).getId());
|
||||
chartDimensionDTO.setValue(d[j]);
|
||||
dimensionList.add(chartDimensionDTO);
|
||||
}
|
||||
scatterChartDataDTO.setDimensionList(dimensionList);
|
||||
|
||||
int j = i - xAxis.size();
|
||||
ChartQuotaDTO chartQuotaDTO = new ChartQuotaDTO();
|
||||
chartQuotaDTO.setId(yAxis.get(j).getId());
|
||||
quotaList.add(chartQuotaDTO);
|
||||
scatterChartDataDTO.setQuotaList(quotaList);
|
||||
// try {
|
||||
// axisChartDataDTO.setValue(new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]));
|
||||
// } catch (Exception e) {
|
||||
// axisChartDataDTO.setValue(new BigDecimal(0));
|
||||
// }
|
||||
if (CollectionUtils.isNotEmpty(extBubble) && extBubble.size() > 0) {
|
||||
try {
|
||||
scatterChartDataDTO.setValue(new Object[]{
|
||||
a.toString(),
|
||||
new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]),
|
||||
new BigDecimal(StringUtils.isEmpty(d[xAxis.size() + yAxis.size()]) ? "0" : d[xAxis.size() + yAxis.size()])
|
||||
});
|
||||
} catch (Exception e) {
|
||||
scatterChartDataDTO.setValue(new Object[]{a.toString(), new BigDecimal(0), new BigDecimal(0)});
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
scatterChartDataDTO.setValue(new Object[]{
|
||||
a.toString(),
|
||||
new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i])
|
||||
});
|
||||
} catch (Exception e) {
|
||||
scatterChartDataDTO.setValue(new Object[]{a.toString(), new BigDecimal(0)});
|
||||
}
|
||||
}
|
||||
series.get(j).getData().add(scatterChartDataDTO);
|
||||
}
|
||||
}
|
||||
|
||||
/*for (String[] d : data) {
|
||||
StringBuilder a = new StringBuilder();
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
if (i == xAxis.size() - 1) {
|
||||
@ -600,7 +802,7 @@ public class ChartViewService {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
map.put("x", x);
|
||||
map.put("series", series);
|
||||
|
@ -377,7 +377,7 @@ public class DataSetTableService {
|
||||
datasourceRequest.setDatasource(ds);
|
||||
String table = dataTableInfoDTO.getTable();
|
||||
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||
datasourceRequest.setQuery(qp.createQuerySQLWithPage(table, fields, page, pageSize, realSize, false));
|
||||
datasourceRequest.setQuery(qp.createQuerySQLWithPage(table, fields, page, pageSize, realSize, false, ds));
|
||||
map.put("sql", datasourceRequest.getQuery());
|
||||
try {
|
||||
data.addAll(datasourceProvider.getData(datasourceRequest));
|
||||
@ -386,7 +386,7 @@ public class DataSetTableService {
|
||||
DEException.throwException(e.getMessage());
|
||||
}
|
||||
try {
|
||||
datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow()), false));
|
||||
datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow()), false, ds));
|
||||
dataSetPreviewPage.setTotal(datasourceProvider.getData(datasourceRequest).size());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -403,7 +403,7 @@ public class DataSetTableService {
|
||||
datasourceRequest.setDatasource(ds);
|
||||
String table = DorisTableUtils.dorisName(dataSetTableRequest.getId());
|
||||
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||
datasourceRequest.setQuery(qp.createQuerySQLWithPage(table, fields, page, pageSize, realSize, false));
|
||||
datasourceRequest.setQuery(qp.createQuerySQLWithPage(table, fields, page, pageSize, realSize, false, ds));
|
||||
map.put("sql", datasourceRequest.getQuery());
|
||||
try {
|
||||
data.addAll(jdbcProvider.getData(datasourceRequest));
|
||||
@ -412,7 +412,7 @@ public class DataSetTableService {
|
||||
DEException.throwException(e.getMessage());
|
||||
}
|
||||
try {
|
||||
datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow()), false));
|
||||
datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow()), false, ds));
|
||||
dataSetPreviewPage.setTotal(jdbcProvider.getData(datasourceRequest).size());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -458,7 +458,7 @@ public class DataSetTableService {
|
||||
datasourceRequest.setDatasource(ds);
|
||||
String table = DorisTableUtils.dorisName(dataSetTableRequest.getId());
|
||||
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||
datasourceRequest.setQuery(qp.createQuerySQLWithPage(table, fields, page, pageSize, realSize, false));
|
||||
datasourceRequest.setQuery(qp.createQuerySQLWithPage(table, fields, page, pageSize, realSize, false, ds));
|
||||
map.put("sql", datasourceRequest.getQuery());
|
||||
try {
|
||||
data.addAll(jdbcProvider.getData(datasourceRequest));
|
||||
@ -467,7 +467,7 @@ public class DataSetTableService {
|
||||
DEException.throwException(e.getMessage());
|
||||
}
|
||||
try {
|
||||
datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow()), false));
|
||||
datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow()), false, ds));
|
||||
dataSetPreviewPage.setTotal(jdbcProvider.getData(datasourceRequest).size());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -485,7 +485,7 @@ public class DataSetTableService {
|
||||
datasourceRequest.setDatasource(ds);
|
||||
String table = DorisTableUtils.dorisName(dataSetTableRequest.getId());
|
||||
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||
datasourceRequest.setQuery(qp.createQuerySQLWithPage(table, fields, page, pageSize, realSize, false));
|
||||
datasourceRequest.setQuery(qp.createQuerySQLWithPage(table, fields, page, pageSize, realSize, false, ds));
|
||||
map.put("sql", datasourceRequest.getQuery());
|
||||
try {
|
||||
data.addAll(jdbcProvider.getData(datasourceRequest));
|
||||
@ -494,7 +494,7 @@ public class DataSetTableService {
|
||||
DEException.throwException(e.getMessage());
|
||||
}
|
||||
try {
|
||||
datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow()), false));
|
||||
datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow()), false, ds));
|
||||
dataSetPreviewPage.setTotal(jdbcProvider.getData(datasourceRequest).size());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -537,7 +537,7 @@ public class DataSetTableService {
|
||||
datasourceRequest.setDatasource(ds);
|
||||
String table = DorisTableUtils.dorisName(dataSetTableRequest.getId());
|
||||
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||
datasourceRequest.setQuery(qp.createQuerySQLWithPage(table, fields, page, pageSize, realSize, false));
|
||||
datasourceRequest.setQuery(qp.createQuerySQLWithPage(table, fields, page, pageSize, realSize, false, ds));
|
||||
map.put("sql", datasourceRequest.getQuery());
|
||||
try {
|
||||
data.addAll(jdbcProvider.getData(datasourceRequest));
|
||||
@ -547,7 +547,7 @@ public class DataSetTableService {
|
||||
}
|
||||
|
||||
try {
|
||||
datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow()), false));
|
||||
datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow()), false, ds));
|
||||
dataSetPreviewPage.setTotal(jdbcProvider.getData(datasourceRequest).size());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -865,7 +865,7 @@ public class ExtractDataService {
|
||||
textFileOutputMeta.setSeparator(separator);
|
||||
textFileOutputMeta.setExtension(extention);
|
||||
|
||||
if (datasource.getType().equalsIgnoreCase(DatasourceTypes.oracle.name())) {
|
||||
if (datasource.getType().equalsIgnoreCase(DatasourceTypes.oracle.name()) ) {
|
||||
TextFileField[] outputFields = new TextFileField[datasetTableFields.size() + 1];
|
||||
for(int i=0;i< datasetTableFields.size();i++){
|
||||
TextFileField textFileField = new TextFileField();
|
||||
@ -878,6 +878,20 @@ public class ExtractDataService {
|
||||
textFileField.setType("String");
|
||||
outputFields[datasetTableFields.size()] = textFileField;
|
||||
|
||||
textFileOutputMeta.setOutputFields(outputFields);
|
||||
}else if (datasource.getType().equalsIgnoreCase(DatasourceTypes.sqlServer.name())){
|
||||
TextFileField[] outputFields = new TextFileField[datasetTableFields.size() + 1];
|
||||
for(int i=0;i< datasetTableFields.size();i++){
|
||||
TextFileField textFileField = new TextFileField();
|
||||
textFileField.setName(datasetTableFields.get(i).getDataeaseName());
|
||||
textFileField.setType("String");
|
||||
outputFields[i] = textFileField;
|
||||
}
|
||||
TextFileField textFileField = new TextFileField();
|
||||
textFileField.setName("dataease_uuid");
|
||||
textFileField.setType("String");
|
||||
outputFields[datasetTableFields.size()] = textFileField;
|
||||
|
||||
textFileOutputMeta.setOutputFields(outputFields);
|
||||
}else {
|
||||
textFileOutputMeta.setOutputFields(new TextFileField[0]);
|
||||
@ -891,6 +905,14 @@ public class ExtractDataService {
|
||||
|
||||
private StepMeta udjc(List<DatasetTableField> datasetTableFields, DatasourceTypes datasourceType) {
|
||||
String needToChangeColumnType = "";
|
||||
String handleBinaryTypeCode = "";
|
||||
|
||||
for (DatasetTableField datasetTableField : datasetTableFields) {
|
||||
if(datasetTableField.getDeExtractType() == 5){
|
||||
handleBinaryTypeCode = handleBinaryTypeCode + "\n" + this.handleBinaryType.replace("FEILD", datasetTableField.getDataeaseName());
|
||||
}
|
||||
}
|
||||
|
||||
UserDefinedJavaClassMeta userDefinedJavaClassMeta = new UserDefinedJavaClassMeta();
|
||||
List<UserDefinedJavaClassMeta.FieldInfo> fields = new ArrayList<>();
|
||||
UserDefinedJavaClassMeta.FieldInfo fieldInfo = new UserDefinedJavaClassMeta.FieldInfo("dataease_uuid", ValueMetaInterface.TYPE_STRING, -1, -1);
|
||||
@ -906,11 +928,15 @@ public class ExtractDataService {
|
||||
} else {
|
||||
Column_Fields = String.join(",", datasetTableFields.stream().map(DatasetTableField::getDataeaseName).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
if (datasourceType.equals(DatasourceTypes.excel)) {
|
||||
tmp_code = tmp_code.replace("handleExcelIntColumn", handleExcelIntColumn).replace("Column_Fields", Column_Fields);
|
||||
} else {
|
||||
tmp_code = tmp_code.replace("handleExcelIntColumn", "").replace("Column_Fields", Column_Fields);
|
||||
}
|
||||
|
||||
tmp_code = tmp_code.replace("handleBinaryType", handleBinaryTypeCode);
|
||||
|
||||
UserDefinedJavaClassDef userDefinedJavaClassDef = new UserDefinedJavaClassDef(UserDefinedJavaClassDef.ClassType.TRANSFORM_CLASS, "Processor", tmp_code);
|
||||
|
||||
userDefinedJavaClassDef.setActive(true);
|
||||
@ -993,6 +1019,12 @@ public class ExtractDataService {
|
||||
}
|
||||
}
|
||||
|
||||
private static String handleBinaryType = " \t\tif(\"FEILD\".equalsIgnoreCase(filed)){\n" +
|
||||
" get(Fields.Out, filed).setValue(r, \"\");\n" +
|
||||
" get(Fields.Out, filed).getValueMeta().setType(2);\n" +
|
||||
" \t}";
|
||||
|
||||
|
||||
private static String alterColumnTypeCode = " if(\"FILED\".equalsIgnoreCase(filed)){\n" +
|
||||
"\t if(tmp != null && tmp.equalsIgnoreCase(\"Y\")){\n" +
|
||||
" get(Fields.Out, filed).setValue(r, 1);\n" +
|
||||
@ -1049,6 +1081,7 @@ public class ExtractDataService {
|
||||
" String tmp = get(Fields.In, filed).getString(r);\n" +
|
||||
"handleWraps \n" +
|
||||
"alterColumnTypeCode \n" +
|
||||
"handleBinaryType \n" +
|
||||
"handleExcelIntColumn \n" +
|
||||
" str = str + tmp;\n" +
|
||||
" }\n" +
|
||||
|
@ -67,7 +67,7 @@ public class DirectFieldService implements DataSetFieldService {
|
||||
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||
if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "db")) {
|
||||
datasourceRequest.setTable(dataTableInfoDTO.getTable());
|
||||
datasourceRequest.setQuery(qp.createQuerySQL(dataTableInfoDTO.getTable(), Collections.singletonList(field), true));
|
||||
datasourceRequest.setQuery(qp.createQuerySQL(dataTableInfoDTO.getTable(), Collections.singletonList(field), true, ds));
|
||||
} else if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "sql")) {
|
||||
datasourceRequest.setQuery(qp.createQuerySQLAsTmp(dataTableInfoDTO.getSql(), Collections.singletonList(field), true));
|
||||
} else if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "custom")) {
|
||||
@ -85,7 +85,7 @@ public class DirectFieldService implements DataSetFieldService {
|
||||
tableName = "ds_" + datasetTable.getId().replaceAll("-", "_");
|
||||
datasourceRequest.setTable(tableName);
|
||||
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||
datasourceRequest.setQuery(qp.createQuerySQL(tableName, Collections.singletonList(field), true));
|
||||
datasourceRequest.setQuery(qp.createQuerySQL(tableName, Collections.singletonList(field), true, null));
|
||||
}
|
||||
|
||||
try {
|
||||
|
15
backend/src/main/resources/db/migration/V21__user_key.sql
Normal file
15
backend/src/main/resources/db/migration/V21__user_key.sql
Normal file
@ -0,0 +1,15 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for user_key
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `user_key`;
|
||||
CREATE TABLE `user_key` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
|
||||
`access_key` varchar(50) NOT NULL COMMENT 'access_key',
|
||||
`secret_key` varchar(50) NOT NULL COMMENT 'secret key',
|
||||
`create_time` bigint(13) NOT NULL COMMENT '创建时间',
|
||||
`status` varchar(10) DEFAULT NULL COMMENT '状态',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `IDX_AK` (`access_key`),
|
||||
KEY `IDX_USER_K_ID` (`user_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='用户KEY';
|
1
frontend/src/icons/svg/treemap.svg
Normal file
1
frontend/src/icons/svg/treemap.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg t="1628490858856" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2380" width="200" height="200"><path d="M64 128h512v448H64z m0 512h512v256H64z m576-192h320v448H640z m0-320h320v256H640z" p-id="2381"></path></svg>
|
After Width: | Height: | Size: 263 B |
@ -337,7 +337,8 @@ export default {
|
||||
confirm: 'Confirm',
|
||||
ok: 'Confirm',
|
||||
cancel: 'Cancel'
|
||||
}
|
||||
},
|
||||
ukey_title: 'API Keys'
|
||||
},
|
||||
documentation: {
|
||||
documentation: 'Documentation',
|
||||
@ -831,7 +832,12 @@ export default {
|
||||
axis_label_rotate: 'Label Rotate',
|
||||
chart_scatter_bubble: 'Bubble',
|
||||
chart_scatter: 'Scatter',
|
||||
bubble_size: 'Bubble Size'
|
||||
bubble_size: 'Bubble Size',
|
||||
chart_treemap: 'Tree Map',
|
||||
drill: 'Drill',
|
||||
drag_block_treemap_label: 'Color Label',
|
||||
drag_block_treemap_size: 'Color Size',
|
||||
bubble_symbol: 'Shape'
|
||||
},
|
||||
dataset: {
|
||||
sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default',
|
||||
|
@ -337,7 +337,8 @@ export default {
|
||||
confirm: '確認',
|
||||
ok: '確認',
|
||||
cancel: '取消'
|
||||
}
|
||||
},
|
||||
ukey_title: 'API Keys'
|
||||
},
|
||||
documentation: {
|
||||
documentation: '文檔',
|
||||
@ -831,7 +832,12 @@ export default {
|
||||
axis_label_rotate: '標簽角度',
|
||||
chart_scatter_bubble: '氣泡圖',
|
||||
chart_scatter: '散點圖',
|
||||
bubble_size: '氣泡大小'
|
||||
bubble_size: '氣泡大小',
|
||||
chart_treemap: '矩形樹圖',
|
||||
drill: '鉆取',
|
||||
drag_block_treemap_label: '色塊標簽',
|
||||
drag_block_treemap_size: '色塊大小',
|
||||
bubble_symbol: '圖形'
|
||||
},
|
||||
dataset: {
|
||||
sheet_warn: '有多個sheet頁面,默認抽取第一個',
|
||||
|
@ -337,7 +337,8 @@ export default {
|
||||
confirm: '确认',
|
||||
ok: '确认',
|
||||
cancel: '取消'
|
||||
}
|
||||
},
|
||||
ukey_title: 'API Keys'
|
||||
},
|
||||
documentation: {
|
||||
documentation: '文档',
|
||||
@ -831,7 +832,12 @@ export default {
|
||||
axis_label_rotate: '标签角度',
|
||||
chart_scatter_bubble: '气泡图',
|
||||
chart_scatter: '散点图',
|
||||
bubble_size: '气泡大小'
|
||||
bubble_size: '气泡大小',
|
||||
chart_treemap: '矩形树图',
|
||||
drill: '钻取',
|
||||
drag_block_treemap_label: '色块标签',
|
||||
drag_block_treemap_size: '色块大小',
|
||||
bubble_symbol: '图形'
|
||||
},
|
||||
dataset: {
|
||||
sheet_warn: '有多个 Sheet 页,默认抽取第一个',
|
||||
|
@ -53,6 +53,11 @@
|
||||
<router-link to="/person-info/index">
|
||||
<el-dropdown-item>{{ $t('commons.personal_info') }}</el-dropdown-item>
|
||||
</router-link>
|
||||
|
||||
<router-link v-if="$store.getters.validate" to="/ukey/index">
|
||||
<el-dropdown-item>{{ $t('commons.ukey_title') }}</el-dropdown-item>
|
||||
</router-link>
|
||||
|
||||
<router-link to="/person-pwd/index">
|
||||
<el-dropdown-item>{{ $t('user.change_password') }}</el-dropdown-item>
|
||||
</router-link>
|
||||
|
@ -689,3 +689,39 @@ export const BASE_SCATTER = {
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export const BASE_TREEMAP = {
|
||||
title: {
|
||||
text: '',
|
||||
textStyle: {
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
containLabel: true
|
||||
},
|
||||
tooltip: {},
|
||||
legend: {
|
||||
show: true,
|
||||
type: 'scroll',
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
icon: 'rect'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
// name: '',
|
||||
type: 'treemap',
|
||||
// radius: ['0%', '60%'],
|
||||
// avoidLabelOverlap: false,
|
||||
// emphasis: {
|
||||
// itemStyle: {
|
||||
// shadowBlur: 10,
|
||||
// shadowOffsetX: 0,
|
||||
// shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
// }
|
||||
// },
|
||||
data: []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -31,18 +31,18 @@ export function baseFunnelOption(chart_option, chart) {
|
||||
chart_option.series[0].label = customAttr.label
|
||||
}
|
||||
const valueArr = chart.data.series[0].data
|
||||
// max value
|
||||
chart_option.series[0].max = Math.max.apply(Math, valueArr)
|
||||
for (let i = 0; i < valueArr.length; i++) {
|
||||
const y = {
|
||||
name: chart.data.x[i],
|
||||
value: valueArr[i]
|
||||
}
|
||||
// const y = {
|
||||
// name: chart.data.x[i],
|
||||
// value: valueArr[i]
|
||||
// }
|
||||
const y = valueArr[i]
|
||||
y.name = chart.data.x[i]
|
||||
// color
|
||||
y.itemStyle = {
|
||||
color: hexColorToRGBA(customAttr.color.colors[i % 9], customAttr.color.alpha)
|
||||
}
|
||||
y.type = 'funnel'
|
||||
// y.type = 'funnel'
|
||||
chart_option.series[0].data.push(y)
|
||||
}
|
||||
}
|
||||
|
@ -33,10 +33,12 @@ export function basePieOption(chart_option, chart) {
|
||||
}
|
||||
const valueArr = chart.data.series[0].data
|
||||
for (let i = 0; i < valueArr.length; i++) {
|
||||
const y = {
|
||||
name: chart.data.x[i],
|
||||
value: valueArr[i]
|
||||
}
|
||||
// const y = {
|
||||
// name: chart.data.x[i],
|
||||
// value: valueArr[i]
|
||||
// }
|
||||
const y = valueArr[i]
|
||||
y.name = chart.data.x[i]
|
||||
// color
|
||||
y.itemStyle = {
|
||||
color: hexColorToRGBA(customAttr.color.colors[i % 9], customAttr.color.alpha),
|
||||
@ -84,10 +86,12 @@ export function rosePieOption(chart_option, chart) {
|
||||
}
|
||||
const valueArr = chart.data.series[0].data
|
||||
for (let i = 0; i < valueArr.length; i++) {
|
||||
const y = {
|
||||
name: chart.data.x[i],
|
||||
value: valueArr[i]
|
||||
}
|
||||
// const y = {
|
||||
// name: chart.data.x[i],
|
||||
// value: valueArr[i]
|
||||
// }
|
||||
const y = valueArr[i]
|
||||
y.name = chart.data.x[i]
|
||||
// color
|
||||
y.itemStyle = {
|
||||
color: hexColorToRGBA(customAttr.color.colors[i % 9], customAttr.color.alpha),
|
||||
|
53
frontend/src/views/chart/chart/treemap/treemap.js
Normal file
53
frontend/src/views/chart/chart/treemap/treemap.js
Normal file
@ -0,0 +1,53 @@
|
||||
import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
import { componentStyle } from '../common/common'
|
||||
|
||||
export function baseTreemapOption(chart_option, chart) {
|
||||
// 处理shape attr
|
||||
let customAttr = {}
|
||||
if (chart.customAttr) {
|
||||
customAttr = JSON.parse(chart.customAttr)
|
||||
if (customAttr.color) {
|
||||
chart_option.color = customAttr.color.colors
|
||||
}
|
||||
// tooltip
|
||||
if (customAttr.tooltip) {
|
||||
const tooltip = JSON.parse(JSON.stringify(customAttr.tooltip))
|
||||
const reg = new RegExp('\n', 'g')
|
||||
tooltip.formatter = tooltip.formatter.replace(reg, '<br/>')
|
||||
chart_option.tooltip = tooltip
|
||||
}
|
||||
}
|
||||
// 处理data
|
||||
if (chart.data) {
|
||||
chart_option.title.text = chart.title
|
||||
if (chart.data.series.length > 0) {
|
||||
// chart_option.series[0].name = chart.data.series[0].name
|
||||
// size
|
||||
if (customAttr.size) {
|
||||
// chart_option.series[0].radius = [customAttr.size.pieInnerRadius + '%', customAttr.size.pieOuterRadius + '%']
|
||||
}
|
||||
// label
|
||||
if (customAttr.label) {
|
||||
// chart_option.series[0].label = customAttr.label
|
||||
}
|
||||
const valueArr = chart.data.series[0].data
|
||||
for (let i = 0; i < valueArr.length; i++) {
|
||||
// const y = {
|
||||
// name: chart.data.x[i],
|
||||
// value: valueArr[i]
|
||||
// }
|
||||
const y = valueArr[i]
|
||||
y.name = chart.data.x[i]
|
||||
// color
|
||||
y.itemStyle = {
|
||||
color: hexColorToRGBA(customAttr.color.colors[i % 9], customAttr.color.alpha)
|
||||
}
|
||||
// y.type = 'treemap'
|
||||
chart_option.series[0].data.push(y)
|
||||
}
|
||||
}
|
||||
}
|
||||
// console.log(chart_option);
|
||||
componentStyle(chart_option, chart)
|
||||
return chart_option
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { BASE_BAR, BASE_LINE, HORIZONTAL_BAR, BASE_PIE, BASE_FUNNEL, BASE_RADAR, BASE_GAUGE, BASE_MAP, BASE_SCATTER } from '../chart/chart'
|
||||
import { BASE_BAR, BASE_LINE, HORIZONTAL_BAR, BASE_PIE, BASE_FUNNEL, BASE_RADAR, BASE_GAUGE, BASE_MAP, BASE_SCATTER, BASE_TREEMAP } from '../chart/chart'
|
||||
import { baseBarOption, stackBarOption, horizontalBarOption, horizontalStackBarOption } from '../chart/bar/bar'
|
||||
import { baseLineOption, stackLineOption } from '../chart/line/line'
|
||||
import { basePieOption, rosePieOption } from '../chart/pie/pie'
|
||||
@ -14,6 +14,7 @@ import { baseFunnelOption } from '../chart/funnel/funnel'
|
||||
import { baseRadarOption } from '../chart/radar/radar'
|
||||
import { baseGaugeOption } from '../chart/gauge/gauge'
|
||||
import { baseScatterOption } from '../chart/scatter/scatter'
|
||||
import { baseTreemapOption } from '../chart/treemap/treemap'
|
||||
// import eventBus from '@/components/canvas/utils/eventBus'
|
||||
import { uuid } from 'vue-uuid'
|
||||
import { geoJson } from '@/api/map/map'
|
||||
@ -98,6 +99,8 @@ export default {
|
||||
chart_option = baseGaugeOption(JSON.parse(JSON.stringify(BASE_GAUGE)), chart)
|
||||
} else if (chart.type === 'scatter') {
|
||||
chart_option = baseScatterOption(JSON.parse(JSON.stringify(BASE_SCATTER)), chart)
|
||||
} else if (chart.type === 'treemap') {
|
||||
chart_option = baseTreemapOption(JSON.parse(JSON.stringify(BASE_TREEMAP)), chart)
|
||||
}
|
||||
|
||||
if (chart.type === 'map') {
|
||||
|
@ -137,7 +137,7 @@
|
||||
</el-form>
|
||||
|
||||
<el-form v-show="chart.type && chart.type.includes('scatter')" ref="sizeFormLine" :disabled="param && !hasDataPermission('manage',param.privileges)" :model="sizeForm" label-width="80px" size="mini">
|
||||
<el-form-item :label="$t('chart.line_symbol')" class="form-item">
|
||||
<el-form-item :label="$t('chart.bubble_symbol')" class="form-item">
|
||||
<el-select v-model="sizeForm.scatterSymbol" :placeholder="$t('chart.line_symbol')" @change="changeBarSizeCase">
|
||||
<el-option
|
||||
v-for="item in lineSymbolOptions"
|
||||
@ -147,8 +147,8 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('chart.line_symbol_size')" class="form-item form-item-slider">
|
||||
<el-slider v-model="sizeForm.scatterSymbolSize" show-input :show-input-controls="false" input-size="mini" :min="0" :max="20" @change="changeBarSizeCase" />
|
||||
<el-form-item :label="$t('chart.bubble_size')" class="form-item form-item-slider">
|
||||
<el-slider v-model="sizeForm.scatterSymbolSize" show-input :show-input-controls="false" input-size="mini" :min="1" :max="20" @change="changeBarSizeCase" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
|
@ -163,23 +163,18 @@
|
||||
<svg-icon icon-class="line-stack" class="chart-icon" />
|
||||
</span>
|
||||
</el-radio>
|
||||
<el-radio value="pie" label="pie">
|
||||
<span :title="$t('chart.chart_pie')">
|
||||
<svg-icon icon-class="pie" class="chart-icon" />
|
||||
<el-radio value="scatter" label="scatter">
|
||||
<span :title="$t('chart.chart_scatter')">
|
||||
<svg-icon icon-class="scatter" class="chart-icon" />
|
||||
</span>
|
||||
</el-radio>
|
||||
<el-radio value="pie-rose" label="pie-rose">
|
||||
<span :title="$t('chart.chart_pie_rose')">
|
||||
<svg-icon icon-class="pie-rose" class="chart-icon" />
|
||||
<el-radio value="map" label="map">
|
||||
<span :title="$t('chart.chart_map')">
|
||||
<svg-icon icon-class="map" class="chart-icon" />
|
||||
</span>
|
||||
</el-radio>
|
||||
</div>
|
||||
<div style="width: 100%;display: flex;display: -webkit-flex;justify-content: space-between;flex-direction: row;flex-wrap: wrap;">
|
||||
<el-radio value="funnel" label="funnel">
|
||||
<span :title="$t('chart.chart_funnel')">
|
||||
<svg-icon icon-class="funnel" class="chart-icon" />
|
||||
</span>
|
||||
</el-radio>
|
||||
<el-radio value="radar" label="radar">
|
||||
<span :title="$t('chart.chart_radar')">
|
||||
<svg-icon icon-class="radar" class="chart-icon" />
|
||||
@ -190,19 +185,28 @@
|
||||
<svg-icon icon-class="gauge" class="chart-icon" />
|
||||
</span>
|
||||
</el-radio>
|
||||
<el-radio value="map" label="map">
|
||||
<span :title="$t('chart.chart_map')">
|
||||
<svg-icon icon-class="map" class="chart-icon" />
|
||||
<el-radio value="pie" label="pie">
|
||||
<span :title="$t('chart.chart_pie')">
|
||||
<svg-icon icon-class="pie" class="chart-icon" />
|
||||
</span>
|
||||
</el-radio>
|
||||
<el-radio value="scatter" label="scatter">
|
||||
<span :title="$t('chart.chart_scatter')">
|
||||
<svg-icon icon-class="scatter" class="chart-icon" />
|
||||
<el-radio value="pie-rose" label="pie-rose">
|
||||
<span :title="$t('chart.chart_pie_rose')">
|
||||
<svg-icon icon-class="pie-rose" class="chart-icon" />
|
||||
</span>
|
||||
</el-radio>
|
||||
<el-radio value="funnel" label="funnel">
|
||||
<span :title="$t('chart.chart_funnel')">
|
||||
<svg-icon icon-class="funnel" class="chart-icon" />
|
||||
</span>
|
||||
</el-radio>
|
||||
</div>
|
||||
<div style="width: 100%;display: flex;display: -webkit-flex;justify-content: space-between;flex-direction: row;flex-wrap: wrap;">
|
||||
<el-radio value="" label="" disabled class="disabled-none-cursor"><svg-icon icon-class="" class="chart-icon" /></el-radio>
|
||||
<el-radio value="treemap" label="treemap">
|
||||
<span :title="$t('chart.chart_treemap')">
|
||||
<svg-icon icon-class="treemap" class="chart-icon" />
|
||||
</span>
|
||||
</el-radio>
|
||||
<el-radio value="" label="" disabled class="disabled-none-cursor"><svg-icon icon-class="" class="chart-icon" /></el-radio>
|
||||
<el-radio value="" label="" disabled class="disabled-none-cursor"><svg-icon icon-class="" class="chart-icon" /></el-radio>
|
||||
<el-radio value="" label="" disabled class="disabled-none-cursor"><svg-icon icon-class="" class="chart-icon" /></el-radio>
|
||||
@ -213,7 +217,7 @@
|
||||
</el-row>
|
||||
<el-row style="color: #909399;">
|
||||
<span>
|
||||
<span v-show="chart.type && (chart.type.includes('pie') || chart.type.includes('funnel') || chart.type.includes('text') || chart.type.includes('gauge'))">
|
||||
<span v-show="chart.type && (chart.type.includes('pie') || chart.type.includes('funnel') || chart.type.includes('text') || chart.type.includes('gauge') || chart.type.includes('treemap'))">
|
||||
Tips: {{ $t('chart.only_one_quota') }}
|
||||
</span>
|
||||
<!-- <span v-show="chart.type && (chart.type.includes('text'))">-->
|
||||
@ -245,7 +249,7 @@
|
||||
</el-row>
|
||||
<el-row class="padding-lr">
|
||||
<span style="width: 80px;text-align: right;">
|
||||
<span>钻取</span>
|
||||
<span>{{ $t('chart.drill') }}</span>
|
||||
/
|
||||
<span>{{ $t('chart.dimension') }}</span>
|
||||
</span>
|
||||
@ -274,7 +278,8 @@
|
||||
<span v-else-if="view.type && view.type.includes('pie')">{{ $t('chart.drag_block_pie_label') }}</span>
|
||||
<span v-else-if="view.type && view.type.includes('funnel')">{{ $t('chart.drag_block_funnel_split') }}</span>
|
||||
<span v-else-if="view.type && view.type.includes('radar')">{{ $t('chart.drag_block_radar_label') }}</span>
|
||||
<span v-else-if="view.type && view.type.includes('map')">{{ $t('chart.area') }}</span>
|
||||
<span v-else-if="view.type && view.type === 'map'">{{ $t('chart.area') }}</span>
|
||||
<span v-else-if="view.type && view.type.includes('treemap')">{{ $t('chart.drag_block_treemap_label') }}</span>
|
||||
/
|
||||
<span>{{ $t('chart.dimension') }}</span>
|
||||
</span>
|
||||
@ -305,7 +310,8 @@
|
||||
<span v-else-if="view.type && view.type.includes('radar')">{{ $t('chart.drag_block_radar_length') }}</span>
|
||||
<span v-else-if="view.type && view.type.includes('gauge')">{{ $t('chart.drag_block_gauge_angel') }}</span>
|
||||
<span v-else-if="view.type && view.type.includes('text')">{{ $t('chart.drag_block_label_value') }}</span>
|
||||
<span v-else-if="view.type && view.type.includes('map')">{{ $t('chart.chart_data') }}</span>
|
||||
<span v-else-if="view.type && view.type === 'map'">{{ $t('chart.chart_data') }}</span>
|
||||
<span v-else-if="view.type && view.type.includes('tree')">{{ $t('chart.drag_block_treemap_size') }}</span>
|
||||
/
|
||||
<span>{{ $t('chart.quota') }}</span>
|
||||
</span>
|
||||
@ -421,10 +427,10 @@
|
||||
<el-collapse-item name="color" :title="$t('chart.color')">
|
||||
<color-selector :param="param" class="attr-selector" :chart="chart" @onColorChange="onColorChange" />
|
||||
</el-collapse-item>
|
||||
<el-collapse-item v-show="chart.type !== 'map'" name="size" :title="$t('chart.size')">
|
||||
<el-collapse-item v-show="chart.type !== 'map' && chart.type !== 'treemap'" name="size" :title="$t('chart.size')">
|
||||
<size-selector :param="param" class="attr-selector" :chart="chart" @onSizeChange="onSizeChange" />
|
||||
</el-collapse-item>
|
||||
<el-collapse-item v-show="!view.type.includes('table') && !view.type.includes('text')" name="label" :title="$t('chart.label')">
|
||||
<el-collapse-item v-show="!view.type.includes('table') && !view.type.includes('text') && view.type !== 'treemap'" name="label" :title="$t('chart.label')">
|
||||
<label-selector :param="param" class="attr-selector" :chart="chart" @onLabelChange="onLabelChange" />
|
||||
</el-collapse-item>
|
||||
<el-collapse-item v-show="!view.type.includes('table') && !view.type.includes('text')" name="tooltip" :title="$t('chart.tooltip')">
|
||||
@ -453,7 +459,7 @@
|
||||
<el-collapse-item name="title" :title="$t('chart.title')">
|
||||
<title-selector :param="param" class="attr-selector" :chart="chart" @onTextChange="onTextChange" />
|
||||
</el-collapse-item>
|
||||
<el-collapse-item v-show="view.type && !view.type.includes('map') && !view.type.includes('table') && !view.type.includes('text')" name="legend" :title="$t('chart.legend')">
|
||||
<el-collapse-item v-show="view.type && view.type !== 'map' && !view.type.includes('table') && !view.type.includes('text') && chart.type !== 'treemap'" name="legend" :title="$t('chart.legend')">
|
||||
<legend-selector :param="param" class="attr-selector" :chart="chart" @onLegendChange="onLegendChange" />
|
||||
</el-collapse-item>
|
||||
<el-collapse-item name="background" :title="$t('chart.background')">
|
||||
@ -853,7 +859,11 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
if (view.type.startsWith('pie') || view.type.startsWith('funnel') || view.type.startsWith('text') || view.type.startsWith('gauge')) {
|
||||
if (view.type.startsWith('pie') ||
|
||||
view.type.startsWith('funnel') ||
|
||||
view.type.startsWith('text') ||
|
||||
view.type.startsWith('gauge') ||
|
||||
view.type === 'treemap') {
|
||||
if (view.yaxis.length > 1) {
|
||||
view.yaxis.splice(1, view.yaxis.length)
|
||||
}
|
||||
@ -864,6 +874,9 @@ export default {
|
||||
if (view.type === 'line-stack' && trigger === 'chart') {
|
||||
view.customAttr.size.lineArea = true
|
||||
}
|
||||
if (view.type === 'treemap' && trigger === 'chart') {
|
||||
view.customAttr.label.show = true
|
||||
}
|
||||
view.customFilter.forEach(function(ele) {
|
||||
if (ele && !ele.filter) {
|
||||
ele.filter = []
|
||||
|
@ -63,6 +63,23 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item v-if="form.type=='sqlServer'">
|
||||
<el-button icon="el-icon-plus" size="mini" @click="getSchema()">
|
||||
{{ $t('datasource.get_schema') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type=='sqlServer'" :label="$t('datasource.schema')">
|
||||
<el-select filterable v-model="form.configuration.schema" :placeholder="$t('datasource.please_choose_schema')" class="select-width">
|
||||
<el-option
|
||||
v-for="item in schemas"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div v-if="canEdit" slot="footer" class="dialog-footer">
|
||||
<el-button v-if="formType==='add'?true: hasDataPermission('manage',params.privileges)" @click="validaDatasource">{{ $t('commons.validate') }}</el-button>
|
||||
@ -105,7 +122,9 @@ export default {
|
||||
'configuration.host': [{ required: true, message: this.$t('datasource.please_input_host'), trigger: 'change' }],
|
||||
'configuration.port': [{ required: true, message: this.$t('datasource.please_input_port'), trigger: 'change' }]
|
||||
},
|
||||
allTypes: [{ name: 'mysql', label: 'MySQL', type: 'jdbc' }, { name: 'oracle', label: 'Oracle', type: 'jdbc' }],
|
||||
allTypes: [{ name: 'mysql', label: 'MySQL', type: 'jdbc' },
|
||||
{ name: 'oracle', label: 'Oracle', type: 'jdbc' },
|
||||
{ name: 'sqlServer', label: 'SQLSERVER', type: 'jdbc' }],
|
||||
schemas: [],
|
||||
canEdit: false,
|
||||
originConfiguration: {}
|
||||
|
Loading…
Reference in New Issue
Block a user