forked from github/dataease
feat: 将所有仪表板板视图都归属仪表板
This commit is contained in:
parent
b6cc7fca7d
commit
b29c00627d
@ -0,0 +1,18 @@
|
|||||||
|
package io.dataease.base.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DataeaseCodeVersion implements Serializable {
|
||||||
|
private Integer installedRank;
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private Date installedOn;
|
||||||
|
|
||||||
|
private Boolean success;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -0,0 +1,451 @@
|
|||||||
|
package io.dataease.base.domain;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DataeaseCodeVersionExample {
|
||||||
|
protected String orderByClause;
|
||||||
|
|
||||||
|
protected boolean distinct;
|
||||||
|
|
||||||
|
protected List<Criteria> oredCriteria;
|
||||||
|
|
||||||
|
public DataeaseCodeVersionExample() {
|
||||||
|
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 andInstalledRankIsNull() {
|
||||||
|
addCriterion("installed_rank is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledRankIsNotNull() {
|
||||||
|
addCriterion("installed_rank is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledRankEqualTo(Integer value) {
|
||||||
|
addCriterion("installed_rank =", value, "installedRank");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledRankNotEqualTo(Integer value) {
|
||||||
|
addCriterion("installed_rank <>", value, "installedRank");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledRankGreaterThan(Integer value) {
|
||||||
|
addCriterion("installed_rank >", value, "installedRank");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledRankGreaterThanOrEqualTo(Integer value) {
|
||||||
|
addCriterion("installed_rank >=", value, "installedRank");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledRankLessThan(Integer value) {
|
||||||
|
addCriterion("installed_rank <", value, "installedRank");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledRankLessThanOrEqualTo(Integer value) {
|
||||||
|
addCriterion("installed_rank <=", value, "installedRank");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledRankIn(List<Integer> values) {
|
||||||
|
addCriterion("installed_rank in", values, "installedRank");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledRankNotIn(List<Integer> values) {
|
||||||
|
addCriterion("installed_rank not in", values, "installedRank");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledRankBetween(Integer value1, Integer value2) {
|
||||||
|
addCriterion("installed_rank between", value1, value2, "installedRank");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledRankNotBetween(Integer value1, Integer value2) {
|
||||||
|
addCriterion("installed_rank not between", value1, value2, "installedRank");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDescriptionIsNull() {
|
||||||
|
addCriterion("description is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDescriptionIsNotNull() {
|
||||||
|
addCriterion("description is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDescriptionEqualTo(String value) {
|
||||||
|
addCriterion("description =", value, "description");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDescriptionNotEqualTo(String value) {
|
||||||
|
addCriterion("description <>", value, "description");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDescriptionGreaterThan(String value) {
|
||||||
|
addCriterion("description >", value, "description");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
|
||||||
|
addCriterion("description >=", value, "description");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDescriptionLessThan(String value) {
|
||||||
|
addCriterion("description <", value, "description");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDescriptionLessThanOrEqualTo(String value) {
|
||||||
|
addCriterion("description <=", value, "description");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDescriptionLike(String value) {
|
||||||
|
addCriterion("description like", value, "description");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDescriptionNotLike(String value) {
|
||||||
|
addCriterion("description not like", value, "description");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDescriptionIn(List<String> values) {
|
||||||
|
addCriterion("description in", values, "description");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDescriptionNotIn(List<String> values) {
|
||||||
|
addCriterion("description not in", values, "description");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDescriptionBetween(String value1, String value2) {
|
||||||
|
addCriterion("description between", value1, value2, "description");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDescriptionNotBetween(String value1, String value2) {
|
||||||
|
addCriterion("description not between", value1, value2, "description");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledOnIsNull() {
|
||||||
|
addCriterion("installed_on is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledOnIsNotNull() {
|
||||||
|
addCriterion("installed_on is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledOnEqualTo(Date value) {
|
||||||
|
addCriterion("installed_on =", value, "installedOn");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledOnNotEqualTo(Date value) {
|
||||||
|
addCriterion("installed_on <>", value, "installedOn");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledOnGreaterThan(Date value) {
|
||||||
|
addCriterion("installed_on >", value, "installedOn");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledOnGreaterThanOrEqualTo(Date value) {
|
||||||
|
addCriterion("installed_on >=", value, "installedOn");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledOnLessThan(Date value) {
|
||||||
|
addCriterion("installed_on <", value, "installedOn");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledOnLessThanOrEqualTo(Date value) {
|
||||||
|
addCriterion("installed_on <=", value, "installedOn");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledOnIn(List<Date> values) {
|
||||||
|
addCriterion("installed_on in", values, "installedOn");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledOnNotIn(List<Date> values) {
|
||||||
|
addCriterion("installed_on not in", values, "installedOn");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledOnBetween(Date value1, Date value2) {
|
||||||
|
addCriterion("installed_on between", value1, value2, "installedOn");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andInstalledOnNotBetween(Date value1, Date value2) {
|
||||||
|
addCriterion("installed_on not between", value1, value2, "installedOn");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSuccessIsNull() {
|
||||||
|
addCriterion("success is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSuccessIsNotNull() {
|
||||||
|
addCriterion("success is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSuccessEqualTo(Boolean value) {
|
||||||
|
addCriterion("success =", value, "success");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSuccessNotEqualTo(Boolean value) {
|
||||||
|
addCriterion("success <>", value, "success");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSuccessGreaterThan(Boolean value) {
|
||||||
|
addCriterion("success >", value, "success");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSuccessGreaterThanOrEqualTo(Boolean value) {
|
||||||
|
addCriterion("success >=", value, "success");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSuccessLessThan(Boolean value) {
|
||||||
|
addCriterion("success <", value, "success");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSuccessLessThanOrEqualTo(Boolean value) {
|
||||||
|
addCriterion("success <=", value, "success");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSuccessIn(List<Boolean> values) {
|
||||||
|
addCriterion("success in", values, "success");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSuccessNotIn(List<Boolean> values) {
|
||||||
|
addCriterion("success not in", values, "success");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSuccessBetween(Boolean value1, Boolean value2) {
|
||||||
|
addCriterion("success between", value1, value2, "success");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andSuccessNotBetween(Boolean value1, Boolean value2) {
|
||||||
|
addCriterion("success not between", value1, value2, "success");
|
||||||
|
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.DataeaseCodeVersion;
|
||||||
|
import io.dataease.base.domain.DataeaseCodeVersionExample;
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
public interface DataeaseCodeVersionMapper {
|
||||||
|
long countByExample(DataeaseCodeVersionExample example);
|
||||||
|
|
||||||
|
int deleteByExample(DataeaseCodeVersionExample example);
|
||||||
|
|
||||||
|
int deleteByPrimaryKey(Integer installedRank);
|
||||||
|
|
||||||
|
int insert(DataeaseCodeVersion record);
|
||||||
|
|
||||||
|
int insertSelective(DataeaseCodeVersion record);
|
||||||
|
|
||||||
|
List<DataeaseCodeVersion> selectByExample(DataeaseCodeVersionExample example);
|
||||||
|
|
||||||
|
DataeaseCodeVersion selectByPrimaryKey(Integer installedRank);
|
||||||
|
|
||||||
|
int updateByExampleSelective(@Param("record") DataeaseCodeVersion record, @Param("example") DataeaseCodeVersionExample example);
|
||||||
|
|
||||||
|
int updateByExample(@Param("record") DataeaseCodeVersion record, @Param("example") DataeaseCodeVersionExample example);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(DataeaseCodeVersion record);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(DataeaseCodeVersion record);
|
||||||
|
}
|
@ -0,0 +1,196 @@
|
|||||||
|
<?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.DataeaseCodeVersionMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="io.dataease.base.domain.DataeaseCodeVersion">
|
||||||
|
<id column="installed_rank" jdbcType="INTEGER" property="installedRank" />
|
||||||
|
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||||
|
<result column="installed_on" jdbcType="TIMESTAMP" property="installedOn" />
|
||||||
|
<result column="success" jdbcType="BIT" property="success" />
|
||||||
|
</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">
|
||||||
|
installed_rank, description, installed_on, success
|
||||||
|
</sql>
|
||||||
|
<select id="selectByExample" parameterType="io.dataease.base.domain.DataeaseCodeVersionExample" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<if test="distinct">
|
||||||
|
distinct
|
||||||
|
</if>
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from dataease_code_version
|
||||||
|
<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.Integer" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from dataease_code_version
|
||||||
|
where installed_rank = #{installedRank,jdbcType=INTEGER}
|
||||||
|
</select>
|
||||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||||
|
delete from dataease_code_version
|
||||||
|
where installed_rank = #{installedRank,jdbcType=INTEGER}
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteByExample" parameterType="io.dataease.base.domain.DataeaseCodeVersionExample">
|
||||||
|
delete from dataease_code_version
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</delete>
|
||||||
|
<insert id="insert" parameterType="io.dataease.base.domain.DataeaseCodeVersion">
|
||||||
|
insert into dataease_code_version (installed_rank, description, installed_on,
|
||||||
|
success)
|
||||||
|
values (#{installedRank,jdbcType=INTEGER}, #{description,jdbcType=VARCHAR}, #{installedOn,jdbcType=TIMESTAMP},
|
||||||
|
#{success,jdbcType=BIT})
|
||||||
|
</insert>
|
||||||
|
<insert id="insertSelective" parameterType="io.dataease.base.domain.DataeaseCodeVersion">
|
||||||
|
insert into dataease_code_version
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="installedRank != null">
|
||||||
|
installed_rank,
|
||||||
|
</if>
|
||||||
|
<if test="description != null">
|
||||||
|
description,
|
||||||
|
</if>
|
||||||
|
<if test="installedOn != null">
|
||||||
|
installed_on,
|
||||||
|
</if>
|
||||||
|
<if test="success != null">
|
||||||
|
success,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="installedRank != null">
|
||||||
|
#{installedRank,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="description != null">
|
||||||
|
#{description,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="installedOn != null">
|
||||||
|
#{installedOn,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="success != null">
|
||||||
|
#{success,jdbcType=BIT},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<select id="countByExample" parameterType="io.dataease.base.domain.DataeaseCodeVersionExample" resultType="java.lang.Long">
|
||||||
|
select count(*) from dataease_code_version
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<update id="updateByExampleSelective" parameterType="map">
|
||||||
|
update dataease_code_version
|
||||||
|
<set>
|
||||||
|
<if test="record.installedRank != null">
|
||||||
|
installed_rank = #{record.installedRank,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.description != null">
|
||||||
|
description = #{record.description,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.installedOn != null">
|
||||||
|
installed_on = #{record.installedOn,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="record.success != null">
|
||||||
|
success = #{record.success,jdbcType=BIT},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByExample" parameterType="map">
|
||||||
|
update dataease_code_version
|
||||||
|
set installed_rank = #{record.installedRank,jdbcType=INTEGER},
|
||||||
|
description = #{record.description,jdbcType=VARCHAR},
|
||||||
|
installed_on = #{record.installedOn,jdbcType=TIMESTAMP},
|
||||||
|
success = #{record.success,jdbcType=BIT}
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.DataeaseCodeVersion">
|
||||||
|
update dataease_code_version
|
||||||
|
<set>
|
||||||
|
<if test="description != null">
|
||||||
|
description = #{description,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="installedOn != null">
|
||||||
|
installed_on = #{installedOn,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="success != null">
|
||||||
|
success = #{success,jdbcType=BIT},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where installed_rank = #{installedRank,jdbcType=INTEGER}
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.DataeaseCodeVersion">
|
||||||
|
update dataease_code_version
|
||||||
|
set description = #{description,jdbcType=VARCHAR},
|
||||||
|
installed_on = #{installedOn,jdbcType=TIMESTAMP},
|
||||||
|
success = #{success,jdbcType=BIT}
|
||||||
|
where installed_rank = #{installedRank,jdbcType=INTEGER}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
@ -0,0 +1,10 @@
|
|||||||
|
package io.dataease.base.mapper.ext;
|
||||||
|
|
||||||
|
public interface DEVersionMapper {
|
||||||
|
|
||||||
|
Integer lastSuccessDataEaseVersion();
|
||||||
|
|
||||||
|
Integer lastDataEaseCodeVersion();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
<?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.ext.DEVersionMapper">
|
||||||
|
|
||||||
|
<select id="lastSuccessDataEaseVersion" resultType="Integer">
|
||||||
|
select installed_rank from dataease_version where success = 1 order by installed_rank desc limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="lastDataEaseCodeVersion" resultType="Integer">
|
||||||
|
select installed_rank from dataease_code_version order by installed_rank desc limit 1
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -22,4 +22,6 @@ public interface ExtPanelGroupMapper {
|
|||||||
//移除未使用的视图
|
//移除未使用的视图
|
||||||
void removeUselessViews(@Param("panelId") String panelId);
|
void removeUselessViews(@Param("panelId") String panelId);
|
||||||
|
|
||||||
|
List<PanelGroupDTO> panelGroupInit();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,10 @@
|
|||||||
select panel_group.*,panel_group.name as label from panel_group where id =#{id}
|
select panel_group.*,panel_group.name as label from panel_group where id =#{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="panelGroupInit" resultMap="BaseResultMapDTO">
|
||||||
|
select id, name,panel_data from panel_group where node_type = 'panel' and panel_type ='self'
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="panelGroupListDefault" resultMap="BaseResultMapDTO">
|
<select id="panelGroupListDefault" resultMap="BaseResultMapDTO">
|
||||||
SELECT
|
SELECT
|
||||||
panel_group.id,
|
panel_group.id,
|
||||||
|
@ -21,4 +21,5 @@ public interface ExtPanelViewMapper {
|
|||||||
void savePanelView(@Param("panelViews") List<PanelViewInsertDTO> panelViews);
|
void savePanelView(@Param("panelViews") List<PanelViewInsertDTO> panelViews);
|
||||||
|
|
||||||
void copyFromPanel(@Param("newPanelId") String newPanelId,@Param("sourcePanelId") String sourcePanelId,@Param("copyId") String copyId);
|
void copyFromPanel(@Param("newPanelId") String newPanelId,@Param("sourcePanelId") String sourcePanelId,@Param("copyId") String copyId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,6 @@
|
|||||||
chart_view
|
chart_view
|
||||||
LEFT JOIN panel_view ON panel_view.chart_view_id = chart_view.id
|
LEFT JOIN panel_view ON panel_view.chart_view_id = chart_view.id
|
||||||
<where>
|
<where>
|
||||||
chart_view.chart_type ='public'
|
|
||||||
<if test="record.pids != null and record.pids.size() > 0">
|
<if test="record.pids != null and record.pids.size() > 0">
|
||||||
and panel_view.panel_id in
|
and panel_view.panel_id in
|
||||||
<foreach collection="record.pids" item="item" separator="," open="(" close=")">
|
<foreach collection="record.pids" item="item" separator="," open="(" close=")">
|
||||||
|
@ -0,0 +1,56 @@
|
|||||||
|
package io.dataease.listener;
|
||||||
|
|
||||||
|
import io.dataease.base.domain.DataeaseCodeVersion;
|
||||||
|
import io.dataease.base.mapper.DataeaseCodeVersionMapper;
|
||||||
|
import io.dataease.base.mapper.ext.DEVersionMapper;
|
||||||
|
import io.dataease.plugins.loader.ClassloaderResponsity;
|
||||||
|
import io.dataease.service.panel.PanelGroupService;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||||
|
import org.springframework.context.ApplicationListener;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class SystemInitListener implements ApplicationListener<ApplicationReadyEvent> {
|
||||||
|
private final Logger logger = LoggerFactory.getLogger(ClassloaderResponsity.class);
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DEVersionMapper versionMapper;
|
||||||
|
@Resource
|
||||||
|
private PanelGroupService panelGroupService;
|
||||||
|
@Resource
|
||||||
|
private DataeaseCodeVersionMapper codeVersionMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
|
||||||
|
System.out.println("=====initSystem from code [Start]=====");
|
||||||
|
logger.info("=====initSystem from code [Start]=====");
|
||||||
|
Integer dataeseVersion = versionMapper.lastSuccessDataEaseVersion();
|
||||||
|
Integer dataeseCodeVersion = versionMapper.lastDataEaseCodeVersion();
|
||||||
|
|
||||||
|
// v1.8 初始化程序 1 是1.8 初始化程序的执行记录 32 是1.8版本flayway的执行记录
|
||||||
|
if(dataeseCodeVersion<1 && dataeseVersion>=32){
|
||||||
|
DataeaseCodeVersion codeVersion = new DataeaseCodeVersion();
|
||||||
|
codeVersion.setDescription("v1.8 初始化");
|
||||||
|
codeVersion.setInstalledOn(new Date());
|
||||||
|
codeVersion.setInstalledRank(1);
|
||||||
|
try{
|
||||||
|
panelGroupService.sysInit1HistoryPanel();
|
||||||
|
codeVersion.setSuccess(true);
|
||||||
|
}catch (Exception e){
|
||||||
|
codeVersion.setSuccess(false);
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error("===>1.8程序初始化失败:",e);
|
||||||
|
}
|
||||||
|
codeVersionMapper.insert(codeVersion);
|
||||||
|
}
|
||||||
|
logger.info("=====initSystem from code [End]=====");
|
||||||
|
System.out.println("=====initSystem from code [End]=====");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -10,6 +10,7 @@ import io.dataease.base.mapper.ext.*;
|
|||||||
import io.dataease.commons.constants.DePermissionType;
|
import io.dataease.commons.constants.DePermissionType;
|
||||||
import io.dataease.commons.constants.PanelConstants;
|
import io.dataease.commons.constants.PanelConstants;
|
||||||
import io.dataease.commons.utils.AuthUtils;
|
import io.dataease.commons.utils.AuthUtils;
|
||||||
|
import io.dataease.commons.utils.LogUtil;
|
||||||
import io.dataease.commons.utils.TreeUtils;
|
import io.dataease.commons.utils.TreeUtils;
|
||||||
import io.dataease.controller.request.authModel.VAuthModelRequest;
|
import io.dataease.controller.request.authModel.VAuthModelRequest;
|
||||||
import io.dataease.controller.request.panel.PanelGroupRequest;
|
import io.dataease.controller.request.panel.PanelGroupRequest;
|
||||||
@ -107,7 +108,7 @@ public class PanelGroupService {
|
|||||||
String panelId = request.getId();
|
String panelId = request.getId();
|
||||||
if (StringUtils.isEmpty(panelId)) {
|
if (StringUtils.isEmpty(panelId)) {
|
||||||
// 新建
|
// 新建
|
||||||
checkPanelName(request.getName(), request.getPid(), PanelConstants.OPT_TYPE_INSERT, null,request.getNodeType());
|
checkPanelName(request.getName(), request.getPid(), PanelConstants.OPT_TYPE_INSERT, null, request.getNodeType());
|
||||||
panelId = UUID.randomUUID().toString();
|
panelId = UUID.randomUUID().toString();
|
||||||
request.setId(panelId);
|
request.setId(panelId);
|
||||||
request.setCreateTime(System.currentTimeMillis());
|
request.setCreateTime(System.currentTimeMillis());
|
||||||
@ -125,11 +126,11 @@ public class PanelGroupService {
|
|||||||
newDefaultPanel.setLevel(0);
|
newDefaultPanel.setLevel(0);
|
||||||
newDefaultPanel.setSource(request.getId());
|
newDefaultPanel.setSource(request.getId());
|
||||||
newDefaultPanel.setCreateBy(AuthUtils.getUser().getUsername());
|
newDefaultPanel.setCreateBy(AuthUtils.getUser().getUsername());
|
||||||
checkPanelName(newDefaultPanel.getName(), newDefaultPanel.getPid(), PanelConstants.OPT_TYPE_INSERT, newDefaultPanel.getId(),newDefaultPanel.getNodeType());
|
checkPanelName(newDefaultPanel.getName(), newDefaultPanel.getPid(), PanelConstants.OPT_TYPE_INSERT, newDefaultPanel.getId(), newDefaultPanel.getNodeType());
|
||||||
panelGroupMapper.insertSelective(newDefaultPanel);
|
panelGroupMapper.insertSelective(newDefaultPanel);
|
||||||
} else if ("copy".equals(request.getOptType())) {
|
} else if ("copy".equals(request.getOptType())) {
|
||||||
try {
|
try {
|
||||||
this.panelGroupCopy(request);
|
this.panelGroupCopy(request, null, true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
LOGGER.error("更新panelView出错panelId:{}", request.getId());
|
LOGGER.error("更新panelView出错panelId:{}", request.getId());
|
||||||
@ -141,7 +142,7 @@ public class PanelGroupService {
|
|||||||
}
|
}
|
||||||
// 移动校验
|
// 移动校验
|
||||||
if (StringUtils.isNotEmpty(request.getName())) {
|
if (StringUtils.isNotEmpty(request.getName())) {
|
||||||
checkPanelName(request.getName(), request.getPid(), PanelConstants.OPT_TYPE_INSERT, request.getId(),panelInfo.getNodeType());
|
checkPanelName(request.getName(), request.getPid(), PanelConstants.OPT_TYPE_INSERT, request.getId(), panelInfo.getNodeType());
|
||||||
}
|
}
|
||||||
PanelGroupWithBLOBs record = new PanelGroupWithBLOBs();
|
PanelGroupWithBLOBs record = new PanelGroupWithBLOBs();
|
||||||
record.setName(request.getName());
|
record.setName(request.getName());
|
||||||
@ -152,7 +153,7 @@ public class PanelGroupService {
|
|||||||
} else {
|
} else {
|
||||||
// 更新
|
// 更新
|
||||||
if (StringUtils.isNotEmpty(request.getName())) {
|
if (StringUtils.isNotEmpty(request.getName())) {
|
||||||
checkPanelName(request.getName(), request.getPid(), PanelConstants.OPT_TYPE_UPDATE, request.getId(),request.getNodeType());
|
checkPanelName(request.getName(), request.getPid(), PanelConstants.OPT_TYPE_UPDATE, request.getId(), request.getNodeType());
|
||||||
}
|
}
|
||||||
panelGroupMapper.updateByPrimaryKeySelective(request);
|
panelGroupMapper.updateByPrimaryKeySelective(request);
|
||||||
}
|
}
|
||||||
@ -172,7 +173,7 @@ public class PanelGroupService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void checkPanelName(String name, String pid, String optType, String id,String nodeType) {
|
private void checkPanelName(String name, String pid, String optType, String id, String nodeType) {
|
||||||
PanelGroupExample groupExample = new PanelGroupExample();
|
PanelGroupExample groupExample = new PanelGroupExample();
|
||||||
if (PanelConstants.OPT_TYPE_INSERT.equalsIgnoreCase(optType)) {
|
if (PanelConstants.OPT_TYPE_INSERT.equalsIgnoreCase(optType)) {
|
||||||
groupExample.createCriteria().andPidEqualTo(pid).andNameEqualTo(name).andNodeTypeEqualTo(nodeType);
|
groupExample.createCriteria().andPidEqualTo(pid).andNameEqualTo(name).andNodeTypeEqualTo(nodeType);
|
||||||
@ -225,56 +226,61 @@ public class PanelGroupService {
|
|||||||
return chartViewDTOList;
|
return chartViewDTOList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<VAuthModelDTO> queryPanelViewTree(){
|
public List<VAuthModelDTO> queryPanelViewTree() {
|
||||||
List<VAuthModelDTO> result = new ArrayList<>();
|
List<VAuthModelDTO> result = new ArrayList<>();
|
||||||
VAuthModelRequest panelRequest = new VAuthModelRequest();
|
VAuthModelRequest panelRequest = new VAuthModelRequest();
|
||||||
panelRequest.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
|
panelRequest.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
|
||||||
panelRequest.setModelType("panel");
|
panelRequest.setModelType("panel");
|
||||||
List<VAuthModelDTO> panelResult = extVAuthModelMapper.queryAuthModel(panelRequest);
|
List<VAuthModelDTO> panelResult = extVAuthModelMapper.queryAuthModel(panelRequest);
|
||||||
// 获取仪表板下面的视图
|
// 获取仪表板下面的视图
|
||||||
if(CollectionUtils.isNotEmpty(panelResult)){
|
if (CollectionUtils.isNotEmpty(panelResult)) {
|
||||||
result.addAll(panelResult);
|
result.addAll(panelResult);
|
||||||
List<String> panelIds = panelResult.stream().map(VAuthModelDTO::getId).collect(Collectors.toList());
|
List<String> panelIds = panelResult.stream().map(VAuthModelDTO::getId).collect(Collectors.toList());
|
||||||
VAuthModelRequest viewRequest = new VAuthModelRequest();
|
VAuthModelRequest viewRequest = new VAuthModelRequest();
|
||||||
viewRequest.setPids(panelIds);
|
viewRequest.setPids(panelIds);
|
||||||
List<VAuthModelDTO> viewResult = extVAuthModelMapper.queryAuthModelViews(viewRequest);
|
List<VAuthModelDTO> viewResult = extVAuthModelMapper.queryAuthModelViews(viewRequest);
|
||||||
if(CollectionUtils.isNotEmpty(viewResult)){
|
if (CollectionUtils.isNotEmpty(viewResult)) {
|
||||||
result.addAll(viewResult);
|
result.addAll(viewResult);
|
||||||
}
|
}
|
||||||
result = TreeUtils.mergeTree(result,"panel_list");
|
result = TreeUtils.mergeTree(result, "panel_list");
|
||||||
// 原有视图的目录结构
|
if (AuthUtils.getUser().getIsAdmin()) {
|
||||||
List<VAuthModelDTO> viewOriginal = extVAuthModelMapper.queryAuthViewsOriginal(viewRequest);
|
// 原有视图的目录结构
|
||||||
if(CollectionUtils.isNotEmpty(viewOriginal) && viewOriginal.size()>1){
|
List<VAuthModelDTO> viewOriginal = extVAuthModelMapper.queryAuthViewsOriginal(viewRequest);
|
||||||
result.addAll(TreeUtils.mergeTree(viewOriginal,"public_chart"));
|
if (CollectionUtils.isNotEmpty(viewOriginal) && viewOriginal.size() > 1 ) {
|
||||||
|
result.addAll(TreeUtils.mergeTree(viewOriginal, "public_chart"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String panelGroupCopy(PanelGroupRequest request){
|
public String panelGroupCopy(PanelGroupRequest request, String newPanelId, boolean checkName) {
|
||||||
String sourcePanelId = request.getId(); //源仪表板ID
|
String sourcePanelId = request.getId(); //源仪表板ID
|
||||||
String newPanelId = UUIDUtil.getUUIDAsString(); //目标仪表板ID
|
if (StringUtils.isEmpty(newPanelId)) {
|
||||||
|
newPanelId = UUIDUtil.getUUIDAsString(); //目标仪表板ID
|
||||||
|
}
|
||||||
String copyId = UUIDUtil.getUUIDAsString(); // 本次复制执行ID
|
String copyId = UUIDUtil.getUUIDAsString(); // 本次复制执行ID
|
||||||
// 复制仪表板
|
// 复制仪表板
|
||||||
PanelGroupWithBLOBs newPanel = panelGroupMapper.selectByPrimaryKey(sourcePanelId);
|
PanelGroupWithBLOBs newPanel = panelGroupMapper.selectByPrimaryKey(sourcePanelId);
|
||||||
if (StringUtils.isNotEmpty(request.getName())) {
|
if (checkName && StringUtils.isNotEmpty(request.getName())) {
|
||||||
// 插入校验
|
// 插入校验
|
||||||
checkPanelName(request.getName(), newPanel.getPid(), PanelConstants.OPT_TYPE_INSERT, request.getId(),newPanel.getNodeType());
|
checkPanelName(request.getName(), newPanel.getPid(), PanelConstants.OPT_TYPE_INSERT, request.getId(), newPanel.getNodeType());
|
||||||
}
|
}
|
||||||
newPanel.setName(request.getName());
|
newPanel.setName(request.getName());
|
||||||
newPanel.setId(newPanelId);
|
newPanel.setId(newPanelId);
|
||||||
newPanel.setCreateBy(AuthUtils.getUser().getUsername());
|
newPanel.setCreateBy(AuthUtils.getUser().getUsername());
|
||||||
//TODO copy panelView
|
//TODO copy panelView
|
||||||
extPanelViewMapper.copyFromPanel(newPanelId,sourcePanelId,copyId);
|
extPanelViewMapper.copyFromPanel(newPanelId, sourcePanelId, copyId);
|
||||||
//TODO 复制视图 chart_view
|
//TODO 复制视图 chart_view
|
||||||
extChartViewMapper.chartCopyWithPanel(copyId);
|
extChartViewMapper.chartCopyWithPanel(copyId);
|
||||||
//TODO 替换panel_data viewId 数据
|
//TODO 替换panel_data viewId 数据
|
||||||
List<PanelView> panelViewList = panelViewService.findPanelViews(newPanelId);
|
List<PanelView> panelViewList = panelViewService.findPanelViews(copyId);
|
||||||
if(CollectionUtils.isNotEmpty(panelViewList)){
|
if (CollectionUtils.isNotEmpty(panelViewList)) {
|
||||||
String panelData = newPanel.getPanelData();
|
String panelData = newPanel.getPanelData();
|
||||||
//TODO 替换panel_data viewId 数据 并保存
|
//TODO 替换panel_data viewId 数据 并保存
|
||||||
for(PanelView panelView:panelViewList){
|
for (PanelView panelView : panelViewList) {
|
||||||
panelData = panelData.replaceAll(panelView.getCopyFromView(),panelView.getChartViewId());
|
panelData = panelData.replaceAll(panelView.getCopyFromView(), panelView.getChartViewId());
|
||||||
}
|
}
|
||||||
newPanel.setPanelData(panelData);
|
newPanel.setPanelData(panelData);
|
||||||
panelGroupMapper.insertSelective(newPanel);
|
panelGroupMapper.insertSelective(newPanel);
|
||||||
@ -289,4 +295,42 @@ public class PanelGroupService {
|
|||||||
return newPanelId;
|
return newPanelId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void sysInit1HistoryPanel() {
|
||||||
|
LogUtil.info("=====v1.8版本 仪表板私有化【开始】=====");
|
||||||
|
List<PanelGroupDTO> needInitPanels = extPanelGroupMapper.panelGroupInit();
|
||||||
|
for (PanelGroupDTO panelGroupDTO : needInitPanels) {
|
||||||
|
LogUtil.info("==>" + panelGroupDTO.getName() + "&" + panelGroupDTO.getId());
|
||||||
|
String sourcePanelId = panelGroupDTO.getId(); //仪表板ID
|
||||||
|
String copyId = UUIDUtil.getUUIDAsString(); // 本次复制执行ID
|
||||||
|
//TODO copy panelView
|
||||||
|
extPanelViewMapper.copyFromPanel(sourcePanelId, sourcePanelId, copyId);
|
||||||
|
//TODO 复制视图 chart_view
|
||||||
|
extChartViewMapper.chartCopyWithPanel(copyId);
|
||||||
|
//TODO 替换panel_data viewId 数据
|
||||||
|
List<PanelView> panelViewList = panelViewService.findPanelViews(copyId);
|
||||||
|
String panelData = panelGroupDTO.getPanelData();
|
||||||
|
if (CollectionUtils.isNotEmpty(panelViewList) && StringUtils.isNotEmpty(panelData)) {
|
||||||
|
//TODO 替换panel_data viewId 数据 并保存
|
||||||
|
for (PanelView panelView : panelViewList) {
|
||||||
|
panelData = panelData.replaceAll(panelView.getCopyFromView(), panelView.getChartViewId());
|
||||||
|
}
|
||||||
|
panelGroupDTO.setPanelData(panelData);
|
||||||
|
panelGroupMapper.updateByPrimaryKeySelective(panelGroupDTO);
|
||||||
|
//TODO 复制跳转信息 copy panel_link_jump panel_link_jump_info panel_link_jump_target_view_info
|
||||||
|
extPanelLinkJumpMapper.copyLinkJump(copyId);
|
||||||
|
extPanelLinkJumpMapper.copyLinkJumpInfo(copyId);
|
||||||
|
extPanelLinkJumpMapper.copyLinkJumpTarget(copyId);
|
||||||
|
//TODO 复制联动信息 copy panel_view_linkage_field panel_view_linkage
|
||||||
|
extPanelViewLinkageMapper.copyViewLinkage(copyId);
|
||||||
|
extPanelViewLinkageMapper.copyViewLinkageField(copyId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//TODO 清理已经复制过的Panel_view
|
||||||
|
PanelViewExample clearViewExample = new PanelViewExample();
|
||||||
|
clearViewExample.createCriteria().andCopyFromIsNull();
|
||||||
|
panelViewMapper.deleteByExample(clearViewExample);
|
||||||
|
LogUtil.info("=====v1.8版本 仪表板私有化【结束】=====");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -124,9 +124,9 @@ public class PanelViewService {
|
|||||||
return extPanelViewMapper.getPanelViewDetails(panelId);
|
return extPanelViewMapper.getPanelViewDetails(panelId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<PanelView> findPanelViews(String panelId){
|
public List<PanelView> findPanelViews(String copyId){
|
||||||
PanelViewExample panelViewExample = new PanelViewExample();
|
PanelViewExample panelViewExample = new PanelViewExample();
|
||||||
panelViewExample.createCriteria().andPanelIdEqualTo(panelId);
|
panelViewExample.createCriteria().andCopyIdEqualTo(copyId);
|
||||||
return panelViewMapper.selectByExample(panelViewExample);
|
return panelViewMapper.selectByExample(panelViewExample);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -365,7 +365,7 @@ ADD COLUMN `copy_id` varchar(255) NULL COMMENT '本次复制的执行ID' AFTER `
|
|||||||
|
|
||||||
ALTER TABLE `panel_view_linkage`
|
ALTER TABLE `panel_view_linkage`
|
||||||
ADD COLUMN `copy_from` varchar(255) NULL AFTER `ext2`,
|
ADD COLUMN `copy_from` varchar(255) NULL AFTER `ext2`,
|
||||||
ADD COLUMN `copy_id` varchar(0) NULL AFTER `copy_from`;
|
ADD COLUMN `copy_id` varchar(255) NULL AFTER `copy_from`;
|
||||||
|
|
||||||
ALTER TABLE `panel_view_linkage_field`
|
ALTER TABLE `panel_view_linkage_field`
|
||||||
ADD COLUMN `copy_from` varchar(255) NULL AFTER `update_time`,
|
ADD COLUMN `copy_from` varchar(255) NULL AFTER `update_time`,
|
||||||
@ -382,3 +382,20 @@ ADD COLUMN `copy_id` varchar(255) NULL AFTER `copy_from`;
|
|||||||
ALTER TABLE `panel_link_jump_target_view_info`
|
ALTER TABLE `panel_link_jump_target_view_info`
|
||||||
ADD COLUMN `copy_from` varchar(255) NULL AFTER `target_field_id`,
|
ADD COLUMN `copy_from` varchar(255) NULL AFTER `target_field_id`,
|
||||||
ADD COLUMN `copy_id` varchar(255) NULL AFTER `copy_from`;
|
ADD COLUMN `copy_id` varchar(255) NULL AFTER `copy_from`;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `dataease_code_version`;
|
||||||
|
CREATE TABLE `dataease_code_version` (
|
||||||
|
`installed_rank` int(11) NOT NULL,
|
||||||
|
`description` varchar(255) DEFAULT NULL,
|
||||||
|
`installed_on` timestamp NULL DEFAULT NULL,
|
||||||
|
`success` tinyint(1) NOT NULL,
|
||||||
|
PRIMARY KEY (`installed_rank`),
|
||||||
|
KEY `dataease_version_s_idx` (`success`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of dataease_code_version
|
||||||
|
-- ----------------------------
|
||||||
|
BEGIN;
|
||||||
|
INSERT INTO `dataease_code_version` VALUES (0, 'init', NULL, 1);
|
||||||
|
COMMIT;
|
||||||
|
@ -60,12 +60,13 @@
|
|||||||
</javaClientGenerator>
|
</javaClientGenerator>
|
||||||
|
|
||||||
<!--要生成的数据库表 -->
|
<!--要生成的数据库表 -->
|
||||||
<table tableName="chart_view"/>
|
<table tableName="dataease_code_version"/>
|
||||||
<table tableName="panel_view"/>
|
<!-- <table tableName="chart_view"/>-->
|
||||||
<table tableName="panel_link_jump"/>
|
<!-- <table tableName="panel_view"/>-->
|
||||||
<table tableName="panel_link_jump_info"/>
|
<!-- <table tableName="panel_link_jump"/>-->
|
||||||
<table tableName="panel_link_jump_target_view_info"/>
|
<!-- <table tableName="panel_link_jump_info"/>-->
|
||||||
<table tableName="panel_view_linkage"/>
|
<!-- <table tableName="panel_link_jump_target_view_info"/>-->
|
||||||
<table tableName="panel_view_linkage_field"/>
|
<!-- <table tableName="panel_view_linkage"/>-->
|
||||||
|
<!-- <table tableName="panel_view_linkage_field"/>-->
|
||||||
</context>
|
</context>
|
||||||
</generatorConfiguration>
|
</generatorConfiguration>
|
||||||
|
Loading…
Reference in New Issue
Block a user