diff --git a/backend/src/main/java/io/dataease/base/domain/PanelShare.java b/backend/src/main/java/io/dataease/base/domain/PanelShare.java new file mode 100644 index 0000000000..5d45eca63a --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/PanelShare.java @@ -0,0 +1,17 @@ +package io.dataease.base.domain; + +import java.io.Serializable; +import lombok.Data; + +@Data +public class PanelShare implements Serializable { + private Long shareId; + + private String panelGroupId; + + private Long userId; + + private Long createTime; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/domain/PanelShareExample.java b/backend/src/main/java/io/dataease/base/domain/PanelShareExample.java new file mode 100644 index 0000000000..887d2f1d8c --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/PanelShareExample.java @@ -0,0 +1,450 @@ +package io.dataease.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class PanelShareExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public PanelShareExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void 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 andShareIdIsNull() { + addCriterion("share_id is null"); + return (Criteria) this; + } + + public Criteria andShareIdIsNotNull() { + addCriterion("share_id is not null"); + return (Criteria) this; + } + + public Criteria andShareIdEqualTo(Long value) { + addCriterion("share_id =", value, "shareId"); + return (Criteria) this; + } + + public Criteria andShareIdNotEqualTo(Long value) { + addCriterion("share_id <>", value, "shareId"); + return (Criteria) this; + } + + public Criteria andShareIdGreaterThan(Long value) { + addCriterion("share_id >", value, "shareId"); + return (Criteria) this; + } + + public Criteria andShareIdGreaterThanOrEqualTo(Long value) { + addCriterion("share_id >=", value, "shareId"); + return (Criteria) this; + } + + public Criteria andShareIdLessThan(Long value) { + addCriterion("share_id <", value, "shareId"); + return (Criteria) this; + } + + public Criteria andShareIdLessThanOrEqualTo(Long value) { + addCriterion("share_id <=", value, "shareId"); + return (Criteria) this; + } + + public Criteria andShareIdIn(List values) { + addCriterion("share_id in", values, "shareId"); + return (Criteria) this; + } + + public Criteria andShareIdNotIn(List values) { + addCriterion("share_id not in", values, "shareId"); + return (Criteria) this; + } + + public Criteria andShareIdBetween(Long value1, Long value2) { + addCriterion("share_id between", value1, value2, "shareId"); + return (Criteria) this; + } + + public Criteria andShareIdNotBetween(Long value1, Long value2) { + addCriterion("share_id not between", value1, value2, "shareId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdIsNull() { + addCriterion("panel_group_id is null"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdIsNotNull() { + addCriterion("panel_group_id is not null"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdEqualTo(String value) { + addCriterion("panel_group_id =", value, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdNotEqualTo(String value) { + addCriterion("panel_group_id <>", value, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdGreaterThan(String value) { + addCriterion("panel_group_id >", value, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdGreaterThanOrEqualTo(String value) { + addCriterion("panel_group_id >=", value, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdLessThan(String value) { + addCriterion("panel_group_id <", value, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdLessThanOrEqualTo(String value) { + addCriterion("panel_group_id <=", value, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdLike(String value) { + addCriterion("panel_group_id like", value, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdNotLike(String value) { + addCriterion("panel_group_id not like", value, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdIn(List values) { + addCriterion("panel_group_id in", values, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdNotIn(List values) { + addCriterion("panel_group_id not in", values, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdBetween(String value1, String value2) { + addCriterion("panel_group_id between", value1, value2, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdNotBetween(String value1, String value2) { + addCriterion("panel_group_id not between", value1, value2, "panelGroupId"); + 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 values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List 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 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 values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List 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 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); + } + } +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/domain/PanelStore.java b/backend/src/main/java/io/dataease/base/domain/PanelStore.java new file mode 100644 index 0000000000..902dcd6a39 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/PanelStore.java @@ -0,0 +1,17 @@ +package io.dataease.base.domain; + +import java.io.Serializable; +import lombok.Data; + +@Data +public class PanelStore implements Serializable { + private Long storeId; + + private String panelGroupId; + + private Long userId; + + private Long createTime; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/domain/PanelStoreExample.java b/backend/src/main/java/io/dataease/base/domain/PanelStoreExample.java new file mode 100644 index 0000000000..58bf825693 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/PanelStoreExample.java @@ -0,0 +1,450 @@ +package io.dataease.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class PanelStoreExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public PanelStoreExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void 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 andStoreIdIsNull() { + addCriterion("store_id is null"); + return (Criteria) this; + } + + public Criteria andStoreIdIsNotNull() { + addCriterion("store_id is not null"); + return (Criteria) this; + } + + public Criteria andStoreIdEqualTo(Long value) { + addCriterion("store_id =", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdNotEqualTo(Long value) { + addCriterion("store_id <>", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdGreaterThan(Long value) { + addCriterion("store_id >", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdGreaterThanOrEqualTo(Long value) { + addCriterion("store_id >=", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdLessThan(Long value) { + addCriterion("store_id <", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdLessThanOrEqualTo(Long value) { + addCriterion("store_id <=", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdIn(List values) { + addCriterion("store_id in", values, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdNotIn(List values) { + addCriterion("store_id not in", values, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdBetween(Long value1, Long value2) { + addCriterion("store_id between", value1, value2, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdNotBetween(Long value1, Long value2) { + addCriterion("store_id not between", value1, value2, "storeId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdIsNull() { + addCriterion("panel_group_id is null"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdIsNotNull() { + addCriterion("panel_group_id is not null"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdEqualTo(String value) { + addCriterion("panel_group_id =", value, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdNotEqualTo(String value) { + addCriterion("panel_group_id <>", value, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdGreaterThan(String value) { + addCriterion("panel_group_id >", value, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdGreaterThanOrEqualTo(String value) { + addCriterion("panel_group_id >=", value, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdLessThan(String value) { + addCriterion("panel_group_id <", value, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdLessThanOrEqualTo(String value) { + addCriterion("panel_group_id <=", value, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdLike(String value) { + addCriterion("panel_group_id like", value, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdNotLike(String value) { + addCriterion("panel_group_id not like", value, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdIn(List values) { + addCriterion("panel_group_id in", values, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdNotIn(List values) { + addCriterion("panel_group_id not in", values, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdBetween(String value1, String value2) { + addCriterion("panel_group_id between", value1, value2, "panelGroupId"); + return (Criteria) this; + } + + public Criteria andPanelGroupIdNotBetween(String value1, String value2) { + addCriterion("panel_group_id not between", value1, value2, "panelGroupId"); + 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 values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List 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 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 values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List 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 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); + } + } +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/PanelShareMapper.java b/backend/src/main/java/io/dataease/base/mapper/PanelShareMapper.java new file mode 100644 index 0000000000..b45b0ce4cc --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/PanelShareMapper.java @@ -0,0 +1,30 @@ +package io.dataease.base.mapper; + +import io.dataease.base.domain.PanelShare; +import io.dataease.base.domain.PanelShareExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface PanelShareMapper { + long countByExample(PanelShareExample example); + + int deleteByExample(PanelShareExample example); + + int deleteByPrimaryKey(Long shareId); + + int insert(PanelShare record); + + int insertSelective(PanelShare record); + + List selectByExample(PanelShareExample example); + + PanelShare selectByPrimaryKey(Long shareId); + + int updateByExampleSelective(@Param("record") PanelShare record, @Param("example") PanelShareExample example); + + int updateByExample(@Param("record") PanelShare record, @Param("example") PanelShareExample example); + + int updateByPrimaryKeySelective(PanelShare record); + + int updateByPrimaryKey(PanelShare record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/PanelShareMapper.xml b/backend/src/main/java/io/dataease/base/mapper/PanelShareMapper.xml new file mode 100644 index 0000000000..7c4d62bdcc --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/PanelShareMapper.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + share_id, panel_group_id, user_id, create_time + + + + + delete from panel_share + where share_id = #{shareId,jdbcType=BIGINT} + + + delete from panel_share + + + + + + insert into panel_share (share_id, panel_group_id, user_id, + create_time) + values (#{shareId,jdbcType=BIGINT}, #{panelGroupId,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, + #{createTime,jdbcType=BIGINT}) + + + insert into panel_share + + + share_id, + + + panel_group_id, + + + user_id, + + + create_time, + + + + + #{shareId,jdbcType=BIGINT}, + + + #{panelGroupId,jdbcType=VARCHAR}, + + + #{userId,jdbcType=BIGINT}, + + + #{createTime,jdbcType=BIGINT}, + + + + + + update panel_share + + + share_id = #{record.shareId,jdbcType=BIGINT}, + + + panel_group_id = #{record.panelGroupId,jdbcType=VARCHAR}, + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + + + + + + update panel_share + set share_id = #{record.shareId,jdbcType=BIGINT}, + panel_group_id = #{record.panelGroupId,jdbcType=VARCHAR}, + user_id = #{record.userId,jdbcType=BIGINT}, + create_time = #{record.createTime,jdbcType=BIGINT} + + + + + + update panel_share + + + panel_group_id = #{panelGroupId,jdbcType=VARCHAR}, + + + user_id = #{userId,jdbcType=BIGINT}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + where share_id = #{shareId,jdbcType=BIGINT} + + + update panel_share + set panel_group_id = #{panelGroupId,jdbcType=VARCHAR}, + user_id = #{userId,jdbcType=BIGINT}, + create_time = #{createTime,jdbcType=BIGINT} + where share_id = #{shareId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/PanelStoreMapper.java b/backend/src/main/java/io/dataease/base/mapper/PanelStoreMapper.java new file mode 100644 index 0000000000..5f7492cbca --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/PanelStoreMapper.java @@ -0,0 +1,30 @@ +package io.dataease.base.mapper; + +import io.dataease.base.domain.PanelStore; +import io.dataease.base.domain.PanelStoreExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface PanelStoreMapper { + long countByExample(PanelStoreExample example); + + int deleteByExample(PanelStoreExample example); + + int deleteByPrimaryKey(Long storeId); + + int insert(PanelStore record); + + int insertSelective(PanelStore record); + + List selectByExample(PanelStoreExample example); + + PanelStore selectByPrimaryKey(Long storeId); + + int updateByExampleSelective(@Param("record") PanelStore record, @Param("example") PanelStoreExample example); + + int updateByExample(@Param("record") PanelStore record, @Param("example") PanelStoreExample example); + + int updateByPrimaryKeySelective(PanelStore record); + + int updateByPrimaryKey(PanelStore record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/PanelStoreMapper.xml b/backend/src/main/java/io/dataease/base/mapper/PanelStoreMapper.xml new file mode 100644 index 0000000000..2cddbe1dc0 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/PanelStoreMapper.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + store_id, panel_group_id, user_id, create_time + + + + + delete from panel_store + where store_id = #{storeId,jdbcType=BIGINT} + + + delete from panel_store + + + + + + insert into panel_store (store_id, panel_group_id, user_id, + create_time) + values (#{storeId,jdbcType=BIGINT}, #{panelGroupId,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, + #{createTime,jdbcType=BIGINT}) + + + insert into panel_store + + + store_id, + + + panel_group_id, + + + user_id, + + + create_time, + + + + + #{storeId,jdbcType=BIGINT}, + + + #{panelGroupId,jdbcType=VARCHAR}, + + + #{userId,jdbcType=BIGINT}, + + + #{createTime,jdbcType=BIGINT}, + + + + + + update panel_store + + + store_id = #{record.storeId,jdbcType=BIGINT}, + + + panel_group_id = #{record.panelGroupId,jdbcType=VARCHAR}, + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + + + + + + update panel_store + set store_id = #{record.storeId,jdbcType=BIGINT}, + panel_group_id = #{record.panelGroupId,jdbcType=VARCHAR}, + user_id = #{record.userId,jdbcType=BIGINT}, + create_time = #{record.createTime,jdbcType=BIGINT} + + + + + + update panel_store + + + panel_group_id = #{panelGroupId,jdbcType=VARCHAR}, + + + user_id = #{userId,jdbcType=BIGINT}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + where store_id = #{storeId,jdbcType=BIGINT} + + + update panel_store + set panel_group_id = #{panelGroupId,jdbcType=VARCHAR}, + user_id = #{userId,jdbcType=BIGINT}, + create_time = #{createTime,jdbcType=BIGINT} + where store_id = #{storeId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.java b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.java new file mode 100644 index 0000000000..784e6317f1 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.java @@ -0,0 +1,14 @@ +package io.dataease.base.mapper.ext; + +import io.dataease.base.domain.PanelShare; +import io.dataease.base.mapper.ext.query.GridExample; +import io.dataease.dto.panel.PanelShareDto; + +import java.util.List; + +public interface ExtPanelShareMapper { + + int batchInsert(List shares); + + List query(GridExample example); +} diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.xml new file mode 100644 index 0000000000..6da4ef665b --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelShareMapper.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + INSERT INTO panel_store (panel_group_id,user_id,create_time) + VALUES + + (#{store.panelGroupId}, #{store.userId}, #{store.createTime}) + + + + + + + + + + diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelStoreMapper.java b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelStoreMapper.java new file mode 100644 index 0000000000..d4f2b48ae2 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelStoreMapper.java @@ -0,0 +1,11 @@ +package io.dataease.base.mapper.ext; + +import io.dataease.base.mapper.ext.query.GridExample; +import io.dataease.dto.panel.PanelStoreDto; + +import java.util.List; + +public interface ExtPanelStoreMapper { + + List query(GridExample example); +} diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelStoreMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelStoreMapper.xml new file mode 100644 index 0000000000..20c2a13620 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelStoreMapper.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + diff --git a/backend/src/main/java/io/dataease/controller/panel/api/ShareApi.java b/backend/src/main/java/io/dataease/controller/panel/api/ShareApi.java new file mode 100644 index 0000000000..f12e247fd6 --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/panel/api/ShareApi.java @@ -0,0 +1,29 @@ +package io.dataease.controller.panel.api; + +import io.dataease.controller.request.panel.PanelShareRequest; +import io.dataease.controller.sys.base.BaseGridRequest; +import io.dataease.dto.panel.PanelShareDto; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +import java.util.List; + +/** + * 分享API + */ +@Api(tags = "仪表板:分享管理") +@RequestMapping("/api/share") +public interface ShareApi { + + @ApiOperation("创建分享") + @PostMapping("/") + void share(PanelShareRequest request); + + @ApiOperation("查询分享") + @PostMapping("/treeList") + List treeList(BaseGridRequest request); + + +} diff --git a/backend/src/main/java/io/dataease/controller/panel/api/StoreApi.java b/backend/src/main/java/io/dataease/controller/panel/api/StoreApi.java new file mode 100644 index 0000000000..a4d5873b22 --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/panel/api/StoreApi.java @@ -0,0 +1,36 @@ +package io.dataease.controller.panel.api; + +import io.dataease.controller.sys.base.BaseGridRequest; +import io.dataease.dto.panel.PanelStoreDto; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import java.util.List; + +/** + * 收藏API + */ + +@Api(tags = "仪表板:收藏管理") +@RequestMapping("/api/store") +public interface StoreApi { + + @ApiOperation("创建收藏") + @PostMapping("/{id}") + void store(@PathVariable("id") String id); + + + @ApiOperation("查询收藏") + @PostMapping("/list") + List list(@RequestBody BaseGridRequest request); + + + @ApiOperation("移除收藏") + @PostMapping("/remove/{storeId}") + void remove(@PathVariable("storeId") Long storeId); + +} diff --git a/backend/src/main/java/io/dataease/controller/panel/server/ShareServer.java b/backend/src/main/java/io/dataease/controller/panel/server/ShareServer.java new file mode 100644 index 0000000000..99fcad3163 --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/panel/server/ShareServer.java @@ -0,0 +1,26 @@ +package io.dataease.controller.panel.server; + +import io.dataease.controller.panel.api.ShareApi; +import io.dataease.controller.request.panel.PanelShareRequest; +import io.dataease.controller.sys.base.BaseGridRequest; +import io.dataease.dto.panel.PanelShareDto; +import io.dataease.service.panel.ShareService; +import org.springframework.web.bind.annotation.RequestBody; + +import javax.annotation.Resource; +import java.util.List; + +public class ShareServer implements ShareApi { + + @Resource + private ShareService shareService; + @Override + public void share(@RequestBody PanelShareRequest request) { + shareService.save(request); + } + + @Override + public List treeList(@RequestBody BaseGridRequest request) { + return shareService.queryTree(request); + } +} diff --git a/backend/src/main/java/io/dataease/controller/panel/server/StoreServer.java b/backend/src/main/java/io/dataease/controller/panel/server/StoreServer.java new file mode 100644 index 0000000000..795c2ce866 --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/panel/server/StoreServer.java @@ -0,0 +1,32 @@ +package io.dataease.controller.panel.server; + +import io.dataease.controller.panel.api.StoreApi; +import io.dataease.controller.sys.base.BaseGridRequest; +import io.dataease.dto.panel.PanelStoreDto; +import io.dataease.service.panel.StoreService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +public class StoreServer implements StoreApi { + + @Autowired + private StoreService storeService; + + @Override + public void store( String id) { + storeService.save(id); + } + + @Override + public List list(BaseGridRequest request) { + return storeService.query(request); + } + + @Override + public void remove( Long storeId) { + storeService.remove(storeId); + } +} diff --git a/backend/src/main/java/io/dataease/controller/request/panel/PanelShareRequest.java b/backend/src/main/java/io/dataease/controller/request/panel/PanelShareRequest.java new file mode 100644 index 0000000000..0a8c652fee --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/request/panel/PanelShareRequest.java @@ -0,0 +1,16 @@ +package io.dataease.controller.request.panel; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class PanelShareRequest implements Serializable { + + @ApiModelProperty("分享目标用户集合") + private List userIds; + @ApiModelProperty("分享仪表板集合") + private List panelIds; +} diff --git a/backend/src/main/java/io/dataease/dto/panel/PanelShareDto.java b/backend/src/main/java/io/dataease/dto/panel/PanelShareDto.java new file mode 100644 index 0000000000..0ad7dd3575 --- /dev/null +++ b/backend/src/main/java/io/dataease/dto/panel/PanelShareDto.java @@ -0,0 +1,23 @@ +package io.dataease.dto.panel; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; + +import java.util.List; + +@Data +@Builder +public class PanelShareDto { + + @ApiModelProperty("节点ID") + private String id; + @ApiModelProperty("名称") + private String name; + @ApiModelProperty("节点父ID") + private String creator; + @ApiModelProperty("子节点") + private List children; + + +} diff --git a/backend/src/main/java/io/dataease/dto/panel/PanelStoreDto.java b/backend/src/main/java/io/dataease/dto/panel/PanelStoreDto.java new file mode 100644 index 0000000000..9e5f0631fd --- /dev/null +++ b/backend/src/main/java/io/dataease/dto/panel/PanelStoreDto.java @@ -0,0 +1,15 @@ +package io.dataease.dto.panel; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + + +@Data +public class PanelStoreDto { + + @ApiModelProperty("收藏ID") + private Long storeId; + @ApiModelProperty("仪表板名称") + private String name; + +} diff --git a/backend/src/main/java/io/dataease/service/panel/ShareService.java b/backend/src/main/java/io/dataease/service/panel/ShareService.java new file mode 100644 index 0000000000..0d90204ced --- /dev/null +++ b/backend/src/main/java/io/dataease/service/panel/ShareService.java @@ -0,0 +1,94 @@ +package io.dataease.service.panel; + +import io.dataease.base.domain.PanelShare; +import io.dataease.base.domain.PanelShareExample; +import io.dataease.base.mapper.PanelShareMapper; +import io.dataease.base.mapper.ext.ExtPanelShareMapper; +import io.dataease.base.mapper.ext.query.GridExample; +import io.dataease.commons.utils.AuthUtils; +import io.dataease.commons.utils.CommonBeanFactory; +import io.dataease.controller.request.panel.PanelShareRequest; +import io.dataease.controller.sys.base.BaseGridRequest; +import io.dataease.controller.sys.base.ConditionEntity; +import io.dataease.dto.panel.PanelShareDto; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + + +@Service +public class ShareService { + + @Autowired(required = false) + private PanelShareMapper mapper; + + + @Resource + private ExtPanelShareMapper extPanelShareMapper; + + @Transactional + public void save(PanelShareRequest request){ + + //1.先根据仪表板删除所有已经分享的 + List panelIds = request.getPanelIds(); + List userIds = request.getUserIds(); + // 使用原生对象会导致事物失效 所以这里需要使用spring代理对象 + if (CollectionUtils.isNotEmpty(panelIds)){ + ShareService proxy = CommonBeanFactory.getBean(ShareService.class); + panelIds.forEach(proxy::delete); + } + if (CollectionUtils.isEmpty(userIds)) return; + long now = System.currentTimeMillis(); + List shares = panelIds.stream().flatMap(panelId -> + userIds.stream().map(userId -> { + PanelShare share = new PanelShare(); + share.setCreateTime(now); + share.setPanelGroupId(panelId); + share.setUserId(userId); + return share; + }) + ).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(shares)){ + extPanelShareMapper.batchInsert(shares); + } + } + + /** + * panel_group_id建了索引 效率不会很差 + * @param panel_group_id + */ + @Transactional + public void delete(String panel_group_id){ + PanelShareExample example = new PanelShareExample(); + example.createCriteria().andPanelGroupIdEqualTo(panel_group_id); + mapper.deleteByExample(example); + } + + + public List queryTree(BaseGridRequest request){ + Long userId = AuthUtils.getUser().getUserId(); + ConditionEntity condition = new ConditionEntity(); + condition.setField("s.user_id"); + condition.setOperator("eq"); + condition.setValue(userId); + request.setConditions(new ArrayList(){{add(condition);}}); + GridExample example = request.convertExample(); + List datas = extPanelShareMapper.query(example); + return convertTree(datas); + } + + //List构建Tree + private List convertTree(List datas){ + Map> map = datas.stream().collect(Collectors.groupingBy(PanelShareDto::getCreator)); + List roots = new ArrayList<>(); + return map.entrySet().stream().map(entry -> PanelShareDto.builder().name(entry.getKey()).children(entry.getValue()).build()).collect(Collectors.toList()); + } + + +} diff --git a/backend/src/main/java/io/dataease/service/panel/StoreService.java b/backend/src/main/java/io/dataease/service/panel/StoreService.java new file mode 100644 index 0000000000..bdc477ae1e --- /dev/null +++ b/backend/src/main/java/io/dataease/service/panel/StoreService.java @@ -0,0 +1,57 @@ +package io.dataease.service.panel; + +import io.dataease.base.domain.PanelStore; +import io.dataease.base.mapper.PanelStoreMapper; +import io.dataease.base.mapper.ext.ExtPanelStoreMapper; +import io.dataease.base.mapper.ext.query.GridExample; +import io.dataease.commons.utils.AuthUtils; +import io.dataease.controller.sys.base.BaseGridRequest; +import io.dataease.controller.sys.base.ConditionEntity; +import io.dataease.dto.panel.PanelStoreDto; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +@Service +public class StoreService { + + @Resource + private PanelStoreMapper panelStoreMapper; + + @Resource + private ExtPanelStoreMapper extPanelStoreMapper; + + public void save(String panelGroupId){ + Long userId = AuthUtils.getUser().getUserId(); + PanelStore panelStore = new PanelStore(); + panelStore.setCreateTime(System.currentTimeMillis()); + panelStore.setPanelGroupId(panelGroupId); + panelStore.setUserId(userId); + panelStoreMapper.insert(panelStore); + } + + + + public void remove(Long storeId){ + panelStoreMapper.deleteByPrimaryKey(storeId); + } + + /** + * 按照当前用户ID查询收藏仪表板 + * @param request + * @return + */ + public List query(BaseGridRequest request){ + Long userId = AuthUtils.getUser().getUserId(); + ConditionEntity condition = new ConditionEntity(); + condition.setField("s.user_id"); + condition.setOperator("eq"); + condition.setValue(userId); + request.setConditions(new ArrayList(){{add(condition);}}); + GridExample example = request.convertExample(); + List stores = extPanelStoreMapper.query(example); + return stores; + } + +} diff --git a/backend/src/main/resources/db/migration/V12__panel_table.sql b/backend/src/main/resources/db/migration/V12__panel_table.sql index ae929b2a1c..323be7b353 100644 --- a/backend/src/main/resources/db/migration/V12__panel_table.sql +++ b/backend/src/main/resources/db/migration/V12__panel_table.sql @@ -53,3 +53,46 @@ BEGIN RETURN oTemp; END $$ DELIMITER ; + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for panel_store +-- ---------------------------- +DROP TABLE IF EXISTS `panel_store`; +CREATE TABLE `panel_store` ( + `store_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `panel_group_id` varchar(50) NOT NULL COMMENT '仪表板ID', + `user_id` bigint(20) NOT NULL COMMENT '用户ID', + `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', + PRIMARY KEY (`store_id`) USING BTREE, + UNIQUE KEY `UK_store_user_id` (`user_id`) USING BTREE + +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='仪表板收藏'; + + +SET FOREIGN_KEY_CHECKS = 1; + + + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for panel_share +-- ---------------------------- +DROP TABLE IF EXISTS `panel_share`; +CREATE TABLE `panel_share` ( + `share_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '分享ID', + `panel_group_id` varchar(50) DEFAULT NULL COMMENT '仪表板ID', + `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID', + `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', + PRIMARY KEY (`share_id`) USING BTREE, + UNIQUE KEY `UK_share_user_id` (`user_id`) USING BTREE, + UNIQUE KEY `UK_share_panel_group_id` (`panel_group_id`) USING BTREE, + +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='仪表板分享'; + + +SET FOREIGN_KEY_CHECKS = 1;