feat: 数据权限配置

This commit is contained in:
wangjiahao 2021-05-18 16:07:19 +08:00
parent 175f5510c4
commit 79e93655ec
89 changed files with 5716 additions and 227 deletions

View File

@ -23,4 +23,6 @@ public class SysUserEntity implements Serializable {
private String email;
private String phone;
private Boolean isAdmin;
}

View File

@ -0,0 +1,28 @@
package io.dataease.base.domain;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
@Data
public class SysAuth implements Serializable {
private String id;
private String authSource;
private String authSourceType;
private String authTarget;
private String authTargetType;
private Long authTime;
private String authDetails;
private String authUser;
private Date updateTime;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,29 @@
package io.dataease.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class SysAuthDetail implements Serializable {
private String id;
private String authId;
private String privilegeName;
private Integer privilegeType;
private Integer privilegeValue;
private String privilegeExtend;
private String remark;
private String createUser;
private Long createTime;
private Long updateTime;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,860 @@
package io.dataease.base.domain;
import java.util.ArrayList;
import java.util.List;
public class SysAuthDetailExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public SysAuthDetailExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andAuthIdIsNull() {
addCriterion("auth_id is null");
return (Criteria) this;
}
public Criteria andAuthIdIsNotNull() {
addCriterion("auth_id is not null");
return (Criteria) this;
}
public Criteria andAuthIdEqualTo(String value) {
addCriterion("auth_id =", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdNotEqualTo(String value) {
addCriterion("auth_id <>", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdGreaterThan(String value) {
addCriterion("auth_id >", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdGreaterThanOrEqualTo(String value) {
addCriterion("auth_id >=", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdLessThan(String value) {
addCriterion("auth_id <", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdLessThanOrEqualTo(String value) {
addCriterion("auth_id <=", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdLike(String value) {
addCriterion("auth_id like", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdNotLike(String value) {
addCriterion("auth_id not like", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdIn(List<String> values) {
addCriterion("auth_id in", values, "authId");
return (Criteria) this;
}
public Criteria andAuthIdNotIn(List<String> values) {
addCriterion("auth_id not in", values, "authId");
return (Criteria) this;
}
public Criteria andAuthIdBetween(String value1, String value2) {
addCriterion("auth_id between", value1, value2, "authId");
return (Criteria) this;
}
public Criteria andAuthIdNotBetween(String value1, String value2) {
addCriterion("auth_id not between", value1, value2, "authId");
return (Criteria) this;
}
public Criteria andPrivilegeNameIsNull() {
addCriterion("privilege_name is null");
return (Criteria) this;
}
public Criteria andPrivilegeNameIsNotNull() {
addCriterion("privilege_name is not null");
return (Criteria) this;
}
public Criteria andPrivilegeNameEqualTo(String value) {
addCriterion("privilege_name =", value, "privilegeName");
return (Criteria) this;
}
public Criteria andPrivilegeNameNotEqualTo(String value) {
addCriterion("privilege_name <>", value, "privilegeName");
return (Criteria) this;
}
public Criteria andPrivilegeNameGreaterThan(String value) {
addCriterion("privilege_name >", value, "privilegeName");
return (Criteria) this;
}
public Criteria andPrivilegeNameGreaterThanOrEqualTo(String value) {
addCriterion("privilege_name >=", value, "privilegeName");
return (Criteria) this;
}
public Criteria andPrivilegeNameLessThan(String value) {
addCriterion("privilege_name <", value, "privilegeName");
return (Criteria) this;
}
public Criteria andPrivilegeNameLessThanOrEqualTo(String value) {
addCriterion("privilege_name <=", value, "privilegeName");
return (Criteria) this;
}
public Criteria andPrivilegeNameLike(String value) {
addCriterion("privilege_name like", value, "privilegeName");
return (Criteria) this;
}
public Criteria andPrivilegeNameNotLike(String value) {
addCriterion("privilege_name not like", value, "privilegeName");
return (Criteria) this;
}
public Criteria andPrivilegeNameIn(List<String> values) {
addCriterion("privilege_name in", values, "privilegeName");
return (Criteria) this;
}
public Criteria andPrivilegeNameNotIn(List<String> values) {
addCriterion("privilege_name not in", values, "privilegeName");
return (Criteria) this;
}
public Criteria andPrivilegeNameBetween(String value1, String value2) {
addCriterion("privilege_name between", value1, value2, "privilegeName");
return (Criteria) this;
}
public Criteria andPrivilegeNameNotBetween(String value1, String value2) {
addCriterion("privilege_name not between", value1, value2, "privilegeName");
return (Criteria) this;
}
public Criteria andPrivilegeTypeIsNull() {
addCriterion("privilege_type is null");
return (Criteria) this;
}
public Criteria andPrivilegeTypeIsNotNull() {
addCriterion("privilege_type is not null");
return (Criteria) this;
}
public Criteria andPrivilegeTypeEqualTo(Integer value) {
addCriterion("privilege_type =", value, "privilegeType");
return (Criteria) this;
}
public Criteria andPrivilegeTypeNotEqualTo(Integer value) {
addCriterion("privilege_type <>", value, "privilegeType");
return (Criteria) this;
}
public Criteria andPrivilegeTypeGreaterThan(Integer value) {
addCriterion("privilege_type >", value, "privilegeType");
return (Criteria) this;
}
public Criteria andPrivilegeTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("privilege_type >=", value, "privilegeType");
return (Criteria) this;
}
public Criteria andPrivilegeTypeLessThan(Integer value) {
addCriterion("privilege_type <", value, "privilegeType");
return (Criteria) this;
}
public Criteria andPrivilegeTypeLessThanOrEqualTo(Integer value) {
addCriterion("privilege_type <=", value, "privilegeType");
return (Criteria) this;
}
public Criteria andPrivilegeTypeIn(List<Integer> values) {
addCriterion("privilege_type in", values, "privilegeType");
return (Criteria) this;
}
public Criteria andPrivilegeTypeNotIn(List<Integer> values) {
addCriterion("privilege_type not in", values, "privilegeType");
return (Criteria) this;
}
public Criteria andPrivilegeTypeBetween(Integer value1, Integer value2) {
addCriterion("privilege_type between", value1, value2, "privilegeType");
return (Criteria) this;
}
public Criteria andPrivilegeTypeNotBetween(Integer value1, Integer value2) {
addCriterion("privilege_type not between", value1, value2, "privilegeType");
return (Criteria) this;
}
public Criteria andPrivilegeValueIsNull() {
addCriterion("privilege_value is null");
return (Criteria) this;
}
public Criteria andPrivilegeValueIsNotNull() {
addCriterion("privilege_value is not null");
return (Criteria) this;
}
public Criteria andPrivilegeValueEqualTo(Integer value) {
addCriterion("privilege_value =", value, "privilegeValue");
return (Criteria) this;
}
public Criteria andPrivilegeValueNotEqualTo(Integer value) {
addCriterion("privilege_value <>", value, "privilegeValue");
return (Criteria) this;
}
public Criteria andPrivilegeValueGreaterThan(Integer value) {
addCriterion("privilege_value >", value, "privilegeValue");
return (Criteria) this;
}
public Criteria andPrivilegeValueGreaterThanOrEqualTo(Integer value) {
addCriterion("privilege_value >=", value, "privilegeValue");
return (Criteria) this;
}
public Criteria andPrivilegeValueLessThan(Integer value) {
addCriterion("privilege_value <", value, "privilegeValue");
return (Criteria) this;
}
public Criteria andPrivilegeValueLessThanOrEqualTo(Integer value) {
addCriterion("privilege_value <=", value, "privilegeValue");
return (Criteria) this;
}
public Criteria andPrivilegeValueIn(List<Integer> values) {
addCriterion("privilege_value in", values, "privilegeValue");
return (Criteria) this;
}
public Criteria andPrivilegeValueNotIn(List<Integer> values) {
addCriterion("privilege_value not in", values, "privilegeValue");
return (Criteria) this;
}
public Criteria andPrivilegeValueBetween(Integer value1, Integer value2) {
addCriterion("privilege_value between", value1, value2, "privilegeValue");
return (Criteria) this;
}
public Criteria andPrivilegeValueNotBetween(Integer value1, Integer value2) {
addCriterion("privilege_value not between", value1, value2, "privilegeValue");
return (Criteria) this;
}
public Criteria andPrivilegeExtendIsNull() {
addCriterion("privilege_extend is null");
return (Criteria) this;
}
public Criteria andPrivilegeExtendIsNotNull() {
addCriterion("privilege_extend is not null");
return (Criteria) this;
}
public Criteria andPrivilegeExtendEqualTo(String value) {
addCriterion("privilege_extend =", value, "privilegeExtend");
return (Criteria) this;
}
public Criteria andPrivilegeExtendNotEqualTo(String value) {
addCriterion("privilege_extend <>", value, "privilegeExtend");
return (Criteria) this;
}
public Criteria andPrivilegeExtendGreaterThan(String value) {
addCriterion("privilege_extend >", value, "privilegeExtend");
return (Criteria) this;
}
public Criteria andPrivilegeExtendGreaterThanOrEqualTo(String value) {
addCriterion("privilege_extend >=", value, "privilegeExtend");
return (Criteria) this;
}
public Criteria andPrivilegeExtendLessThan(String value) {
addCriterion("privilege_extend <", value, "privilegeExtend");
return (Criteria) this;
}
public Criteria andPrivilegeExtendLessThanOrEqualTo(String value) {
addCriterion("privilege_extend <=", value, "privilegeExtend");
return (Criteria) this;
}
public Criteria andPrivilegeExtendLike(String value) {
addCriterion("privilege_extend like", value, "privilegeExtend");
return (Criteria) this;
}
public Criteria andPrivilegeExtendNotLike(String value) {
addCriterion("privilege_extend not like", value, "privilegeExtend");
return (Criteria) this;
}
public Criteria andPrivilegeExtendIn(List<String> values) {
addCriterion("privilege_extend in", values, "privilegeExtend");
return (Criteria) this;
}
public Criteria andPrivilegeExtendNotIn(List<String> values) {
addCriterion("privilege_extend not in", values, "privilegeExtend");
return (Criteria) this;
}
public Criteria andPrivilegeExtendBetween(String value1, String value2) {
addCriterion("privilege_extend between", value1, value2, "privilegeExtend");
return (Criteria) this;
}
public Criteria andPrivilegeExtendNotBetween(String value1, String value2) {
addCriterion("privilege_extend not between", value1, value2, "privilegeExtend");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andCreateUserIsNull() {
addCriterion("create_user is null");
return (Criteria) this;
}
public Criteria andCreateUserIsNotNull() {
addCriterion("create_user is not null");
return (Criteria) this;
}
public Criteria andCreateUserEqualTo(String value) {
addCriterion("create_user =", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotEqualTo(String value) {
addCriterion("create_user <>", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserGreaterThan(String value) {
addCriterion("create_user >", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserGreaterThanOrEqualTo(String value) {
addCriterion("create_user >=", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLessThan(String value) {
addCriterion("create_user <", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLessThanOrEqualTo(String value) {
addCriterion("create_user <=", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserLike(String value) {
addCriterion("create_user like", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotLike(String value) {
addCriterion("create_user not like", value, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserIn(List<String> values) {
addCriterion("create_user in", values, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotIn(List<String> values) {
addCriterion("create_user not in", values, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserBetween(String value1, String value2) {
addCriterion("create_user between", value1, value2, "createUser");
return (Criteria) this;
}
public Criteria andCreateUserNotBetween(String value1, String value2) {
addCriterion("create_user not between", value1, value2, "createUser");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Long value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Long value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Long value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Long value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Long value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Long> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Long> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Long value1, Long value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Long value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Long value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Long value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Long value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Long value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Long> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Long> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Long value1, Long value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Long value1, Long value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
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);
}
}
}

View File

@ -0,0 +1,811 @@
package io.dataease.base.domain;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class SysAuthExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public SysAuthExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andAuthSourceIsNull() {
addCriterion("auth_source is null");
return (Criteria) this;
}
public Criteria andAuthSourceIsNotNull() {
addCriterion("auth_source is not null");
return (Criteria) this;
}
public Criteria andAuthSourceEqualTo(String value) {
addCriterion("auth_source =", value, "authSource");
return (Criteria) this;
}
public Criteria andAuthSourceNotEqualTo(String value) {
addCriterion("auth_source <>", value, "authSource");
return (Criteria) this;
}
public Criteria andAuthSourceGreaterThan(String value) {
addCriterion("auth_source >", value, "authSource");
return (Criteria) this;
}
public Criteria andAuthSourceGreaterThanOrEqualTo(String value) {
addCriterion("auth_source >=", value, "authSource");
return (Criteria) this;
}
public Criteria andAuthSourceLessThan(String value) {
addCriterion("auth_source <", value, "authSource");
return (Criteria) this;
}
public Criteria andAuthSourceLessThanOrEqualTo(String value) {
addCriterion("auth_source <=", value, "authSource");
return (Criteria) this;
}
public Criteria andAuthSourceLike(String value) {
addCriterion("auth_source like", value, "authSource");
return (Criteria) this;
}
public Criteria andAuthSourceNotLike(String value) {
addCriterion("auth_source not like", value, "authSource");
return (Criteria) this;
}
public Criteria andAuthSourceIn(List<String> values) {
addCriterion("auth_source in", values, "authSource");
return (Criteria) this;
}
public Criteria andAuthSourceNotIn(List<String> values) {
addCriterion("auth_source not in", values, "authSource");
return (Criteria) this;
}
public Criteria andAuthSourceBetween(String value1, String value2) {
addCriterion("auth_source between", value1, value2, "authSource");
return (Criteria) this;
}
public Criteria andAuthSourceNotBetween(String value1, String value2) {
addCriterion("auth_source not between", value1, value2, "authSource");
return (Criteria) this;
}
public Criteria andAuthSourceTypeIsNull() {
addCriterion("auth_source_type is null");
return (Criteria) this;
}
public Criteria andAuthSourceTypeIsNotNull() {
addCriterion("auth_source_type is not null");
return (Criteria) this;
}
public Criteria andAuthSourceTypeEqualTo(String value) {
addCriterion("auth_source_type =", value, "authSourceType");
return (Criteria) this;
}
public Criteria andAuthSourceTypeNotEqualTo(String value) {
addCriterion("auth_source_type <>", value, "authSourceType");
return (Criteria) this;
}
public Criteria andAuthSourceTypeGreaterThan(String value) {
addCriterion("auth_source_type >", value, "authSourceType");
return (Criteria) this;
}
public Criteria andAuthSourceTypeGreaterThanOrEqualTo(String value) {
addCriterion("auth_source_type >=", value, "authSourceType");
return (Criteria) this;
}
public Criteria andAuthSourceTypeLessThan(String value) {
addCriterion("auth_source_type <", value, "authSourceType");
return (Criteria) this;
}
public Criteria andAuthSourceTypeLessThanOrEqualTo(String value) {
addCriterion("auth_source_type <=", value, "authSourceType");
return (Criteria) this;
}
public Criteria andAuthSourceTypeLike(String value) {
addCriterion("auth_source_type like", value, "authSourceType");
return (Criteria) this;
}
public Criteria andAuthSourceTypeNotLike(String value) {
addCriterion("auth_source_type not like", value, "authSourceType");
return (Criteria) this;
}
public Criteria andAuthSourceTypeIn(List<String> values) {
addCriterion("auth_source_type in", values, "authSourceType");
return (Criteria) this;
}
public Criteria andAuthSourceTypeNotIn(List<String> values) {
addCriterion("auth_source_type not in", values, "authSourceType");
return (Criteria) this;
}
public Criteria andAuthSourceTypeBetween(String value1, String value2) {
addCriterion("auth_source_type between", value1, value2, "authSourceType");
return (Criteria) this;
}
public Criteria andAuthSourceTypeNotBetween(String value1, String value2) {
addCriterion("auth_source_type not between", value1, value2, "authSourceType");
return (Criteria) this;
}
public Criteria andAuthTargetIsNull() {
addCriterion("auth_target is null");
return (Criteria) this;
}
public Criteria andAuthTargetIsNotNull() {
addCriterion("auth_target is not null");
return (Criteria) this;
}
public Criteria andAuthTargetEqualTo(String value) {
addCriterion("auth_target =", value, "authTarget");
return (Criteria) this;
}
public Criteria andAuthTargetNotEqualTo(String value) {
addCriterion("auth_target <>", value, "authTarget");
return (Criteria) this;
}
public Criteria andAuthTargetGreaterThan(String value) {
addCriterion("auth_target >", value, "authTarget");
return (Criteria) this;
}
public Criteria andAuthTargetGreaterThanOrEqualTo(String value) {
addCriterion("auth_target >=", value, "authTarget");
return (Criteria) this;
}
public Criteria andAuthTargetLessThan(String value) {
addCriterion("auth_target <", value, "authTarget");
return (Criteria) this;
}
public Criteria andAuthTargetLessThanOrEqualTo(String value) {
addCriterion("auth_target <=", value, "authTarget");
return (Criteria) this;
}
public Criteria andAuthTargetLike(String value) {
addCriterion("auth_target like", value, "authTarget");
return (Criteria) this;
}
public Criteria andAuthTargetNotLike(String value) {
addCriterion("auth_target not like", value, "authTarget");
return (Criteria) this;
}
public Criteria andAuthTargetIn(List<String> values) {
addCriterion("auth_target in", values, "authTarget");
return (Criteria) this;
}
public Criteria andAuthTargetNotIn(List<String> values) {
addCriterion("auth_target not in", values, "authTarget");
return (Criteria) this;
}
public Criteria andAuthTargetBetween(String value1, String value2) {
addCriterion("auth_target between", value1, value2, "authTarget");
return (Criteria) this;
}
public Criteria andAuthTargetNotBetween(String value1, String value2) {
addCriterion("auth_target not between", value1, value2, "authTarget");
return (Criteria) this;
}
public Criteria andAuthTargetTypeIsNull() {
addCriterion("auth_target_type is null");
return (Criteria) this;
}
public Criteria andAuthTargetTypeIsNotNull() {
addCriterion("auth_target_type is not null");
return (Criteria) this;
}
public Criteria andAuthTargetTypeEqualTo(String value) {
addCriterion("auth_target_type =", value, "authTargetType");
return (Criteria) this;
}
public Criteria andAuthTargetTypeNotEqualTo(String value) {
addCriterion("auth_target_type <>", value, "authTargetType");
return (Criteria) this;
}
public Criteria andAuthTargetTypeGreaterThan(String value) {
addCriterion("auth_target_type >", value, "authTargetType");
return (Criteria) this;
}
public Criteria andAuthTargetTypeGreaterThanOrEqualTo(String value) {
addCriterion("auth_target_type >=", value, "authTargetType");
return (Criteria) this;
}
public Criteria andAuthTargetTypeLessThan(String value) {
addCriterion("auth_target_type <", value, "authTargetType");
return (Criteria) this;
}
public Criteria andAuthTargetTypeLessThanOrEqualTo(String value) {
addCriterion("auth_target_type <=", value, "authTargetType");
return (Criteria) this;
}
public Criteria andAuthTargetTypeLike(String value) {
addCriterion("auth_target_type like", value, "authTargetType");
return (Criteria) this;
}
public Criteria andAuthTargetTypeNotLike(String value) {
addCriterion("auth_target_type not like", value, "authTargetType");
return (Criteria) this;
}
public Criteria andAuthTargetTypeIn(List<String> values) {
addCriterion("auth_target_type in", values, "authTargetType");
return (Criteria) this;
}
public Criteria andAuthTargetTypeNotIn(List<String> values) {
addCriterion("auth_target_type not in", values, "authTargetType");
return (Criteria) this;
}
public Criteria andAuthTargetTypeBetween(String value1, String value2) {
addCriterion("auth_target_type between", value1, value2, "authTargetType");
return (Criteria) this;
}
public Criteria andAuthTargetTypeNotBetween(String value1, String value2) {
addCriterion("auth_target_type not between", value1, value2, "authTargetType");
return (Criteria) this;
}
public Criteria andAuthTimeIsNull() {
addCriterion("auth_time is null");
return (Criteria) this;
}
public Criteria andAuthTimeIsNotNull() {
addCriterion("auth_time is not null");
return (Criteria) this;
}
public Criteria andAuthTimeEqualTo(Long value) {
addCriterion("auth_time =", value, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeNotEqualTo(Long value) {
addCriterion("auth_time <>", value, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeGreaterThan(Long value) {
addCriterion("auth_time >", value, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeGreaterThanOrEqualTo(Long value) {
addCriterion("auth_time >=", value, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeLessThan(Long value) {
addCriterion("auth_time <", value, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeLessThanOrEqualTo(Long value) {
addCriterion("auth_time <=", value, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeIn(List<Long> values) {
addCriterion("auth_time in", values, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeNotIn(List<Long> values) {
addCriterion("auth_time not in", values, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeBetween(Long value1, Long value2) {
addCriterion("auth_time between", value1, value2, "authTime");
return (Criteria) this;
}
public Criteria andAuthTimeNotBetween(Long value1, Long value2) {
addCriterion("auth_time not between", value1, value2, "authTime");
return (Criteria) this;
}
public Criteria andAuthDetailsIsNull() {
addCriterion("auth_details is null");
return (Criteria) this;
}
public Criteria andAuthDetailsIsNotNull() {
addCriterion("auth_details is not null");
return (Criteria) this;
}
public Criteria andAuthDetailsEqualTo(String value) {
addCriterion("auth_details =", value, "authDetails");
return (Criteria) this;
}
public Criteria andAuthDetailsNotEqualTo(String value) {
addCriterion("auth_details <>", value, "authDetails");
return (Criteria) this;
}
public Criteria andAuthDetailsGreaterThan(String value) {
addCriterion("auth_details >", value, "authDetails");
return (Criteria) this;
}
public Criteria andAuthDetailsGreaterThanOrEqualTo(String value) {
addCriterion("auth_details >=", value, "authDetails");
return (Criteria) this;
}
public Criteria andAuthDetailsLessThan(String value) {
addCriterion("auth_details <", value, "authDetails");
return (Criteria) this;
}
public Criteria andAuthDetailsLessThanOrEqualTo(String value) {
addCriterion("auth_details <=", value, "authDetails");
return (Criteria) this;
}
public Criteria andAuthDetailsLike(String value) {
addCriterion("auth_details like", value, "authDetails");
return (Criteria) this;
}
public Criteria andAuthDetailsNotLike(String value) {
addCriterion("auth_details not like", value, "authDetails");
return (Criteria) this;
}
public Criteria andAuthDetailsIn(List<String> values) {
addCriterion("auth_details in", values, "authDetails");
return (Criteria) this;
}
public Criteria andAuthDetailsNotIn(List<String> values) {
addCriterion("auth_details not in", values, "authDetails");
return (Criteria) this;
}
public Criteria andAuthDetailsBetween(String value1, String value2) {
addCriterion("auth_details between", value1, value2, "authDetails");
return (Criteria) this;
}
public Criteria andAuthDetailsNotBetween(String value1, String value2) {
addCriterion("auth_details not between", value1, value2, "authDetails");
return (Criteria) this;
}
public Criteria andAuthUserIsNull() {
addCriterion("auth_user is null");
return (Criteria) this;
}
public Criteria andAuthUserIsNotNull() {
addCriterion("auth_user is not null");
return (Criteria) this;
}
public Criteria andAuthUserEqualTo(String value) {
addCriterion("auth_user =", value, "authUser");
return (Criteria) this;
}
public Criteria andAuthUserNotEqualTo(String value) {
addCriterion("auth_user <>", value, "authUser");
return (Criteria) this;
}
public Criteria andAuthUserGreaterThan(String value) {
addCriterion("auth_user >", value, "authUser");
return (Criteria) this;
}
public Criteria andAuthUserGreaterThanOrEqualTo(String value) {
addCriterion("auth_user >=", value, "authUser");
return (Criteria) this;
}
public Criteria andAuthUserLessThan(String value) {
addCriterion("auth_user <", value, "authUser");
return (Criteria) this;
}
public Criteria andAuthUserLessThanOrEqualTo(String value) {
addCriterion("auth_user <=", value, "authUser");
return (Criteria) this;
}
public Criteria andAuthUserLike(String value) {
addCriterion("auth_user like", value, "authUser");
return (Criteria) this;
}
public Criteria andAuthUserNotLike(String value) {
addCriterion("auth_user not like", value, "authUser");
return (Criteria) this;
}
public Criteria andAuthUserIn(List<String> values) {
addCriterion("auth_user in", values, "authUser");
return (Criteria) this;
}
public Criteria andAuthUserNotIn(List<String> values) {
addCriterion("auth_user not in", values, "authUser");
return (Criteria) this;
}
public Criteria andAuthUserBetween(String value1, String value2) {
addCriterion("auth_user between", value1, value2, "authUser");
return (Criteria) this;
}
public Criteria andAuthUserNotBetween(String value1, String value2) {
addCriterion("auth_user not between", value1, value2, "authUser");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
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);
}
}
}

View File

@ -0,0 +1,27 @@
package io.dataease.base.domain;
import java.io.Serializable;
import lombok.Data;
@Data
public class VAuthModel implements Serializable {
private String id;
private String name;
private String label;
private String pid;
private String nodeType;
private String modelType;
private String modelInnerType;
private String authType;
private String createBy;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,830 @@
package io.dataease.base.domain;
import java.util.ArrayList;
import java.util.List;
public class VAuthModelExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public VAuthModelExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andLabelIsNull() {
addCriterion("`label` is null");
return (Criteria) this;
}
public Criteria andLabelIsNotNull() {
addCriterion("`label` is not null");
return (Criteria) this;
}
public Criteria andLabelEqualTo(String value) {
addCriterion("`label` =", value, "label");
return (Criteria) this;
}
public Criteria andLabelNotEqualTo(String value) {
addCriterion("`label` <>", value, "label");
return (Criteria) this;
}
public Criteria andLabelGreaterThan(String value) {
addCriterion("`label` >", value, "label");
return (Criteria) this;
}
public Criteria andLabelGreaterThanOrEqualTo(String value) {
addCriterion("`label` >=", value, "label");
return (Criteria) this;
}
public Criteria andLabelLessThan(String value) {
addCriterion("`label` <", value, "label");
return (Criteria) this;
}
public Criteria andLabelLessThanOrEqualTo(String value) {
addCriterion("`label` <=", value, "label");
return (Criteria) this;
}
public Criteria andLabelLike(String value) {
addCriterion("`label` like", value, "label");
return (Criteria) this;
}
public Criteria andLabelNotLike(String value) {
addCriterion("`label` not like", value, "label");
return (Criteria) this;
}
public Criteria andLabelIn(List<String> values) {
addCriterion("`label` in", values, "label");
return (Criteria) this;
}
public Criteria andLabelNotIn(List<String> values) {
addCriterion("`label` not in", values, "label");
return (Criteria) this;
}
public Criteria andLabelBetween(String value1, String value2) {
addCriterion("`label` between", value1, value2, "label");
return (Criteria) this;
}
public Criteria andLabelNotBetween(String value1, String value2) {
addCriterion("`label` not between", value1, value2, "label");
return (Criteria) this;
}
public Criteria andPidIsNull() {
addCriterion("pid is null");
return (Criteria) this;
}
public Criteria andPidIsNotNull() {
addCriterion("pid is not null");
return (Criteria) this;
}
public Criteria andPidEqualTo(String value) {
addCriterion("pid =", value, "pid");
return (Criteria) this;
}
public Criteria andPidNotEqualTo(String value) {
addCriterion("pid <>", value, "pid");
return (Criteria) this;
}
public Criteria andPidGreaterThan(String value) {
addCriterion("pid >", value, "pid");
return (Criteria) this;
}
public Criteria andPidGreaterThanOrEqualTo(String value) {
addCriterion("pid >=", value, "pid");
return (Criteria) this;
}
public Criteria andPidLessThan(String value) {
addCriterion("pid <", value, "pid");
return (Criteria) this;
}
public Criteria andPidLessThanOrEqualTo(String value) {
addCriterion("pid <=", value, "pid");
return (Criteria) this;
}
public Criteria andPidLike(String value) {
addCriterion("pid like", value, "pid");
return (Criteria) this;
}
public Criteria andPidNotLike(String value) {
addCriterion("pid not like", value, "pid");
return (Criteria) this;
}
public Criteria andPidIn(List<String> values) {
addCriterion("pid in", values, "pid");
return (Criteria) this;
}
public Criteria andPidNotIn(List<String> values) {
addCriterion("pid not in", values, "pid");
return (Criteria) this;
}
public Criteria andPidBetween(String value1, String value2) {
addCriterion("pid between", value1, value2, "pid");
return (Criteria) this;
}
public Criteria andPidNotBetween(String value1, String value2) {
addCriterion("pid not between", value1, value2, "pid");
return (Criteria) this;
}
public Criteria andNodeTypeIsNull() {
addCriterion("node_type is null");
return (Criteria) this;
}
public Criteria andNodeTypeIsNotNull() {
addCriterion("node_type is not null");
return (Criteria) this;
}
public Criteria andNodeTypeEqualTo(String value) {
addCriterion("node_type =", value, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeNotEqualTo(String value) {
addCriterion("node_type <>", value, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeGreaterThan(String value) {
addCriterion("node_type >", value, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeGreaterThanOrEqualTo(String value) {
addCriterion("node_type >=", value, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeLessThan(String value) {
addCriterion("node_type <", value, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeLessThanOrEqualTo(String value) {
addCriterion("node_type <=", value, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeLike(String value) {
addCriterion("node_type like", value, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeNotLike(String value) {
addCriterion("node_type not like", value, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeIn(List<String> values) {
addCriterion("node_type in", values, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeNotIn(List<String> values) {
addCriterion("node_type not in", values, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeBetween(String value1, String value2) {
addCriterion("node_type between", value1, value2, "nodeType");
return (Criteria) this;
}
public Criteria andNodeTypeNotBetween(String value1, String value2) {
addCriterion("node_type not between", value1, value2, "nodeType");
return (Criteria) this;
}
public Criteria andModelTypeIsNull() {
addCriterion("model_type is null");
return (Criteria) this;
}
public Criteria andModelTypeIsNotNull() {
addCriterion("model_type is not null");
return (Criteria) this;
}
public Criteria andModelTypeEqualTo(String value) {
addCriterion("model_type =", value, "modelType");
return (Criteria) this;
}
public Criteria andModelTypeNotEqualTo(String value) {
addCriterion("model_type <>", value, "modelType");
return (Criteria) this;
}
public Criteria andModelTypeGreaterThan(String value) {
addCriterion("model_type >", value, "modelType");
return (Criteria) this;
}
public Criteria andModelTypeGreaterThanOrEqualTo(String value) {
addCriterion("model_type >=", value, "modelType");
return (Criteria) this;
}
public Criteria andModelTypeLessThan(String value) {
addCriterion("model_type <", value, "modelType");
return (Criteria) this;
}
public Criteria andModelTypeLessThanOrEqualTo(String value) {
addCriterion("model_type <=", value, "modelType");
return (Criteria) this;
}
public Criteria andModelTypeLike(String value) {
addCriterion("model_type like", value, "modelType");
return (Criteria) this;
}
public Criteria andModelTypeNotLike(String value) {
addCriterion("model_type not like", value, "modelType");
return (Criteria) this;
}
public Criteria andModelTypeIn(List<String> values) {
addCriterion("model_type in", values, "modelType");
return (Criteria) this;
}
public Criteria andModelTypeNotIn(List<String> values) {
addCriterion("model_type not in", values, "modelType");
return (Criteria) this;
}
public Criteria andModelTypeBetween(String value1, String value2) {
addCriterion("model_type between", value1, value2, "modelType");
return (Criteria) this;
}
public Criteria andModelTypeNotBetween(String value1, String value2) {
addCriterion("model_type not between", value1, value2, "modelType");
return (Criteria) this;
}
public Criteria andModelInnerTypeIsNull() {
addCriterion("model_inner_type is null");
return (Criteria) this;
}
public Criteria andModelInnerTypeIsNotNull() {
addCriterion("model_inner_type is not null");
return (Criteria) this;
}
public Criteria andModelInnerTypeEqualTo(String value) {
addCriterion("model_inner_type =", value, "modelInnerType");
return (Criteria) this;
}
public Criteria andModelInnerTypeNotEqualTo(String value) {
addCriterion("model_inner_type <>", value, "modelInnerType");
return (Criteria) this;
}
public Criteria andModelInnerTypeGreaterThan(String value) {
addCriterion("model_inner_type >", value, "modelInnerType");
return (Criteria) this;
}
public Criteria andModelInnerTypeGreaterThanOrEqualTo(String value) {
addCriterion("model_inner_type >=", value, "modelInnerType");
return (Criteria) this;
}
public Criteria andModelInnerTypeLessThan(String value) {
addCriterion("model_inner_type <", value, "modelInnerType");
return (Criteria) this;
}
public Criteria andModelInnerTypeLessThanOrEqualTo(String value) {
addCriterion("model_inner_type <=", value, "modelInnerType");
return (Criteria) this;
}
public Criteria andModelInnerTypeLike(String value) {
addCriterion("model_inner_type like", value, "modelInnerType");
return (Criteria) this;
}
public Criteria andModelInnerTypeNotLike(String value) {
addCriterion("model_inner_type not like", value, "modelInnerType");
return (Criteria) this;
}
public Criteria andModelInnerTypeIn(List<String> values) {
addCriterion("model_inner_type in", values, "modelInnerType");
return (Criteria) this;
}
public Criteria andModelInnerTypeNotIn(List<String> values) {
addCriterion("model_inner_type not in", values, "modelInnerType");
return (Criteria) this;
}
public Criteria andModelInnerTypeBetween(String value1, String value2) {
addCriterion("model_inner_type between", value1, value2, "modelInnerType");
return (Criteria) this;
}
public Criteria andModelInnerTypeNotBetween(String value1, String value2) {
addCriterion("model_inner_type not between", value1, value2, "modelInnerType");
return (Criteria) this;
}
public Criteria andAuthTypeIsNull() {
addCriterion("auth_type is null");
return (Criteria) this;
}
public Criteria andAuthTypeIsNotNull() {
addCriterion("auth_type is not null");
return (Criteria) this;
}
public Criteria andAuthTypeEqualTo(String value) {
addCriterion("auth_type =", value, "authType");
return (Criteria) this;
}
public Criteria andAuthTypeNotEqualTo(String value) {
addCriterion("auth_type <>", value, "authType");
return (Criteria) this;
}
public Criteria andAuthTypeGreaterThan(String value) {
addCriterion("auth_type >", value, "authType");
return (Criteria) this;
}
public Criteria andAuthTypeGreaterThanOrEqualTo(String value) {
addCriterion("auth_type >=", value, "authType");
return (Criteria) this;
}
public Criteria andAuthTypeLessThan(String value) {
addCriterion("auth_type <", value, "authType");
return (Criteria) this;
}
public Criteria andAuthTypeLessThanOrEqualTo(String value) {
addCriterion("auth_type <=", value, "authType");
return (Criteria) this;
}
public Criteria andAuthTypeLike(String value) {
addCriterion("auth_type like", value, "authType");
return (Criteria) this;
}
public Criteria andAuthTypeNotLike(String value) {
addCriterion("auth_type not like", value, "authType");
return (Criteria) this;
}
public Criteria andAuthTypeIn(List<String> values) {
addCriterion("auth_type in", values, "authType");
return (Criteria) this;
}
public Criteria andAuthTypeNotIn(List<String> values) {
addCriterion("auth_type not in", values, "authType");
return (Criteria) this;
}
public Criteria andAuthTypeBetween(String value1, String value2) {
addCriterion("auth_type between", value1, value2, "authType");
return (Criteria) this;
}
public Criteria andAuthTypeNotBetween(String value1, String value2) {
addCriterion("auth_type not between", value1, value2, "authType");
return (Criteria) this;
}
public Criteria andCreateByIsNull() {
addCriterion("create_by is null");
return (Criteria) this;
}
public Criteria andCreateByIsNotNull() {
addCriterion("create_by is not null");
return (Criteria) this;
}
public Criteria andCreateByEqualTo(String value) {
addCriterion("create_by =", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotEqualTo(String value) {
addCriterion("create_by <>", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThan(String value) {
addCriterion("create_by >", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThanOrEqualTo(String value) {
addCriterion("create_by >=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThan(String value) {
addCriterion("create_by <", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThanOrEqualTo(String value) {
addCriterion("create_by <=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLike(String value) {
addCriterion("create_by like", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotLike(String value) {
addCriterion("create_by not like", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByIn(List<String> values) {
addCriterion("create_by in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotIn(List<String> values) {
addCriterion("create_by not in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByBetween(String value1, String value2) {
addCriterion("create_by between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotBetween(String value1, String value2) {
addCriterion("create_by not between", value1, value2, "createBy");
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);
}
}
}

View File

@ -0,0 +1,30 @@
package io.dataease.base.mapper;
import io.dataease.base.domain.SysAuthDetail;
import io.dataease.base.domain.SysAuthDetailExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysAuthDetailMapper {
long countByExample(SysAuthDetailExample example);
int deleteByExample(SysAuthDetailExample example);
int deleteByPrimaryKey(String id);
int insert(SysAuthDetail record);
int insertSelective(SysAuthDetail record);
List<SysAuthDetail> selectByExample(SysAuthDetailExample example);
SysAuthDetail selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") SysAuthDetail record, @Param("example") SysAuthDetailExample example);
int updateByExample(@Param("record") SysAuthDetail record, @Param("example") SysAuthDetailExample example);
int updateByPrimaryKeySelective(SysAuthDetail record);
int updateByPrimaryKey(SysAuthDetail record);
}

View File

@ -0,0 +1,291 @@
<?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.SysAuthDetailMapper">
<resultMap id="BaseResultMap" type="io.dataease.base.domain.SysAuthDetail">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="auth_id" jdbcType="VARCHAR" property="authId" />
<result column="privilege_name" jdbcType="VARCHAR" property="privilegeName" />
<result column="privilege_type" jdbcType="INTEGER" property="privilegeType" />
<result column="privilege_value" jdbcType="INTEGER" property="privilegeValue" />
<result column="privilege_extend" jdbcType="VARCHAR" property="privilegeExtend" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, auth_id, privilege_name, privilege_type, privilege_value, privilege_extend, remark,
create_user, create_time, update_time
</sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.SysAuthDetailExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_auth_detail
<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.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_auth_detail
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from sys_auth_detail
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.dataease.base.domain.SysAuthDetailExample">
delete from sys_auth_detail
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.dataease.base.domain.SysAuthDetail">
insert into sys_auth_detail (id, auth_id, privilege_name,
privilege_type, privilege_value, privilege_extend,
remark, create_user, create_time,
update_time)
values (#{id,jdbcType=VARCHAR}, #{authId,jdbcType=VARCHAR}, #{privilegeName,jdbcType=VARCHAR},
#{privilegeType,jdbcType=INTEGER}, #{privilegeValue,jdbcType=INTEGER}, #{privilegeExtend,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.SysAuthDetail">
insert into sys_auth_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="authId != null">
auth_id,
</if>
<if test="privilegeName != null">
privilege_name,
</if>
<if test="privilegeType != null">
privilege_type,
</if>
<if test="privilegeValue != null">
privilege_value,
</if>
<if test="privilegeExtend != null">
privilege_extend,
</if>
<if test="remark != null">
remark,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="authId != null">
#{authId,jdbcType=VARCHAR},
</if>
<if test="privilegeName != null">
#{privilegeName,jdbcType=VARCHAR},
</if>
<if test="privilegeType != null">
#{privilegeType,jdbcType=INTEGER},
</if>
<if test="privilegeValue != null">
#{privilegeValue,jdbcType=INTEGER},
</if>
<if test="privilegeExtend != null">
#{privilegeExtend,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.dataease.base.domain.SysAuthDetailExample" resultType="java.lang.Long">
select count(*) from sys_auth_detail
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_auth_detail
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.authId != null">
auth_id = #{record.authId,jdbcType=VARCHAR},
</if>
<if test="record.privilegeName != null">
privilege_name = #{record.privilegeName,jdbcType=VARCHAR},
</if>
<if test="record.privilegeType != null">
privilege_type = #{record.privilegeType,jdbcType=INTEGER},
</if>
<if test="record.privilegeValue != null">
privilege_value = #{record.privilegeValue,jdbcType=INTEGER},
</if>
<if test="record.privilegeExtend != null">
privilege_extend = #{record.privilegeExtend,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_auth_detail
set id = #{record.id,jdbcType=VARCHAR},
auth_id = #{record.authId,jdbcType=VARCHAR},
privilege_name = #{record.privilegeName,jdbcType=VARCHAR},
privilege_type = #{record.privilegeType,jdbcType=INTEGER},
privilege_value = #{record.privilegeValue,jdbcType=INTEGER},
privilege_extend = #{record.privilegeExtend,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.SysAuthDetail">
update sys_auth_detail
<set>
<if test="authId != null">
auth_id = #{authId,jdbcType=VARCHAR},
</if>
<if test="privilegeName != null">
privilege_name = #{privilegeName,jdbcType=VARCHAR},
</if>
<if test="privilegeType != null">
privilege_type = #{privilegeType,jdbcType=INTEGER},
</if>
<if test="privilegeValue != null">
privilege_value = #{privilegeValue,jdbcType=INTEGER},
</if>
<if test="privilegeExtend != null">
privilege_extend = #{privilegeExtend,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.SysAuthDetail">
update sys_auth_detail
set auth_id = #{authId,jdbcType=VARCHAR},
privilege_name = #{privilegeName,jdbcType=VARCHAR},
privilege_type = #{privilegeType,jdbcType=INTEGER},
privilege_value = #{privilegeValue,jdbcType=INTEGER},
privilege_extend = #{privilegeExtend,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -0,0 +1,30 @@
package io.dataease.base.mapper;
import io.dataease.base.domain.SysAuth;
import io.dataease.base.domain.SysAuthExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysAuthMapper {
long countByExample(SysAuthExample example);
int deleteByExample(SysAuthExample example);
int deleteByPrimaryKey(String id);
int insert(SysAuth record);
int insertSelective(SysAuth record);
List<SysAuth> selectByExample(SysAuthExample example);
SysAuth selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") SysAuth record, @Param("example") SysAuthExample example);
int updateByExample(@Param("record") SysAuth record, @Param("example") SysAuthExample example);
int updateByPrimaryKeySelective(SysAuth record);
int updateByPrimaryKey(SysAuth record);
}

View File

@ -0,0 +1,276 @@
<?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.SysAuthMapper">
<resultMap id="BaseResultMap" type="io.dataease.base.domain.SysAuth">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="auth_source" jdbcType="VARCHAR" property="authSource" />
<result column="auth_source_type" jdbcType="VARCHAR" property="authSourceType" />
<result column="auth_target" jdbcType="VARCHAR" property="authTarget" />
<result column="auth_target_type" jdbcType="VARCHAR" property="authTargetType" />
<result column="auth_time" jdbcType="BIGINT" property="authTime" />
<result column="auth_details" jdbcType="VARCHAR" property="authDetails" />
<result column="auth_user" jdbcType="VARCHAR" property="authUser" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, auth_source, auth_source_type, auth_target, auth_target_type, auth_time, auth_details,
auth_user, update_time
</sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.SysAuthExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_auth
<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.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_auth
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from sys_auth
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.dataease.base.domain.SysAuthExample">
delete from sys_auth
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.dataease.base.domain.SysAuth">
insert into sys_auth (id, auth_source, auth_source_type,
auth_target, auth_target_type, auth_time,
auth_details, auth_user, update_time
)
values (#{id,jdbcType=VARCHAR}, #{authSource,jdbcType=VARCHAR}, #{authSourceType,jdbcType=VARCHAR},
#{authTarget,jdbcType=VARCHAR}, #{authTargetType,jdbcType=VARCHAR}, #{authTime,jdbcType=BIGINT},
#{authDetails,jdbcType=VARCHAR}, #{authUser,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.SysAuth">
insert into sys_auth
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="authSource != null">
auth_source,
</if>
<if test="authSourceType != null">
auth_source_type,
</if>
<if test="authTarget != null">
auth_target,
</if>
<if test="authTargetType != null">
auth_target_type,
</if>
<if test="authTime != null">
auth_time,
</if>
<if test="authDetails != null">
auth_details,
</if>
<if test="authUser != null">
auth_user,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="authSource != null">
#{authSource,jdbcType=VARCHAR},
</if>
<if test="authSourceType != null">
#{authSourceType,jdbcType=VARCHAR},
</if>
<if test="authTarget != null">
#{authTarget,jdbcType=VARCHAR},
</if>
<if test="authTargetType != null">
#{authTargetType,jdbcType=VARCHAR},
</if>
<if test="authTime != null">
#{authTime,jdbcType=BIGINT},
</if>
<if test="authDetails != null">
#{authDetails,jdbcType=VARCHAR},
</if>
<if test="authUser != null">
#{authUser,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.dataease.base.domain.SysAuthExample" resultType="java.lang.Long">
select count(*) from sys_auth
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_auth
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.authSource != null">
auth_source = #{record.authSource,jdbcType=VARCHAR},
</if>
<if test="record.authSourceType != null">
auth_source_type = #{record.authSourceType,jdbcType=VARCHAR},
</if>
<if test="record.authTarget != null">
auth_target = #{record.authTarget,jdbcType=VARCHAR},
</if>
<if test="record.authTargetType != null">
auth_target_type = #{record.authTargetType,jdbcType=VARCHAR},
</if>
<if test="record.authTime != null">
auth_time = #{record.authTime,jdbcType=BIGINT},
</if>
<if test="record.authDetails != null">
auth_details = #{record.authDetails,jdbcType=VARCHAR},
</if>
<if test="record.authUser != null">
auth_user = #{record.authUser,jdbcType=VARCHAR},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_auth
set id = #{record.id,jdbcType=VARCHAR},
auth_source = #{record.authSource,jdbcType=VARCHAR},
auth_source_type = #{record.authSourceType,jdbcType=VARCHAR},
auth_target = #{record.authTarget,jdbcType=VARCHAR},
auth_target_type = #{record.authTargetType,jdbcType=VARCHAR},
auth_time = #{record.authTime,jdbcType=BIGINT},
auth_details = #{record.authDetails,jdbcType=VARCHAR},
auth_user = #{record.authUser,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.SysAuth">
update sys_auth
<set>
<if test="authSource != null">
auth_source = #{authSource,jdbcType=VARCHAR},
</if>
<if test="authSourceType != null">
auth_source_type = #{authSourceType,jdbcType=VARCHAR},
</if>
<if test="authTarget != null">
auth_target = #{authTarget,jdbcType=VARCHAR},
</if>
<if test="authTargetType != null">
auth_target_type = #{authTargetType,jdbcType=VARCHAR},
</if>
<if test="authTime != null">
auth_time = #{authTime,jdbcType=BIGINT},
</if>
<if test="authDetails != null">
auth_details = #{authDetails,jdbcType=VARCHAR},
</if>
<if test="authUser != null">
auth_user = #{authUser,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.SysAuth">
update sys_auth
set auth_source = #{authSource,jdbcType=VARCHAR},
auth_source_type = #{authSourceType,jdbcType=VARCHAR},
auth_target = #{authTarget,jdbcType=VARCHAR},
auth_target_type = #{authTargetType,jdbcType=VARCHAR},
auth_time = #{authTime,jdbcType=BIGINT},
auth_details = #{authDetails,jdbcType=VARCHAR},
auth_user = #{authUser,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -0,0 +1,22 @@
package io.dataease.base.mapper;
import io.dataease.base.domain.VAuthModel;
import io.dataease.base.domain.VAuthModelExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface VAuthModelMapper {
long countByExample(VAuthModelExample example);
int deleteByExample(VAuthModelExample example);
int insert(VAuthModel record);
int insertSelective(VAuthModel record);
List<VAuthModel> selectByExample(VAuthModelExample example);
int updateByExampleSelective(@Param("record") VAuthModel record, @Param("example") VAuthModelExample example);
int updateByExample(@Param("record") VAuthModel record, @Param("example") VAuthModelExample example);
}

View File

@ -0,0 +1,223 @@
<?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.VAuthModelMapper">
<resultMap id="BaseResultMap" type="io.dataease.base.domain.VAuthModel">
<result column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="label" jdbcType="VARCHAR" property="label" />
<result column="pid" jdbcType="VARCHAR" property="pid" />
<result column="node_type" jdbcType="VARCHAR" property="nodeType" />
<result column="model_type" jdbcType="VARCHAR" property="modelType" />
<result column="model_inner_type" jdbcType="VARCHAR" property="modelInnerType" />
<result column="auth_type" jdbcType="VARCHAR" property="authType" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, `name`, `label`, pid, node_type, model_type, model_inner_type, auth_type, create_by
</sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.VAuthModelExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from v_auth_model
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<delete id="deleteByExample" parameterType="io.dataease.base.domain.VAuthModelExample">
delete from v_auth_model
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.dataease.base.domain.VAuthModel">
insert into v_auth_model (id, `name`, `label`,
pid, node_type, model_type,
model_inner_type, auth_type, create_by
)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{label,jdbcType=VARCHAR},
#{pid,jdbcType=VARCHAR}, #{nodeType,jdbcType=VARCHAR}, #{modelType,jdbcType=VARCHAR},
#{modelInnerType,jdbcType=VARCHAR}, #{authType,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.VAuthModel">
insert into v_auth_model
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
`name`,
</if>
<if test="label != null">
`label`,
</if>
<if test="pid != null">
pid,
</if>
<if test="nodeType != null">
node_type,
</if>
<if test="modelType != null">
model_type,
</if>
<if test="modelInnerType != null">
model_inner_type,
</if>
<if test="authType != null">
auth_type,
</if>
<if test="createBy != null">
create_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="label != null">
#{label,jdbcType=VARCHAR},
</if>
<if test="pid != null">
#{pid,jdbcType=VARCHAR},
</if>
<if test="nodeType != null">
#{nodeType,jdbcType=VARCHAR},
</if>
<if test="modelType != null">
#{modelType,jdbcType=VARCHAR},
</if>
<if test="modelInnerType != null">
#{modelInnerType,jdbcType=VARCHAR},
</if>
<if test="authType != null">
#{authType,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.dataease.base.domain.VAuthModelExample" resultType="java.lang.Long">
select count(*) from v_auth_model
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update v_auth_model
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.label != null">
`label` = #{record.label,jdbcType=VARCHAR},
</if>
<if test="record.pid != null">
pid = #{record.pid,jdbcType=VARCHAR},
</if>
<if test="record.nodeType != null">
node_type = #{record.nodeType,jdbcType=VARCHAR},
</if>
<if test="record.modelType != null">
model_type = #{record.modelType,jdbcType=VARCHAR},
</if>
<if test="record.modelInnerType != null">
model_inner_type = #{record.modelInnerType,jdbcType=VARCHAR},
</if>
<if test="record.authType != null">
auth_type = #{record.authType,jdbcType=VARCHAR},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update v_auth_model
set id = #{record.id,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
`label` = #{record.label,jdbcType=VARCHAR},
pid = #{record.pid,jdbcType=VARCHAR},
node_type = #{record.nodeType,jdbcType=VARCHAR},
model_type = #{record.modelType,jdbcType=VARCHAR},
model_inner_type = #{record.modelInnerType,jdbcType=VARCHAR},
auth_type = #{record.authType,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
</mapper>

View File

@ -11,6 +11,7 @@
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="enabled" property="enabled" />
<result column="is_admin" jdbcType="BIT" property="isAdmin" />
</resultMap>
<resultMap id="roleMap" type="io.dataease.auth.api.dto.CurrentRoleDto" >
@ -20,11 +21,11 @@
<select id="findUser" resultMap="baseMap">
select user_id, username,nick_name, dept_id, password, enabled,email, phone from sys_user where user_id = #{userId}
select user_id, username,nick_name, dept_id, password, enabled,email, phone,is_admin from sys_user where user_id = #{userId}
</select>
<select id="findUserByName" resultMap="baseMap">
select user_id, username,nick_name, dept_id, password, enabled,email, phone from sys_user where username = #{username}
select user_id, username,nick_name, dept_id, password, enabled,email, phone,is_admin from sys_user where username = #{username}
</select>
<select id="roleCodes" resultType="String">

View File

@ -0,0 +1,11 @@
package io.dataease.base.mapper.ext;
import io.dataease.controller.request.BaseTreeRequest;
import io.dataease.controller.request.chart.ChartGroupRequest;
import io.dataease.dto.chart.ChartGroupDTO;
import java.util.List;
public interface ExtChartGroupMapper {
List<ChartGroupDTO> search(ChartGroupRequest ChartGroup);
}

View File

@ -0,0 +1,47 @@
<?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.ExtChartGroupMapper">
<resultMap id="BaseResultMapDTO" type="io.dataease.dto.chart.ChartGroupDTO"
extends="io.dataease.base.mapper.ChartGroupMapper.BaseResultMap">
<result column="label" property="label"/>
<result column="privileges" property="privileges"/>
</resultMap>
<select id="search" resultMap="BaseResultMapDTO">
select
id, `name`, pid, `level`, `type`, create_by, create_time,`name` as label,
get_auths(id,'chart',#{userId}) as `privileges`
from chart_group
<where>
FIND_IN_SET(chart_group.id,GET_V_AUTH_MODEL_ID_P_USE(#{userId},'chart'))
<if test="id != null">
and chart_group.id = #{id,jdbcType=VARCHAR}
</if>
<if test="name != null and name != ''">
and chart_group.`name` = CONCAT('%', #{name},'%')
</if>
<if test="pid != null">
and chart_group.pid = #{pid,jdbcType=VARCHAR}
</if>
<if test="level != null">
and chart_group.`level` = #{level,jdbcType=INTEGER}
</if>
<if test="type != null and type != ''">
and chart_group.`type` = #{type,jdbcType=VARCHAR}
</if>
<if test="createBy != null">
and chart_group.create_by = #{createBy,jdbcType=VARCHAR}
</if>
<if test="createTime != null">
and chart_group.create_time = #{createTime,jdbcType=BIGINT}
</if>
</where>
<if test="sort != null">
order by ${sort}
</if>
</select>
</mapper>

View File

@ -0,0 +1,10 @@
package io.dataease.base.mapper.ext;
import io.dataease.controller.request.chart.ChartViewRequest;
import io.dataease.dto.chart.ChartViewDTO;
import java.util.List;
public interface ExtChartViewMapper {
List<ChartViewDTO> search(ChartViewRequest request);
}

View File

@ -0,0 +1,30 @@
<?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.ExtChartViewMapper">
<resultMap id="BaseResultMapDTO" type="io.dataease.dto.chart.ChartViewDTO"
extends="io.dataease.base.mapper.ChartViewMapper.ResultMapWithBLOBs">
<result column="label" property="label"/>
<result column="privileges" property="privileges"/>
</resultMap>
<select id="search" resultMap="BaseResultMapDTO">
select
id, `name`, scene_id, table_id, `type`, title, create_by, create_time, update_time,
style_priority,x_axis, y_axis, custom_attr, custom_style, custom_filter, snapshot,
get_auths(id,'chart',#{userId}) as `privileges`
from chart_view
<where>
FIND_IN_SET(chart_view.id,GET_V_AUTH_MODEL_ID_P_USE(#{userId},'chart'))
<if test="sceneId != null">
and scene_id = #{sceneId,jdbcType=VARCHAR}
</if>
</where>
<if test="sort != null">
order by ${sort}
</if>
</select>
</mapper>

View File

@ -0,0 +1,10 @@
package io.dataease.base.mapper.ext;
import io.dataease.controller.request.dataset.DataSetGroupRequest;
import io.dataease.dto.dataset.DataSetGroupDTO;
import java.util.List;
public interface ExtDataSetGroupMapper {
List<DataSetGroupDTO> search(DataSetGroupRequest ChartGroup);
}

View File

@ -0,0 +1,47 @@
<?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.ExtDataSetGroupMapper">
<resultMap id="BaseResultMapDTO" type="io.dataease.dto.dataset.DataSetGroupDTO"
extends="io.dataease.base.mapper.DatasetGroupMapper.BaseResultMap">
<result column="label" property="label"/>
<result column="privileges" property="privileges"/>
</resultMap>
<select id="search" resultMap="BaseResultMapDTO">
select
id, `name`, pid, `level`, `type`, create_by, create_time,`name` as label,
get_auths(id,'dataset',#{userId}) as `privileges`
from dataset_group
<where>
FIND_IN_SET(dataset_group.id,GET_V_AUTH_MODEL_ID_P_USE(#{userId},'dataset'))
<if test="id != null">
and dataset_group.id = #{id,jdbcType=VARCHAR}
</if>
<if test="name != null and name != ''">
and dataset_group.`name` = CONCAT('%', #{name},'%')
</if>
<if test="pid != null">
and dataset_group.pid = #{pid,jdbcType=VARCHAR}
</if>
<if test="level != null">
and dataset_group.`level` = #{level,jdbcType=INTEGER}
</if>
<if test="type != null and type != ''">
and dataset_group.`type` = #{type,jdbcType=VARCHAR}
</if>
<if test="createBy != null">
and dataset_group.create_by = #{createBy,jdbcType=VARCHAR}
</if>
<if test="createTime != null">
and dataset_group.create_time = #{createTime,jdbcType=BIGINT}
</if>
</where>
<if test="sort != null">
order by ${sort}
</if>
</select>
</mapper>

View File

@ -0,0 +1,10 @@
package io.dataease.base.mapper.ext;
import io.dataease.controller.request.dataset.DataSetTableRequest;
import io.dataease.dto.dataset.DataSetTableDTO;
import java.util.List;
public interface ExtDataSetTableMapper {
List<DataSetTableDTO> search(DataSetTableRequest request);
}

View File

@ -0,0 +1,28 @@
<?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.ExtDataSetTableMapper">
<resultMap id="BaseResultMapDTO" type="io.dataease.dto.dataset.DataSetTableDTO"
extends="io.dataease.base.mapper.DatasetTableMapper.ResultMapWithBLOBs">
<result column="privileges" property="privileges"/>
</resultMap>
<select id="search" resultMap="BaseResultMapDTO">
select
id, `name`, scene_id, data_source_id, `type`, `mode`, create_by, create_time,
get_auths(id,'dataset',#{userId}) as `privileges`
from dataset_table
<where>
FIND_IN_SET(dataset_table.id,GET_V_AUTH_MODEL_ID_P_USE(#{userId},'dataset'))
<if test="sceneId != null">
and scene_id = #{sceneId,jdbcType=VARCHAR}
</if>
</where>
<if test="sort != null">
order by ${sort}
</if>
</select>
</mapper>

View File

@ -1,11 +1,17 @@
package io.dataease.base.mapper.ext;
import io.dataease.base.domain.Datasource;
import io.dataease.base.mapper.ext.query.GridExample;
import io.dataease.controller.request.DatasourceUnionRequest;
import io.dataease.dto.DatasourceDTO;
import java.util.List;
public interface ExtDataSourceMapper {
List<Datasource> query(GridExample example);
List<DatasourceDTO> query(GridExample example);
List<DatasourceDTO> queryUnion(DatasourceUnionRequest request);
}

View File

@ -2,17 +2,19 @@
<!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.ExtDataSourceMapper">
<resultMap id="BaseResultMapDTO" type="io.dataease.dto.DatasourceDTO"
extends="io.dataease.base.mapper.DatasourceMapper.ResultMapWithBLOBs">
<result column="privileges" property="privileges"/>
</resultMap>
<select id="query" parameterType="io.dataease.base.mapper.ext.query.GridExample" resultMap="io.dataease.base.mapper.DatasourceMapper.BaseResultMap">
select id , name , `desc` ,`type` , configuration ,create_time ,update_time from datasource
<select id="query" parameterType="io.dataease.base.mapper.ext.query.GridExample" resultMap="BaseResultMapDTO">
select id , name , `desc` ,`type` , configuration ,create_time ,update_time,
get_auths(id,'link',#{extendCondition}) as `privileges`
from datasource
<if test="_parameter != null">
<include refid="io.dataease.base.mapper.ext.query.GridSql.gridCondition" />
</if>
and FIND_IN_SET(datasource.id,GET_V_AUTH_MODEL_ID_P_USE(#{extendCondition},'link'))
<if test="orderByClause != null">
order by ${orderByClause}
</if>
@ -21,5 +23,37 @@
</if>
</select>
<select id="queryUnion" resultMap="BaseResultMapDTO">
select id , name , `desc` ,`type` , configuration ,create_time ,update_time
from datasource
<where>
FIND_IN_SET(datasource.id,GET_V_AUTH_MODEL_ID_P_USE(#{userId},'link'))
<if test="id != null">
id = #{id,jdbcType=VARCHAR}
</if>
<if test="name != null">
`name` = concat('%',#{name,jdbcType=VARCHAR},'%')
</if>
<if test="desc != null">
`desc` = #{desc,jdbcType=VARCHAR}
</if>
<if test="type != null">
`type` = #{type,jdbcType=VARCHAR}
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT}
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT}
</if>
<if test="configuration != null">
configuration = #{configuration,jdbcType=LONGVARCHAR}
</if>
</where>
<if test="sort == null">
order by ${sort}
</if>
</select>
</mapper>

View File

@ -1,7 +1,9 @@
package io.dataease.base.mapper.ext;
import io.dataease.base.mapper.ext.query.GridExample;
import io.dataease.controller.request.BaseTreeRequest;
import io.dataease.controller.sys.request.SimpleTreeNode;
import io.dataease.dto.SysDeptDTO;
import org.apache.ibatis.annotations.*;
import java.util.List;
@ -26,4 +28,7 @@ public interface ExtDeptMapper {
List<SimpleTreeNode> allNodes();
List<SimpleTreeNode> nodesByExample(GridExample example);
List<SysDeptDTO> searchTree(BaseTreeRequest request);
}

View File

@ -5,6 +5,7 @@
<resultMap id="BaseResultMapDTO" type="io.dataease.dto.panel.PanelGroupDTO"
extends="io.dataease.base.mapper.PanelGroupMapper.BaseResultMap">
<result column="label" jdbcType="VARCHAR" property="label"/>
<result column="privileges" jdbcType="VARCHAR" property="privileges"/>
</resultMap>
<select id="panelGroup" resultMap="BaseResultMapDTO">
@ -12,8 +13,50 @@
</select>
<select id="panelGroupList" resultMap="BaseResultMapDTO">
select id, `name`, pid, `level`, node_type, create_by, create_time, panel_type,`name` as label from panel_group
SELECT
id,
`name`,
pid,
`level`,
node_type,
create_by,
create_time,
panel_type,
`name` AS label,
authInfo.`privileges`
from panel_group
left join
(SELECT
`sys_auth`.`auth_source` AS `auth_source`,
`sys_auth`.`auth_source_type` AS `auth_source_type`,
group_concat( sys_auth_detail.privilege_extend) AS `privileges`
FROM
(
`sys_auth`
LEFT JOIN `sys_auth_detail` ON ((
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
)))
where sys_auth_detail.privilege_value =1
AND (
(
sys_auth.auth_target_type = 'dept'
AND sys_auth.auth_target = ( SELECT dept_id FROM sys_user WHERE user_id = #{userId} )
)
OR (
sys_auth.auth_target_type = 'user'
AND sys_auth.auth_target = #{userId}
)
OR (
sys_auth.auth_target_type = 'role'
AND sys_auth.auth_target = ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId} )
)
)
GROUP BY
`sys_auth`.`auth_source`,
`sys_auth`.`auth_source_type`) authInfo
on panel_group.id = authInfo.auth_source and authInfo.auth_source_type='panel'
<where>
FIND_IN_SET(panel_group.id,GET_V_AUTH_MODEL_ID_P_USE(#{userId},'panel'))
<if test="name != null">
and panel_group.name like CONCAT('%', #{name},'%')
</if>

View File

@ -0,0 +1,17 @@
package io.dataease.base.mapper.ext;
import io.dataease.base.domain.SysAuthDetail;
import io.dataease.controller.request.SysAuthDetailRequest;
import io.dataease.controller.request.SysAuthRequest;
import io.dataease.dto.SysAuthDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtSysAuthDetailMapper {
List<SysAuthDetail> searchAuthTypeModel(@Param("authTypeModel") String authTypeModel);
void copyAuthModel(@Param("authTypeModel") String authTypeModel,@Param("authId") String authId,@Param("createUser") String createUser);
void authDetailsChange(@Param("privilegeValue")Integer privilegeValue,@Param("privilegeType")Integer privilegeType,@Param("authIds")List<String> authIds);
}

View File

@ -0,0 +1,54 @@
<?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.ExtSysAuthDetailMapper">
<select id="searchAuthTypeModel" resultMap="io.dataease.base.mapper.SysAuthDetailMapper.BaseResultMap">
select
sys_auth_detail.privilege_name ,
sys_auth_detail.privilege_type ,
sys_auth_detail.privilege_value
from sys_auth_detail where sys_auth_detail.auth_id =#{authTypeModel} order by sys_auth_detail.privilege_type desc
</select>
<insert id="copyAuthModel">
INSERT INTO sys_auth_detail (
id,
auth_id,
privilege_name,
privilege_type,
privilege_value,
privilege_extend,
remark,
create_user,
create_time
) SELECT
uuid() AS id,
#{authId} AS auth_id,
sys_auth_detail.privilege_name,
sys_auth_detail.privilege_type,
sys_auth_detail.privilege_value,
sys_auth_detail.privilege_extend,
sys_auth_detail.remark,
#{createUser} AS create_user,
unix_timestamp(now())* 1000 AS create_time
FROM
sys_auth_detail where auth_id =#{authTypeModel}
</insert>
<update id="authDetailsChange">
UPDATE sys_auth_detail
SET privilege_value = #{privilegeValue}
<where>
auth_id in
<foreach collection='authIds' item='authId' open='(' separator=',' close=')'>#{authId}</foreach>
<if test="privilegeValue == 1">
and privilege_type &lt;= #{privilegeType}
</if>
<if test="privilegeValue == 0">
and privilege_type &gt;= #{privilegeType}
</if>
</where>
</update>
</mapper>

View File

@ -0,0 +1,20 @@
package io.dataease.base.mapper.ext;
import io.dataease.controller.request.SysAuthRequest;
import io.dataease.dto.SysAuthDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ExtSysAuthMapper {
List<SysAuthDTO> searchAuth(SysAuthRequest request);
Boolean authExist(@Param("authSource") String authSource, @Param("authTarget") String authTarget);
String findAuthId(@Param("authSource") String authSource,
@Param("authSourceType") String authSourceType,
@Param("authTarget") String authTarget,
@Param("authTargetType") String authTargetType);
}

View File

@ -0,0 +1,75 @@
<?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.ExtSysAuthMapper">
<resultMap id="BaseResultMapDTO" type="io.dataease.dto.SysAuthDTO"
extends="io.dataease.base.mapper.SysAuthMapper.BaseResultMap">
<collection property="sysAuthDetails" ofType="io.dataease.base.domain.SysAuthDetail" javaType="list">
<result column="auth_id" property="authId"/>
<result column="privilege_name" property="privilegeName"/>
<result column="privilege_type" property="privilegeType"/>
<result column="privilege_value" property="privilegeValue"/>
<result column="privilege_extend" property="privilegeExtend"/>
</collection>
</resultMap>
<select id="searchAuth" resultMap="BaseResultMapDTO">
select
sys_auth.id,
sys_auth.auth_source,
sys_auth.auth_source_type,
sys_auth.auth_target,
sys_auth.auth_target_type,
sys_auth.auth_time,
sys_auth.auth_details,
sys_auth.auth_user,
sys_auth.update_time,
sys_auth_detail.auth_id,
sys_auth_detail.auth_id ,
sys_auth_detail.privilege_name ,
sys_auth_detail.privilege_type ,
sys_auth_detail.privilege_value ,
sys_auth_detail.privilege_extend
from sys_auth left join sys_auth_detail on sys_auth.id = sys_auth_detail.auth_id
<where>
sys_auth_detail.auth_id is not null
<if test="authSources != null and authSources.size > 0">
and sys_auth.auth_source in
<foreach collection="authSources" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="authTargets != null and authTargets.size > 0">
and sys_auth.auth_target in
<foreach collection="authTargets" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="authSource != null">
and sys_auth.auth_source=#{authSource}
</if>
<if test="authSourceType != null">
and sys_auth.auth_source_type=#{authSourceType}
</if>
<if test="authTarget != null">
and sys_auth.auth_target=#{authTarget}
</if>
<if test="authTargetType != null">
and sys_auth.auth_target_type=#{authTargetType}
</if>
</where>
order by sys_auth_detail.privilege_type desc
</select>
<select id="authExist" resultType="Boolean">
select if(count(1)=0,0,1) from sys_auth where auth_source=#{authSource} and auth_target=#{authTarget}
</select>
<select id="findAuthId" resultType="String">
select id from sys_auth where auth_source=#{authSource} and auth_source_type=#{authSourceType} and auth_target=#{authTarget} and auth_target_type=#{authTargetType} limit 1
</select>
</mapper>

View File

@ -0,0 +1,10 @@
package io.dataease.base.mapper.ext;
import io.dataease.controller.request.BaseTreeRequest;
import io.dataease.dto.VAuthModelDTO;
import java.util.List;
public interface ExtVAuthModelMapper {
List<VAuthModelDTO> searchTree(BaseTreeRequest request);
}

View File

@ -0,0 +1,72 @@
<?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.ExtVAuthModelMapper">
<resultMap id="BaseResultMapDTO" type="io.dataease.dto.VAuthModelDTO"
extends="io.dataease.base.mapper.VAuthModelMapper.BaseResultMap">
<result column="children_count" property="childrenCount"/>
<result column="leaf" property="leaf"/>
</resultMap>
<select id="searchTree" resultMap="BaseResultMapDTO">
SELECT
auth.*,
authCount.children_count AS children_count,
IF
(( authCount.children_count > 0 ), 0, 1 ) AS leaf
FROM
( SELECT * FROM v_auth_model
<where>
model_type = #{modelType}
<if test="createBy != null">
and ( v_auth_model.type ='spine' OR ( v_auth_model.create_by = #{createBy} AND v_auth_model.type = 'leaf'))
</if>
<if test="pid !=null">
and v_auth_model.pid = #{pid}
</if>
<if test="withExtend == null and id != null">
and v_auth_model.id = #{id}
</if>
<if test="withExtend == 'parent' and id != null">
and FIND_IN_SET(v_auth_model.id,GET_V_AUTH_MODEL_WITH_PARENT(#{id},#{modelType}))
</if>
<if test="withExtend == 'children' and id != null">
and FIND_IN_SET(v_auth_model.id,GET_V_AUTH_MODEL_WITH_CHILDREN(#{id},#{modelType}))
</if>
<if test="name != null and name !='' and withExtend == 'parent'">
and FIND_IN_SET(v_auth_model.id,GET_V_AUTH_MODEL_WITH_PARENT ( (select GROUP_CONCAT(id) from v_auth_model where model_type = #{modelType} and `name` like CONCAT('%', #{name},'%')) ,#{modelType}))
</if>
<if test="name != null and name =='' and withExtend == 'parent'">
and v_auth_model.pid = '0'
</if>
</where>
) auth
LEFT JOIN (
SELECT
count( 1 ) AS `children_count`,
`authTemp`.`pid` AS `pid`
FROM
( SELECT * FROM v_auth_model
<where>
model_type = #{modelType}
<if test="createBy != null">
and ( v_auth_model.type ='spine' OR ( v_auth_model.create_by = #{createBy} AND v_auth_model.type = 'leaf'))
</if>
</where>
) authTemp
GROUP BY
authTemp.pid
) authCount ON
auth.id = authCount.pid
<where>
<if test="createBy != null">
(chartcount.children_count>0 or chart.create_by = #{createBy})
</if>
</where>
</select>
</mapper>

View File

@ -13,10 +13,20 @@ public class GridExample {
protected List<Criteria> oredCriteria;
protected String extendCondition;
public GridExample() {
oredCriteria = new ArrayList<Criteria>();
}
public String getExtendCondition() {
return extendCondition;
}
public void setExtendCondition(String extendCondition) {
this.extendCondition = extendCondition;
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}

View File

@ -0,0 +1,22 @@
package io.dataease.commons.constants;
/**
* Author: wangjiahao
* Date: 2021-03-22
* Description:
*/
public class SystemConstants {
public final static String WITH_EXTEND_NOW = "now";
public final static String WITH_EXTEND_PARENT = "parent";
public final static String WITH_EXTEND_CHILDREN = "children";
public final static int PRIVILEGE_VALUE_ON= 1;
public final static int PRIVILEGE_VALUE_OFF = 0;
}

View File

@ -28,7 +28,7 @@ public class ChartViewController {
}
@PostMapping("/list")
public List<ChartViewWithBLOBs> list(@RequestBody ChartViewRequest chartViewRequest) {
public List<ChartViewDTO> list(@RequestBody ChartViewRequest chartViewRequest) {
return chartViewService.list(chartViewRequest);
}

View File

@ -5,6 +5,7 @@ import io.dataease.base.domain.DatasetTableField;
import io.dataease.base.domain.DatasetTableIncrementalConfig;
import io.dataease.controller.request.dataset.DataSetTableRequest;
import io.dataease.datasource.dto.TableFiled;
import io.dataease.dto.dataset.DataSetTableDTO;
import io.dataease.service.dataset.DataSetTableService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -39,7 +40,7 @@ public class DataSetTableController {
}
@PostMapping("list")
public List<DatasetTable> list(@RequestBody DataSetTableRequest dataSetTableRequest) {
public List<DataSetTableDTO> list(@RequestBody DataSetTableRequest dataSetTableRequest) {
return dataSetTableService.list(dataSetTableRequest);
}

View File

@ -52,9 +52,5 @@ public class PanelGroupController {
return panelGroupService.findOne(id);
}
@PostMapping("/saveGroupWithDesign")
public void saveGroupWithDesign(@RequestBody PanelGroupRequest request) {
panelGroupService.saveGroupWithDesign(request);
}
}

View File

@ -0,0 +1,37 @@
package io.dataease.controller.request;
import io.dataease.commons.constants.SystemConstants;
import lombok.Data;
/**
* Author: wangjiahao
* Date: 2021-05-11
* Description:
*/
@Data
public class BaseTreeRequest {
private String id;
private String name;
//授权资源类型 egchart role
private String modelType;
//pid 为0 查询的是顶级节点 SQL需要相应的处理
private String pid;
//now 返回当前条件查询的数据 parent 返回当前数据查询的数据同时递归父节点数据; children 返回当前数据查询的数据同时递归子节点数据
private String withExtend= SystemConstants.WITH_EXTEND_NOW;
private String createBy;
public BaseTreeRequest() {
}
public BaseTreeRequest(String id,String modelType, String withExtend) {
this.id = id;
this.modelType = modelType;
this.withExtend = withExtend;
}
}

View File

@ -0,0 +1,18 @@
package io.dataease.controller.request;
import io.dataease.base.domain.Datasource;
import lombok.Data;
/**
* Author: wangjiahao
* Date: 2021-05-18
* Description:
*/
@Data
public class DatasourceUnionRequest extends Datasource {
private String userId;
private String sort;
}

View File

@ -0,0 +1,11 @@
package io.dataease.controller.request;
import io.dataease.base.domain.SysAuthDetail;
/**
* Author: wangjiahao
* Date: 2021-05-13
* Description:
*/
public class SysAuthDetailRequest extends SysAuthDetail {
}

View File

@ -0,0 +1,24 @@
package io.dataease.controller.request;
import io.dataease.base.domain.SysAuth;
import io.dataease.base.domain.SysAuthDetail;
import lombok.Data;
import java.util.List;
/**
* Author: wangjiahao
* Date: 2021-05-11
* Description:
*/
@Data
public class SysAuthRequest extends SysAuth {
private List<String> authSources;
private List<String> authTargets;
private SysAuthDetail authDetail;
}

View File

@ -8,4 +8,5 @@ import lombok.Data;
@Data
public class ChartGroupRequest extends ChartGroup {
private String sort;
private String userId;
}

View File

@ -12,4 +12,6 @@ import lombok.Setter;
@Getter
public class ChartViewRequest extends ChartViewWithBLOBs {
private String sort;
private String userId;
}

View File

@ -10,4 +10,6 @@ import lombok.Data;
@Data
public class DataSetGroupRequest extends DatasetGroup {
private String sort;
private String userId;
}

View File

@ -16,4 +16,6 @@ public class DataSetTableRequest extends DatasetTable {
private String sort;
private List<String> tableNames;
private String row = "1000";
private String userId;
}

View File

@ -13,10 +13,13 @@ import lombok.Data;
public class PanelGroupRequest extends PanelGroupDTO {
private String sort;
private String userId;
public PanelGroupRequest() {
}
public PanelGroupRequest(String pid) {
public PanelGroupRequest(String pid,String userId) {
super.setPid(pid);
this.userId= userId;
}
}

View File

@ -0,0 +1,62 @@
package io.dataease.controller.sys;
import io.dataease.base.domain.SysAuth;
import io.dataease.base.domain.SysAuthDetail;
import io.dataease.base.domain.SysDept;
import io.dataease.controller.ResultHolder;
import io.dataease.controller.request.BaseTreeRequest;
import io.dataease.controller.request.SysAuthDetailRequest;
import io.dataease.controller.request.SysAuthRequest;
import io.dataease.dto.BaseAuthDetail;
import io.dataease.dto.VAuthModelDTO;
import io.dataease.service.sys.SysAuthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* Author: wangjiahao
* Date: 2021-05-11
* Description:
*/
@RestController
@RequiredArgsConstructor
@Api(tags = "系统:权限管理")
@RequestMapping("/api/sys_auth")
public class SysAuthController {
@Resource
private SysAuthService sysAuthService;
@ApiOperation("查询视图")
@PostMapping("/authModels")
public List<VAuthModelDTO> authModels(@RequestBody BaseTreeRequest request){
return sysAuthService.searchAuthModelTree(request);
}
@ApiOperation("查询授权")
@PostMapping("/authDetails")
public Map<String,List<SysAuthDetail>> authDetails(@RequestBody SysAuthRequest request){
return sysAuthService.searchAuthDetails(request);
}
@ApiOperation("查询授权模板")
@GetMapping("/authDetailsModel/{authType}")
public List<SysAuthDetail>authDetailsModel(@PathVariable String authType){
return sysAuthService.searchAuthDetailsModel(authType);
}
@ApiOperation("修改权限")
@PostMapping("/authChange")
public void authChange(@RequestBody SysAuthRequest request){
sysAuthService.authChange(request);
}
}

View File

@ -25,7 +25,6 @@ import java.util.stream.Collectors;
@RequestMapping("/api/dept")
public class SysDeptController extends ResultHolder {
@Autowired
private DeptService deptService;
@ -35,6 +34,7 @@ public class SysDeptController extends ResultHolder {
List<DeptNodeResponse> nodeResponses = nodes.stream().map(node -> {
DeptNodeResponse deptNodeResponse = BeanUtils.copyBean(new DeptNodeResponse(), node);
deptNodeResponse.setHasChildren(node.getSubCount() > 0);
deptNodeResponse.setLeaf(node.getSubCount() == 0);
deptNodeResponse.setTop(node.getPid() == deptService.DEPT_ROOT_PID);
return deptNodeResponse;
}).collect(Collectors.toList());
@ -48,6 +48,7 @@ public class SysDeptController extends ResultHolder {
List<DeptNodeResponse> nodeResponses = nodes.stream().map(node -> {
DeptNodeResponse deptNodeResponse = BeanUtils.copyBean(new DeptNodeResponse(), node);
deptNodeResponse.setHasChildren(node.getSubCount() > 0);
deptNodeResponse.setLeaf(node.getSubCount() == 0);
deptNodeResponse.setTop(node.getPid() == deptService.DEPT_ROOT_PID);
return deptNodeResponse;
}).collect(Collectors.toList());

View File

@ -3,10 +3,14 @@ package io.dataease.controller.sys.response;
import io.dataease.base.domain.SysDept;
import lombok.Data;
import java.util.List;
@Data
public class DeptNodeResponse extends SysDept {
private boolean hasChildren;
private boolean leaf;
private boolean top;
}

View File

@ -3,11 +3,15 @@ package io.dataease.datasource.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import io.dataease.base.domain.Datasource;
import io.dataease.commons.utils.AuthUtils;
import io.dataease.commons.utils.PageUtils;
import io.dataease.commons.utils.Pager;
import io.dataease.controller.request.DatasourceUnionRequest;
import io.dataease.controller.sys.base.BaseGridRequest;
import io.dataease.datasource.dto.DBTableDTO;
import io.dataease.datasource.request.DatasourceRequest;
import io.dataease.datasource.service.DatasourceService;
import io.dataease.dto.DatasourceDTO;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -31,12 +35,14 @@ public class DatasourceController {
}
@GetMapping("/list")
public List<Datasource> getDatasourceList() throws Exception {
return datasourceService.getDatasourceList(new Datasource());
public List<DatasourceDTO> getDatasourceList() throws Exception {
DatasourceUnionRequest request = new DatasourceUnionRequest();
request.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
return datasourceService.getDatasourceList(request);
}
@PostMapping("/list/{goPage}/{pageSize}")
public Pager<List<Datasource>> getDatasourceList(@RequestBody BaseGridRequest request, @PathVariable int goPage, @PathVariable int pageSize) throws Exception {
public Pager<List<DatasourceDTO>> getDatasourceList(@RequestBody BaseGridRequest request, @PathVariable int goPage, @PathVariable int pageSize) throws Exception {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
// return PageUtils.setPageInfo(page, datasourceService.getDatasourceList(request));
return PageUtils.setPageInfo(page, datasourceService.gridQuery(request));

View File

@ -5,22 +5,29 @@ import io.dataease.base.domain.*;
import io.dataease.base.mapper.*;
import io.dataease.base.mapper.ext.ExtDataSourceMapper;
import io.dataease.base.mapper.ext.query.GridExample;
import io.dataease.commons.constants.TestCaseConstants;
import io.dataease.commons.exception.DEException;
import io.dataease.commons.utils.AuthUtils;
import io.dataease.commons.utils.CommonThreadPool;
import io.dataease.controller.request.DatasourceUnionRequest;
import io.dataease.controller.sys.base.BaseGridRequest;
import io.dataease.controller.sys.base.ConditionEntity;
import io.dataease.datasource.dto.DBTableDTO;
import io.dataease.datasource.provider.DatasourceProvider;
import io.dataease.datasource.provider.ProviderFactory;
import io.dataease.datasource.request.DatasourceRequest;
import io.dataease.dto.DatasourceDTO;
import io.dataease.dto.dataset.DataTableInfoDTO;
import io.dataease.service.dataset.DataSetGroupService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
@ -53,21 +60,22 @@ public class DatasourceService {
return datasource;
}
public List<Datasource> getDatasourceList(Datasource request) throws Exception {
DatasourceExample example = new DatasourceExample();
DatasourceExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(request.getName())) {
criteria.andNameLike(StringUtils.wrapIfMissing(request.getName(), "%"));
}
if (StringUtils.isNotBlank(request.getType())) {
criteria.andTypeEqualTo(request.getType());
}
example.setOrderByClause("update_time desc");
return datasourceMapper.selectByExampleWithBLOBs(example);
public List<DatasourceDTO> getDatasourceList(DatasourceUnionRequest request) throws Exception {
request.setSort("update_time desc");
return extDataSourceMapper.queryUnion(request);
}
public List<Datasource> gridQuery(BaseGridRequest request) {
public List<DatasourceDTO> gridQuery(BaseGridRequest request) {
//如果没有查询条件增加一个默认的条件
if(CollectionUtils.isEmpty(request.getConditions())){
ConditionEntity conditionEntity = new ConditionEntity();
conditionEntity.setField("1");
conditionEntity.setOperator("eq");
conditionEntity.setValue("1");
request.setConditions(Arrays.asList(conditionEntity));
}
GridExample gridExample = request.convertExample();
gridExample.setExtendCondition(String.valueOf(AuthUtils.getUser().getUserId()));
return extDataSourceMapper.query(gridExample);
}

View File

@ -0,0 +1,16 @@
package io.dataease.dto;
import lombok.Data;
/**
* Author: wangjiahao
* Date: 2021-05-12
* Description:
*/
@Data
public class BaseAuthDetail {
private Integer privilegeType;//类型
private Integer privilegeValue;// 1 不可用 2 可用
}

View File

@ -0,0 +1,16 @@
package io.dataease.dto;
import io.dataease.base.domain.Datasource;
import lombok.Data;
/**
* Author: wangjiahao
* Date: 2021-05-18
* Description:
*/
@Data
public class DatasourceDTO extends Datasource {
private String privileges;
}

View File

@ -0,0 +1,48 @@
package io.dataease.dto;
import io.dataease.base.domain.SysAuth;
import io.dataease.base.domain.SysAuthDetail;
import lombok.Data;
import java.util.List;
/**
* Author: wangjiahao
* Date: 2021-05-12
* Description:
*/
@Data
public class SysAuthDTO extends SysAuth {
private List<SysAuthDetail> sysAuthDetails;
// private List<BaseAuthDetail> baseAuthDetails;
//
// private String authDetails;
//
// @Override
// public void setAuthDetails(String authDetails) {
// this.authDetails = authDetails;
// if(StringUtils.isNotEmpty(authDetails)){
// try{
// baseAuthDetails = JSON.parseArray(authDetails,BaseAuthDetail.class);
// }catch (Exception e){
// e.printStackTrace();
// //ignored
// }
// }
// }
//
// public List<BaseAuthDetail> getBaseAuthDetails() {
// return baseAuthDetails;
// }
//
// public void setBaseAuthDetails(List<BaseAuthDetail> baseAuthDetails) {
// this.baseAuthDetails = baseAuthDetails;
// }
//
// @Override
// public String getAuthDetails() {
// return authDetails;
// }
}

View File

@ -0,0 +1,12 @@
package io.dataease.dto;
import io.dataease.base.domain.SysDept;
/**
* Author: wangjiahao
* Date: 2021-05-14
* Description:
*/
public class SysDeptDTO extends SysDept {
}

View File

@ -0,0 +1,23 @@
package io.dataease.dto;
import io.dataease.base.domain.VAuthModel;
import lombok.Data;
import java.util.List;
/**
* Author: wangjiahao
* Date: 2021-05-11
* Description:
*/
@Data
public class VAuthModelDTO extends VAuthModel {
private List<VAuthModelDTO> children;
private Boolean leaf;
private Integer childrenCount;
private Boolean hasChildren;
}

View File

@ -9,5 +9,8 @@ import java.util.List;
@Data
public class ChartGroupDTO extends DatasetGroup {
private String label;
private List<ChartGroupDTO> children;
private String privileges;
}

View File

@ -14,4 +14,6 @@ import java.util.Map;
@Getter
public class ChartViewDTO extends ChartViewWithBLOBs {
private Map<String, Object> data;
private String privileges;
}

View File

@ -13,4 +13,6 @@ import java.util.List;
public class DataSetGroupDTO extends DatasetGroup {
private String label;
private List<DataSetGroupDTO> children;
private String privileges;
}

View File

@ -14,4 +14,5 @@ import java.util.List;
@Getter
public class DataSetTableDTO extends DatasetTable {
private List<DataSetTableDTO> children;
private String privileges;
}

View File

@ -20,9 +20,8 @@ public class PanelGroupDTO extends PanelGroupWithBLOBs {
private List<PanelGroupDTO> children;
//仪表盘组件样式设计
private List<PanelDesignDTO> panelDesigns = new ArrayList<>();
private Boolean leaf;
private List<ChartViewDTO> viewsUsable = new ArrayList<>();
private String privileges;
}

View File

@ -2,6 +2,7 @@ package io.dataease.service.chart;
import io.dataease.base.domain.*;
import io.dataease.base.mapper.ChartGroupMapper;
import io.dataease.base.mapper.ext.ExtChartGroupMapper;
import io.dataease.commons.utils.AuthUtils;
import io.dataease.commons.utils.BeanUtils;
import io.dataease.controller.request.chart.ChartGroupRequest;
@ -25,6 +26,9 @@ public class ChartGroupService {
@Resource
private ChartViewService chartViewService;
@Resource
private ExtChartGroupMapper extChartGroupMapper;
public ChartGroupDTO save(ChartGroup chartGroup) {
checkName(chartGroup);
if (StringUtils.isEmpty(chartGroup.getId())) {
@ -64,56 +68,28 @@ public class ChartGroupService {
return chartGroupMapper.selectByPrimaryKey(id);
}
public List<ChartGroupDTO> tree(ChartGroupRequest ChartGroup) {
ChartGroupExample ChartGroupExample = new ChartGroupExample();
ChartGroupExample.Criteria criteria = ChartGroupExample.createCriteria();
criteria.andCreateByEqualTo(AuthUtils.getUser().getUsername());
if (StringUtils.isNotEmpty(ChartGroup.getName())) {
criteria.andNameLike("%" + ChartGroup.getName() + "%");
public List<ChartGroupDTO> tree(ChartGroupRequest chartGroup) {
chartGroup.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
if(chartGroup.getLevel() == null){
chartGroup.setLevel(0);
}
if (StringUtils.isNotEmpty(ChartGroup.getType())) {
criteria.andTypeEqualTo(ChartGroup.getType());
}
if (StringUtils.isNotEmpty(ChartGroup.getId())) {
criteria.andIdEqualTo(ChartGroup.getId());
} else {
criteria.andLevelEqualTo(0);
}
ChartGroupExample.setOrderByClause(ChartGroup.getSort());
List<ChartGroup> ChartGroups = chartGroupMapper.selectByExample(ChartGroupExample);
List<ChartGroupDTO> DTOs = ChartGroups.stream().map(ele -> {
ChartGroupDTO dto = new ChartGroupDTO();
BeanUtils.copyBean(dto, ele);
dto.setLabel(ele.getName());
return dto;
}).collect(Collectors.toList());
getAll(DTOs, ChartGroup);
return DTOs;
List<ChartGroupDTO> treeInfo = extChartGroupMapper.search(chartGroup);
getAll(treeInfo, chartGroup);
return treeInfo;
}
public void getAll(List<ChartGroupDTO> list, ChartGroupRequest ChartGroup) {
public void getAll(List<ChartGroupDTO> list, ChartGroupRequest chartGroup) {
for (ChartGroupDTO obj : list) {
ChartGroupExample ChartGroupExample = new ChartGroupExample();
ChartGroupExample.Criteria criteria = ChartGroupExample.createCriteria();
criteria.andCreateByEqualTo(AuthUtils.getUser().getUsername());
if (StringUtils.isNotEmpty(ChartGroup.getName())) {
criteria.andNameLike("%" + ChartGroup.getName() + "%");
}
if (StringUtils.isNotEmpty(ChartGroup.getType())) {
criteria.andTypeEqualTo(ChartGroup.getType());
}
criteria.andPidEqualTo(obj.getId());
ChartGroupExample.setOrderByClause(ChartGroup.getSort());
List<ChartGroup> ChartGroups = chartGroupMapper.selectByExample(ChartGroupExample);
List<ChartGroupDTO> DTOs = ChartGroups.stream().map(ele -> {
ChartGroupDTO dto = new ChartGroupDTO();
BeanUtils.copyBean(dto, ele);
dto.setLabel(ele.getName());
return dto;
}).collect(Collectors.toList());
obj.setChildren(DTOs);
if (CollectionUtils.isNotEmpty(DTOs)) {
getAll(DTOs, ChartGroup);
ChartGroupRequest newChartGroup = new ChartGroupRequest();
newChartGroup.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
newChartGroup.setName(chartGroup.getName());
newChartGroup.setType(chartGroup.getType());
newChartGroup.setPid(obj.getId());
newChartGroup.setSort(chartGroup.getSort());
List<ChartGroupDTO> treeInfo = extChartGroupMapper.search(newChartGroup);
obj.setChildren(treeInfo);
if (CollectionUtils.isNotEmpty(treeInfo)) {
getAll(treeInfo, chartGroup);
}
}
}

View File

@ -5,6 +5,7 @@ import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import io.dataease.base.domain.*;
import io.dataease.base.mapper.ChartViewMapper;
import io.dataease.base.mapper.ext.ExtChartViewMapper;
import io.dataease.commons.utils.AuthUtils;
import io.dataease.commons.utils.BeanUtils;
import io.dataease.commons.utils.CommonBeanFactory;
@ -42,6 +43,8 @@ public class ChartViewService {
@Resource
private ChartViewMapper chartViewMapper;
@Resource
private ExtChartViewMapper extChartViewMapper;
@Resource
private DataSetTableService dataSetTableService;
@Resource
private DatasourceService datasourceService;
@ -65,17 +68,9 @@ public class ChartViewService {
return chartView;
}
public List<ChartViewWithBLOBs> list(ChartViewRequest chartViewRequest) {
ChartViewExample chartViewExample = new ChartViewExample();
ChartViewExample.Criteria criteria = chartViewExample.createCriteria();
criteria.andCreateByEqualTo(AuthUtils.getUser().getUsername());
if (StringUtils.isNotEmpty(chartViewRequest.getSceneId())) {
criteria.andSceneIdEqualTo(chartViewRequest.getSceneId());
}
if (StringUtils.isNotEmpty(chartViewRequest.getSort())) {
chartViewExample.setOrderByClause(chartViewRequest.getSort());
}
return chartViewMapper.selectByExampleWithBLOBs(chartViewExample);
public List<ChartViewDTO> list(ChartViewRequest chartViewRequest) {
chartViewRequest.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
return extChartViewMapper.search(chartViewRequest);
}
public ChartViewWithBLOBs get(String id) {

View File

@ -4,11 +4,13 @@ import io.dataease.base.domain.DatasetGroup;
import io.dataease.base.domain.DatasetGroupExample;
import io.dataease.base.domain.DatasetTable;
import io.dataease.base.mapper.DatasetGroupMapper;
import io.dataease.base.mapper.ext.ExtDataSetGroupMapper;
import io.dataease.commons.utils.AuthUtils;
import io.dataease.commons.utils.BeanUtils;
import io.dataease.controller.request.dataset.DataSetGroupRequest;
import io.dataease.controller.request.dataset.DataSetTableRequest;
import io.dataease.dto.dataset.DataSetGroupDTO;
import io.dataease.dto.dataset.DataSetTableDTO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@ -30,6 +32,8 @@ public class DataSetGroupService {
private DatasetGroupMapper datasetGroupMapper;
@Resource
private DataSetTableService dataSetTableService;
@Resource
private ExtDataSetGroupMapper extDataSetGroupMapper;
public DataSetGroupDTO save(DatasetGroup datasetGroup) {
checkName(datasetGroup);
@ -68,63 +72,35 @@ public class DataSetGroupService {
for (String sceneId : sceneIds) {
DataSetTableRequest dataSetTableRequest = new DataSetTableRequest();
dataSetTableRequest.setSceneId(sceneId);
List<DatasetTable> list = dataSetTableService.list(dataSetTableRequest);
for (DatasetTable table : list) {
List<DataSetTableDTO> list = dataSetTableService.list(dataSetTableRequest);
for (DataSetTableDTO table : list) {
dataSetTableService.delete(table.getId());
}
}
}
public List<DataSetGroupDTO> tree(DataSetGroupRequest datasetGroup) {
DatasetGroupExample datasetGroupExample = new DatasetGroupExample();
DatasetGroupExample.Criteria criteria = datasetGroupExample.createCriteria();
criteria.andCreateByEqualTo(AuthUtils.getUser().getUsername());
if (StringUtils.isNotEmpty(datasetGroup.getName())) {
criteria.andNameLike("%" + datasetGroup.getName() + "%");
datasetGroup.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
if(datasetGroup.getLevel() == null){
datasetGroup.setLevel(0);
}
if (StringUtils.isNotEmpty(datasetGroup.getType())) {
criteria.andTypeEqualTo(datasetGroup.getType());
}
if (StringUtils.isNotEmpty(datasetGroup.getId())) {
criteria.andIdEqualTo(datasetGroup.getId());
} else {
criteria.andLevelEqualTo(0);
}
datasetGroupExample.setOrderByClause(datasetGroup.getSort());
List<DatasetGroup> datasetGroups = datasetGroupMapper.selectByExample(datasetGroupExample);
List<DataSetGroupDTO> DTOs = datasetGroups.stream().map(ele -> {
DataSetGroupDTO dto = new DataSetGroupDTO();
BeanUtils.copyBean(dto, ele);
dto.setLabel(ele.getName());
return dto;
}).collect(Collectors.toList());
getAll(DTOs, datasetGroup);
return DTOs;
List<DataSetGroupDTO> treeInfo = extDataSetGroupMapper.search(datasetGroup);
getAll(treeInfo, datasetGroup);
return treeInfo;
}
public void getAll(List<DataSetGroupDTO> list, DataSetGroupRequest datasetGroup) {
for (DataSetGroupDTO obj : list) {
DatasetGroupExample datasetGroupExample = new DatasetGroupExample();
DatasetGroupExample.Criteria criteria = datasetGroupExample.createCriteria();
criteria.andCreateByEqualTo(AuthUtils.getUser().getUsername());
if (StringUtils.isNotEmpty(datasetGroup.getName())) {
criteria.andNameLike("%" + datasetGroup.getName() + "%");
}
if (StringUtils.isNotEmpty(datasetGroup.getType())) {
criteria.andTypeEqualTo(datasetGroup.getType());
}
criteria.andPidEqualTo(obj.getId());
datasetGroupExample.setOrderByClause(datasetGroup.getSort());
List<DatasetGroup> datasetGroups = datasetGroupMapper.selectByExample(datasetGroupExample);
List<DataSetGroupDTO> DTOs = datasetGroups.stream().map(ele -> {
DataSetGroupDTO dto = new DataSetGroupDTO();
BeanUtils.copyBean(dto, ele);
dto.setLabel(ele.getName());
return dto;
}).collect(Collectors.toList());
obj.setChildren(DTOs);
if (CollectionUtils.isNotEmpty(DTOs)) {
getAll(DTOs, datasetGroup);
DataSetGroupRequest newDataSetGroup = new DataSetGroupRequest();
newDataSetGroup.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
newDataSetGroup.setName(datasetGroup.getName());
newDataSetGroup.setType(datasetGroup.getType());
newDataSetGroup.setPid(obj.getId());
newDataSetGroup.setSort(datasetGroup.getSort());
List<DataSetGroupDTO> treeInfo = extDataSetGroupMapper.search(newDataSetGroup);
obj.setChildren(treeInfo);
if (CollectionUtils.isNotEmpty(treeInfo)) {
getAll(treeInfo, datasetGroup);
}
}
}

View File

@ -6,6 +6,7 @@ import io.dataease.base.domain.*;
import io.dataease.base.mapper.DatasetTableIncrementalConfigMapper;
import io.dataease.base.mapper.DatasetTableMapper;
import io.dataease.base.mapper.DatasourceMapper;
import io.dataease.base.mapper.ext.ExtDataSetTableMapper;
import io.dataease.commons.utils.*;
import io.dataease.controller.request.dataset.DataSetTableRequest;
import io.dataease.datasource.constants.DatasourceTypes;
@ -15,6 +16,7 @@ import io.dataease.datasource.provider.JdbcProvider;
import io.dataease.datasource.provider.ProviderFactory;
import io.dataease.datasource.request.DatasourceRequest;
import io.dataease.dto.dataset.DataSetPreviewPage;
import io.dataease.dto.dataset.DataSetTableDTO;
import io.dataease.dto.dataset.DataTableInfoDTO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
@ -58,6 +60,8 @@ public class DataSetTableService {
@Resource
private ExtractDataService extractDataService;
@Resource
private ExtDataSetTableMapper extDataSetTableMapper;
@Resource
private DatasetTableIncrementalConfigMapper datasetTableIncrementalConfigMapper;
@Value("${upload.file.path}")
private String path;
@ -108,17 +112,9 @@ public class DataSetTableService {
dataSetTableTaskService.deleteByTableId(id);
}
public List<DatasetTable> list(DataSetTableRequest dataSetTableRequest) {
DatasetTableExample datasetTableExample = new DatasetTableExample();
DatasetTableExample.Criteria criteria = datasetTableExample.createCriteria();
criteria.andCreateByEqualTo(AuthUtils.getUser().getUsername());
if (StringUtils.isNotEmpty(dataSetTableRequest.getSceneId())) {
criteria.andSceneIdEqualTo(dataSetTableRequest.getSceneId());
}
if (StringUtils.isNotEmpty(dataSetTableRequest.getSort())) {
datasetTableExample.setOrderByClause(dataSetTableRequest.getSort());
}
return datasetTableMapper.selectByExampleWithBLOBs(datasetTableExample);
public List<DataSetTableDTO> list(DataSetTableRequest dataSetTableRequest) {
dataSetTableRequest.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
return extDataSetTableMapper.search(dataSetTableRequest);
}
public DatasetTable get(String id) {

View File

@ -54,16 +54,18 @@ public class PanelGroupService {
private ExtPanelDesignMapper extPanelDesignMapper;
public List<PanelGroupDTO> tree(PanelGroupRequest panelGroupRequest) {
String userId = String.valueOf(AuthUtils.getUser().getUserId());
panelGroupRequest.setUserId(userId);
List<PanelGroupDTO> panelGroupDTOList = extPanelGroupMapper.panelGroupList(panelGroupRequest);
getTreeChildren(panelGroupDTOList);
getTreeChildren(panelGroupDTOList,userId);
return panelGroupDTOList;
}
public void getTreeChildren(List<PanelGroupDTO> parentPanelGroupDTO) {
public void getTreeChildren(List<PanelGroupDTO> parentPanelGroupDTO,String userId) {
Optional.ofNullable(parentPanelGroupDTO).ifPresent(parent -> parent.forEach(panelGroupDTO -> {
List<PanelGroupDTO> panelGroupDTOChildren = extPanelGroupMapper.panelGroupList(new PanelGroupRequest(panelGroupDTO.getId()));
List<PanelGroupDTO> panelGroupDTOChildren = extPanelGroupMapper.panelGroupList(new PanelGroupRequest(panelGroupDTO.getId(),userId));
panelGroupDTO.setChildren(panelGroupDTOChildren);
getTreeChildren(panelGroupDTOChildren);
getTreeChildren(panelGroupDTOChildren,userId);
}));
}
@ -98,31 +100,6 @@ public class PanelGroupService {
return panelGroupMapper.selectByPrimaryKey(panelId);
}
public PanelGroupDTO findOneBack(String panelId) throws Exception {
PanelGroupDTO panelGroupDTO = extPanelGroupMapper.panelGroup(panelId);
Assert.notNull(panelGroupDTO, "未查询到仪表盘信息");
PanelDesignExample panelDesignExample = new PanelDesignExample();
panelDesignExample.createCriteria().andPanelIdEqualTo(panelId);
List<PanelDesign> panelDesignList = panelDesignMapper.selectByExample(panelDesignExample);
if (CollectionUtils.isNotEmpty(panelDesignList)) {
List<PanelDesignDTO> panelDesignDTOList = new ArrayList<>();
//TODO 加载所有视图和组件的数据
for (PanelDesign panelDesign : panelDesignList) {
//TODO 获取view 视图数据
ChartViewDTO chartViewDTO = chartViewService.getData(panelDesign.getComponentId(), null);
//TODO 获取systemComponent 系统组件数据待开发
PanelDesignDTO panelDesignDTO = new PanelDesignDTO(chartViewDTO);
BeanUtils.copyBean(panelDesignDTO, panelDesign);
panelDesignDTO.setKeepFlag(true);
panelDesignDTOList.add(panelDesignDTO);
}
panelGroupDTO.setPanelDesigns(panelDesignDTOList);
}
//获取所有可用的视图
panelGroupDTO.setViewsUsable(getUsableViews(panelId));
return panelGroupDTO;
}
public List<ChartViewDTO> getUsableViews(String panelId) throws Exception {
@ -137,39 +114,4 @@ public class PanelGroupService {
});
return chartViewDTOList;
}
@Transactional
public void saveGroupWithDesign(PanelGroupRequest request) {
//TODO 更新panelGroup 信息
if (StringUtils.isEmpty(request.getId())) {
request.setId(UUID.randomUUID().toString());
request.setCreateTime(System.currentTimeMillis());
panelGroupMapper.insert(request);
} else {
panelGroupMapper.updateByPrimaryKey(request);
}
//TODO 更新panelDesign 信息
String panelId = request.getId();
Assert.notNull(panelId, "panelId should not be null");
//清理原有design
extPanelDesignMapper.deleteByPanelId(panelId);
//保存view 或者component design
Optional.ofNullable(request.getPanelDesigns()).orElse(new ArrayList<>()).stream().forEach(panelDesignDTO -> {
if (panelDesignDTO.isKeepFlag()) {
String componentId = "";
if (StringUtils.equals(PanelConstants.COMPONENT_TYPE_VIEW, panelDesignDTO.getComponentType())) {
componentId = panelDesignDTO.getChartView().getId();
} else {
//预留 公共组件id获取
componentId = "";
}
panelDesignDTO.setPanelId(panelId);
panelDesignDTO.setComponentId(componentId);
panelDesignDTO.setUpdateTime(System.currentTimeMillis());
panelDesignMapper.insertSelective(panelDesignDTO);
}
});
}
}

View File

@ -132,6 +132,9 @@ public class DeptService {
//DeptService proxy = proxy();
List<SimpleTreeNode> allNodes = allNodes();
List<SimpleTreeNode> targetNodes = nodeByCondition(request);
if(CollectionUtils.isEmpty(targetNodes)){
return new ArrayList<>();
}
List<Long> ids = upTree(allNodes, targetNodes);
SysDeptExample example = new SysDeptExample();
if (CollectionUtils.isNotEmpty(ids)){

View File

@ -0,0 +1,136 @@
package io.dataease.service.sys;
import io.dataease.auth.api.dto.CurrentUserDto;
import io.dataease.base.domain.SysAuth;
import io.dataease.base.domain.SysAuthDetail;
import io.dataease.base.mapper.SysAuthMapper;
import io.dataease.base.mapper.ext.ExtSysAuthDetailMapper;
import io.dataease.base.mapper.ext.ExtSysAuthMapper;
import io.dataease.base.mapper.ext.ExtVAuthModelMapper;
import io.dataease.commons.constants.SystemConstants;
import io.dataease.commons.utils.AuthUtils;
import io.dataease.controller.request.BaseTreeRequest;
import io.dataease.controller.request.SysAuthRequest;
import io.dataease.dto.SysAuthDTO;
import io.dataease.dto.SysDeptDTO;
import io.dataease.dto.VAuthModelDTO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class SysAuthService {
@Resource
private ExtSysAuthMapper extSysAuthMapper;
@Resource
private SysAuthMapper sysAuthMapper;
@Resource
private ExtSysAuthDetailMapper extSysAuthDetailMapper;
@Resource
private ExtVAuthModelMapper extVAuthModelMapper;
private static List<String> PRI_MODEL_TYPE = Arrays.asList("link","dataset","chart","panel");
/**
* @Description: 查询可见授权数据的数据如果是管理员IsAdmin = true且modelType 为link dataset chart panel可以查询到所有的数据
* 如果是普通用户只能查询到自己的数据但是 node_type 为spine 节点也会返回
**/
public List<VAuthModelDTO> searchAuthModelTree(BaseTreeRequest request) {
CurrentUserDto currentUserDto = AuthUtils.getUser();
request.setCreateBy(null);
if(PRI_MODEL_TYPE.contains(request.getModelType())&&(currentUserDto.getIsAdmin() == null || !currentUserDto.getIsAdmin())){
request.setCreateBy(currentUserDto.getUsername());
}
return extVAuthModelMapper.searchTree(request);
}
/**
* @Description: 查询授权明细map
**/
public Map<String, List<SysAuthDetail>> searchAuthDetails(SysAuthRequest request) {
List<SysAuthDTO> authDTOList = extSysAuthMapper.searchAuth(request);
return Optional.ofNullable(authDTOList).orElse(new ArrayList<>()).stream()
.collect(Collectors.toMap(SysAuthDTO::getAuthSource, SysAuthDTO::getSysAuthDetails));
}
/**
* @Description: 每个类型的授权都会在表中预制各个授权项的模板 存在auth_id
**/
public List<SysAuthDetail> searchAuthDetailsModel(String authType) {
return extSysAuthDetailMapper.searchAuthTypeModel(authType);
}
public void authChange(SysAuthRequest request) {
SysAuthDetail sysAuthDetail = request.getAuthDetail();
//TODO 获取需要授权的资源id(当前节点和所有权限的下级节点)
List<String> authSources = getAuthModels(request.getAuthSource(), request.getAuthSourceType());
//TODO 获取需要被授权的目标id(部门当前节点和所有权限的下级节点)
List<String> authTargets =getAuthModels(request.getAuthTarget(), request.getAuthTargetType());
if(CollectionUtils.isNotEmpty(authSources)&& CollectionUtils.isNotEmpty(authTargets)){
List<String> authIdChange = new ArrayList<>();
authTargets.stream().forEach(authTarget -> {
authSources.forEach(authSource ->{
String authId = checkAuth(authSource, request.getAuthSourceType(),authTarget,request.getAuthTargetType());
authIdChange.add(authId);
});
});
// 授权修改
if(sysAuthDetail.getPrivilegeValue()==SystemConstants.PRIVILEGE_VALUE_ON){
//当前为开启1 >>> 关闭0 需要将权限级别PrivilegeType大于当前级别的全新都修改为关闭 0
extSysAuthDetailMapper.authDetailsChange(SystemConstants.PRIVILEGE_VALUE_OFF,sysAuthDetail.getPrivilegeType(),authIdChange);
}else{
//当前为关闭0 >>> 开启1 需要将权限级别PrivilegeType小于当前级别的全新都修改为开启 1
extSysAuthDetailMapper.authDetailsChange(SystemConstants.PRIVILEGE_VALUE_ON,sysAuthDetail.getPrivilegeType(),authIdChange);
}
}
}
private List<String> getAuthModels(String id, String type) {
List<VAuthModelDTO> vAuthModelDTOS = searchAuthModelTree(new BaseTreeRequest(id,type, SystemConstants.WITH_EXTEND_CHILDREN));
List<String> authSources = Optional.ofNullable(vAuthModelDTOS).orElse(new ArrayList<>()).stream().map(VAuthModelDTO::getId)
.collect(Collectors.toList());
return authSources;
}
/**
* @Description: 查询当前target 是否有存在授权 不存在 增加权限 并复制权限模板
**/
private String checkAuth(String authSource,String authSourceType,String authTarget,String authTargetType){
String authId = extSysAuthMapper.findAuthId(authSource,authSourceType,authTarget,authTargetType);
if(StringUtils.isEmpty(authId)){
authId = UUID.randomUUID().toString();
//TODO 插入权限
SysAuth sysAuthRecord = new SysAuth();
sysAuthRecord.setId(authId);
sysAuthRecord.setAuthSource(authSource);
sysAuthRecord.setAuthSourceType(authSourceType);
sysAuthRecord.setAuthTarget(authTarget);
sysAuthRecord.setAuthTargetType(authTargetType);
sysAuthRecord.setAuthTime(System.currentTimeMillis());
sysAuthRecord.setAuthUser(AuthUtils.getUser().getUsername());
sysAuthMapper.insertSelective(sysAuthRecord);
//TODO 复制权限模板
extSysAuthDetailMapper.copyAuthModel(authSourceType,authId,AuthUtils.getUser().getUsername());
}
return authId;
}
}

View File

@ -67,8 +67,13 @@
<!-- <table tableName="datasource"/>-->
<!-- <table tableName="sys_dict"/>-->
<!-- <table tableName="sys_dict_item"/>-->
<table tableName="dataset_table_field"/>
<!-- <table tableName="panel_design"/>-->
<!-- <table tableName="dataset_table_field"/>-->
<!-- <table tableName="v_chart">-->
<!-- </table>-->
<table tableName="v_auth_model">
</table>
<!-- <table tableName="v_dataset"/>-->
<!-- <table tableName="sys_auth_detail"/>-->
</context>

View File

@ -8,3 +8,13 @@ export function post(url, data) {
data
})
}
export function getChartTree(data) {
return request({
url: 'api',
method: 'post',
loading: true,
data
})
}

View File

@ -0,0 +1,39 @@
import request from '@/utils/request'
export function post(url, data) {
return request({
url: url,
data: data,
loading: true,
method: 'post'
})
}
export function authChange(data) {
return request({
url: '/api/sys_auth/authChange',
data: data,
method: 'post'
})
}
export function authDetails(data) {
return request({
url: '/api/sys_auth/authDetails',
data: data,
method: 'post'
})
}
export function authDetailsModel(authType) {
return request({
url: '/api/sys_auth/authDetailsModel/' + authType,
method: 'get'
})
}
export function authModel(data) {
return request({
url: '/api/sys_auth/authModels',
data: data,
method: 'post'
})
}

View File

@ -48,7 +48,7 @@ export default {
border-radius: 2px;
box-sizing: border-box;
background-color: #FFF;
height: calc(100vh - 80px);
height: 100vh;
border-right: 0px;
position: relative;
}

View File

@ -13,7 +13,7 @@ export default {
<style scoped>
.ms-main-container {
padding: 15px;
padding: 10px;
height: 100vh;
}

View File

@ -0,0 +1,30 @@
function checkDataPermission(el, binding, vnode) {
const dataPermission = vnode.privileges
debugger
const { value } = binding
console.log('permission:' + value)
// // 数据授权采用并集的方式 部门 角色 用户 有一个有权限即可
// if (value && value instanceof Array) {
// const needPermissions = value
// // 满足任意一个即可
// const hasPermission = needPermissions.some(needP => {
// const result = dataPermission.indexOf(needP) > -1
// return result
// })
// if (!hasPermission) {
// el.parentNode && el.parentNode.removeChild(el)
// }
// } else {
// throw new Error(`使用方式: v-data-permission="['1:1']"`)
// }
el.parentNode && el.parentNode.removeChild(el)
}
export default {
inserted(el, binding, vnode) {
checkDataPermission(el, binding, vnode)
},
update(el, binding, vnode) {
checkDataPermission(el, binding, vnode)
}
}

View File

@ -1,4 +1,5 @@
import permission from '@/directive/Permission'
// import dataPermission from '@/directive/DataPermission'
export const left2RightDrag = {
inserted(el, binding) {
@ -62,6 +63,7 @@ export const bottom2TopDrag = {
export default {
install(Vue) {
// Vue.directive('data-permission', dataPermission)
Vue.directive('permission', permission)
Vue.directive('left-to-right-drag', left2RightDrag)
Vue.directive('right-to-left-drag', right2LeftDrag)

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1620789091905" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11831" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M295.424 831.36512l450.56 0c11.30496 0 20.48-9.17504 20.48-20.48l0-350.4128c0-11.30496-9.17504-20.48-20.48-20.48l-9.70752 0c0-21.0944 0-50.95424 0-51.36384-1.26976-117.248-97.95584-212.62336-215.552-212.62336-117.94432 0-214.6304 95.66208-215.57248 213.4016l0 50.5856-9.70752 0c-11.30496 0-20.48 9.17504-20.48 20.48l0 350.4128C274.944 822.19008 284.09856 831.36512 295.424 831.36512zM725.504 790.40512l-409.6 0 0-309.4528 409.6 0L725.504 790.40512zM346.09152 389.57056c0.75776-95.17056 79.07328-172.60544 174.61248-172.60544 95.25248 0 173.58848 77.2096 174.592 172.01152 0 1.3312 0 30.35136 0 51.01568L346.07104 439.99232 346.09152 389.57056z" p-id="11832"></path><path d="M476.01664 721.69472c0 11.30496 9.17504 20.48 20.48 20.48l48.37376 0c11.30496 0 20.48-9.17504 20.48-20.48l0-66.17088c16.6912-13.37344 26.64448-33.56672 26.64448-55.1936 0-39.23968-31.98976-71.168-71.31136-71.168s-71.31136 31.92832-71.31136 71.168c0 21.62688 9.95328 41.82016 26.64448 55.1936L476.01664 721.69472zM520.704 570.14272c16.73216 0 30.35136 13.55776 30.35136 30.208 0 10.87488-6.10304 20.97152-15.95392 26.3168-6.59456 3.584-10.69056 10.48576-10.69056 17.98144l0 56.56576-7.41376 0 0-56.56576c0-7.49568-4.096-14.41792-10.69056-17.98144-9.8304-5.34528-15.95392-15.44192-15.95392-26.3168C490.33216 583.68 503.95136 570.14272 520.704 570.14272z" p-id="11833"></path></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1620789052806" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11539" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M476.01664 721.69472c0 11.30496 9.17504 20.48 20.48 20.48l48.37376 0c11.30496 0 20.48-9.17504 20.48-20.48l0-66.17088c16.6912-13.37344 26.64448-33.56672 26.64448-55.1936 0-39.23968-31.98976-71.168-71.31136-71.168s-71.31136 31.92832-71.31136 71.168c0 21.62688 9.95328 41.82016 26.64448 55.1936L476.01664 721.69472zM520.704 570.14272c16.73216 0 30.35136 13.55776 30.35136 30.208 0 10.87488-6.10304 20.97152-15.95392 26.3168-6.59456 3.584-10.69056 10.48576-10.69056 17.98144l0 56.56576-7.41376 0 0-56.56576c0-7.49568-4.096-14.41792-10.69056-17.98144-9.8304-5.34528-15.95392-15.44192-15.95392-26.3168C490.33216 583.68 503.95136 570.14272 520.704 570.14272z" p-id="11540" fill="#1296db"></path><path d="M295.424 831.22176l450.56 0c11.30496 0 20.48-9.17504 20.48-20.48L766.464 463.72864c0-11.30496-9.17504-20.48-20.48-20.48L338.1248 443.24864c-20.7872-61.56288-5.2224-129.59744 41.69728-175.9232 67.42016-66.53952 177.664-67.11296 245.71904-1.37216 1.47456 1.4336 50.72896 50.05312 50.72896 50.05312l28.7744-29.16352c0 0-50.50368-49.84832-50.97472-50.29888-83.98848-81.16224-219.91424-80.42496-303.0016 1.6384-54.84544 54.14912-75.48928 132.34176-56.0128 205.12768-11.12064 0.2048-20.09088 9.23648-20.09088 20.39808l0 347.01312C274.944 822.04672 284.09856 831.22176 295.424 831.22176zM725.504 790.26176l-409.6 0L315.904 484.20864l409.6 0L725.504 790.26176z" p-id="11541" fill="#1296db"></path></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -64,6 +64,13 @@ Vue.use(directives)
Vue.use(message)
Vue.config.productionTip = false
Vue.prototype.hasDataPermission = function(pTarget, pSource) {
debugger
if (pSource && pTarget) {
return pSource.indexOf(pTarget) > -1
}
return false
}
new Vue({
router,

View File

@ -74,7 +74,7 @@
</el-dropdown>
</span>
<span style="margin-left: 12px;" @click.stop>
<el-dropdown trigger="click" size="small" @command="clickMore">
<el-dropdown v-if="hasDataPermission('manage',data.privileges)" trigger="click" size="small" @command="clickMore">
<span class="el-dropdown-link">
<el-button
icon="el-icon-more"
@ -157,7 +157,7 @@
</span>
<span>
<span style="margin-left: 12px;" @click.stop>
<el-dropdown trigger="click" size="small" @command="clickMore">
<el-dropdown v-if="hasDataPermission('manage',data.privileges)" trigger="click" size="small" @command="clickMore">
<span class="el-dropdown-link">
<el-button
icon="el-icon-more"

View File

@ -82,7 +82,7 @@
size="small"
/>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-menu v-if="hasDataPermission('manage',data.privileges)" slot="dropdown">
<el-dropdown-item icon="el-icon-edit-outline" :command="beforeClickMore('rename',data,node)">
{{ $t('dataset.rename') }}
</el-dropdown-item>
@ -203,7 +203,7 @@
size="small"
/>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-menu v-if="hasDataPermission('manage',data.privileges)" slot="dropdown">
<el-dropdown-item icon="el-icon-edit-outline" :command="beforeClickMore('editTable',data,node)">
{{ $t('dataset.rename') }}
</el-dropdown-item>

View File

@ -70,7 +70,7 @@
</el-dropdown>
</span>
<span style="margin-left: 12px;" @click.stop>
<el-dropdown trigger="click" size="small" @command="clickMore">
<el-dropdown v-if="hasDataPermission('manage',data.privileges)" trigger="click" size="small" @command="clickMore">
<span class="el-dropdown-link">
<el-button
icon="el-icon-more"

View File

@ -4,12 +4,12 @@
<el-row class="panel-design-head">
<!--TODO 仪表盘头部区域-->
<span>{{ panelInfo.name || '测试仪表板' }}</span>
<span style="float: right;margin-right: 10px">
<span v-if="hasDataPermission('export',panelInfo.privileges)" style="float: right;margin-right: 10px">
<el-tooltip content="保存为模板">
<el-button class="el-icon-folder-checked" size="mini" circle @click="saveToTemplate" />
</el-tooltip>
</span>
<span style="float: right;margin-right: 10px">
<span v-if="hasDataPermission('export',panelInfo.privileges)" style="float: right;margin-right: 10px">
<el-tooltip content="导出为模板">
<el-button class="el-icon-download" size="mini" circle @click="downloadToTemplate" />
</el-tooltip>

View File

@ -0,0 +1,190 @@
<template>
<de-container>
<de-aside-container>
<el-button v-show="!showTargetSearchInput" class="de-icon" icon="el-icon-search" circle size="mini" @click="showTargetSearchWidget" />
<div v-show="showTargetSearchInput" class="de-input">
<el-input v-model="targetFilterText">
<el-button slot="append" icon="el-icon-close" @click="closeTargetSearchWidget" />
</el-input>
</div>
<el-tabs v-model="targetActiveName" :class="{'de-search-header': showTargetSearchInput}" @tab-click="handleClick">
<el-tab-pane v-for="(targetInfo, index) in targetInfoArray" :key="index" :lazy="true" :label="targetInfo.tabName" :name="targetInfo.authType">
<lazy-tree
:active-name="targetActiveName"
:filter-text="targetFilterText"
:data-info="targetInfo"
highlight-current
@nodeClick="authNodeClick"
/>
</el-tab-pane>
</el-tabs>
</de-aside-container>
<de-main-container class="de-main-container-auth">
<el-button v-show="!showSourceSearchInput" class="de-icon" icon="el-icon-search" circle size="mini" @click="showSourceSearchWidget" />
<div v-show="showSourceSearchInput" class="de-input">
<el-input v-model="sourceFilterText">
<el-button slot="append" icon="el-icon-close" @click="closeSourceSearchWidget" />
</el-input>
</div>
<el-tabs v-model="sourceActiveName" :class="{'de-search-header': showSourceSearchInput}" @tab-click="handleClick">
<el-tab-pane v-for="(sourceInfo, index) in sourceInfoArray" :key="index" :lazy="true" :label="sourceInfo.tabName" :name="sourceInfo.authType">
<lazy-tree
v-if="authCondition"
:active-name="sourceActiveName"
:filter-text="sourceFilterText"
:data-info="sourceInfo"
show-extent
:auth-condition="authCondition"
/>
</el-tab-pane>
</el-tabs>
</de-main-container>
</de-container>
</template>
<script>
import DeContainer from '../../../components/dataease/DeContainer'
import DeAsideContainer from '../../../components/dataease/DeAsideContainer'
import DeMainContainer from '../../../components/dataease/DeMainContainer'
import LazyTree from './components/LazyTree'
export default {
name: 'Authority',
components: { LazyTree, DeMainContainer, DeAsideContainer, DeContainer },
props: {
resourceId: {
type: String,
default: null
}
},
data() {
return {
targetInfoArray:
[
{
tabName: '部门',
head: '所有部门',
direction: 'target',
authType: 'dept'
},
{
tabName: '角色',
head: '所有角色',
direction: 'target',
authType: 'role'
},
{
tabName: '用户',
head: '所有用户',
direction: 'target',
authType: 'user'
}],
sourceInfoArray:
[
{
tabName: '数据源权限',
head: '所有数据源',
direction: 'source',
authType: 'link'
},
{
tabName: '数据集权限',
head: '所有数据集',
direction: 'source',
authType: 'dataset'
},
{
tabName: '视图权限',
head: '所有视图',
direction: 'source',
authType: 'chart'
},
{
tabName: '仪表盘权限',
head: '所有仪表板',
direction: 'source',
authType: 'panel'
}],
targetActiveName: null,
sourceActiveName: null,
showSourceSearchInput: false,
showTargetSearchInput: false,
sourceFilterText: '',
targetFilterText: '',
timeMachine: null,
authCondition: null
}
},
created() {
this.targetActiveName = this.targetInfoArray[0].authType
},
methods: {
handleClick(tab, event) {
},
showSourceSearchWidget() {
this.showSourceSearchInput = true
},
closeSourceSearchWidget() {
this.sourceFilterText = ''
this.showSourceSearchInput = false
},
showTargetSearchWidget() {
this.showTargetSearchInput = true
},
closeTargetSearchWidget() {
this.targetFilterText = ''
this.showTargetSearchInput = false
},
save() {
this.$refs[this.activeName].save()
this.$emit('close-grant', 0)
},
cancel() {
this.$refs[this.activeName].cancel()
this.$emit('close-grant', 0)
},
authNodeClick(val) {
console.log('authNodeClick')
this.authCondition = val
},
clickAuth(auth) {
console.log('clickAuth')
}
}
}
</script>
<style lang="scss" scoped>
.de-tab {
border:1px solid #E6E6E6;
min-height:200px !important;
max-height:300px !important;
overflow:auto;
}
.de-icon {
position: absolute;
right: 10px;
top: 15px;
z-index: 99;
}
.el-input-group__append{
background-color: #ffffff;
}
.el-input__inner{
border-right: none;
}
.auth-root-class {
margin: 15px 0px 5px;
text-align: right;
}
.de-main-container-auth{
border: 1px solid #E6E6E6;
}
// ::-webkit-scrollbar {
// }
</style>

View File

@ -0,0 +1,190 @@
<template>
<de-container>
<de-aside-container>
<el-button v-show="!showSourceSearchInput" class="de-icon" icon="el-icon-search" circle size="mini" @click="showSourceSearchWidget" />
<div v-show="showSourceSearchInput" class="de-input">
<el-input v-model="sourceFilterText">
<el-button slot="append" icon="el-icon-close" @click="closeSourceSearchWidget" />
</el-input>
</div>
<el-tabs v-model="sourceActiveName" :class="{'de-search-header': showSourceSearchInput}" @tab-click="handleClick">
<el-tab-pane v-for="(sourceInfo, index) in sourceInfoArray" :key="index" :lazy="true" :label="sourceInfo.tabName" :name="sourceInfo.authType">
<lazy-tree
v-if="authCondition"
:active-name="sourceActiveName"
:filter-text="sourceFilterText"
:data-info="sourceInfo"
highlight-current
@nodeClick="authNodeClick"
/>
</el-tab-pane>
</el-tabs>
</de-aside-container>
<de-main-container class="de-main-container-auth">
<el-button v-show="!showTargetSearchInput" class="de-icon" icon="el-icon-search" circle size="mini" @click="showTargetSearchWidget" />
<div v-show="showTargetSearchInput" class="de-input">
<el-input v-model="targetFilterText">
<el-button slot="append" icon="el-icon-close" @click="closeTargetSearchWidget" />
</el-input>
</div>
<el-tabs v-model="targetActiveName" :class="{'de-search-header': showTargetSearchInput}" @tab-click="handleClick">
<el-tab-pane v-for="(targetInfo, index) in targetInfoArray" :key="index" :lazy="true" :label="targetInfo.tabName" :name="targetInfo.authType">
<lazy-tree
:active-name="targetActiveName"
:filter-text="targetFilterText"
:data-info="targetInfo"
show-extent
:auth-condition="authCondition"
/>
</el-tab-pane>
</el-tabs>
</de-main-container>
</de-container>
</template>
<script>
import DeContainer from '../../../components/dataease/DeContainer'
import DeAsideContainer from '../../../components/dataease/DeAsideContainer'
import DeMainContainer from '../../../components/dataease/DeMainContainer'
import LazyTree from './components/LazyTree'
export default {
name: 'Authority',
components: { LazyTree, DeMainContainer, DeAsideContainer, DeContainer },
props: {
resourceId: {
type: String,
default: null
}
},
data() {
return {
targetInfoArray:
[
{
tabName: '部门权限',
head: '所有部门',
direction: 'target',
authType: 'dept'
},
{
tabName: '角色权限',
head: '所有角色',
direction: 'target',
authType: 'role'
},
{
tabName: '用户权限',
head: '所有用户',
direction: 'target',
authType: 'user'
}],
sourceInfoArray:
[
{
tabName: '数据源',
head: '所有数据源',
direction: 'source',
authType: 'link'
},
{
tabName: '数据集',
head: '所有数据集',
direction: 'source',
authType: 'dataset'
},
{
tabName: '视图',
head: '所有视图',
direction: 'source',
authType: 'chart'
},
{
tabName: '仪表盘',
head: '所有仪表板',
direction: 'source',
authType: 'panel'
}],
targetActiveName: null,
sourceActiveName: null,
showSourceSearchInput: false,
showTargetSearchInput: false,
sourceFilterText: '',
targetFilterText: '',
timeMachine: null,
authCondition: null
}
},
created() {
this.targetActiveName = this.targetInfoArray[0].authType
},
methods: {
handleClick(tab, event) {
},
showSourceSearchWidget() {
this.showSourceSearchInput = true
},
closeSourceSearchWidget() {
this.sourceFilterText = ''
this.showSourceSearchInput = false
},
showTargetSearchWidget() {
this.showTargetSearchInput = true
},
closeTargetSearchWidget() {
this.targetFilterText = ''
this.showTargetSearchInput = false
},
save() {
this.$refs[this.activeName].save()
this.$emit('close-grant', 0)
},
cancel() {
this.$refs[this.activeName].cancel()
this.$emit('close-grant', 0)
},
authNodeClick(val) {
console.log('authNodeClick')
this.authCondition = val
},
clickAuth(auth) {
console.log('clickAuth')
}
}
}
</script>
<style lang="scss" scoped>
.de-tab {
border:1px solid #E6E6E6;
min-height:200px !important;
max-height:300px !important;
overflow:auto;
}
.de-icon {
position: absolute;
right: 10px;
top: 15px;
z-index: 99;
}
.el-input-group__append{
background-color: #ffffff;
}
.el-input__inner{
border-right: none;
}
.auth-root-class {
margin: 15px 0px 5px;
text-align: right;
}
.de-main-container-auth{
border: 1px solid #E6E6E6;
}
// ::-webkit-scrollbar {
// }
</style>

View File

@ -0,0 +1,312 @@
<template xmlns:el-col="http://www.w3.org/1999/html">
<el-col class="tree-main">
<el-row v-if="showExtent" class="tree-head">
<span style="float: left;padding-left: 10px">{{ dataInfo.head }}</span>
<span v-for="auth in defaultAuthDetails" :key="auth.privilegeName" class="auth-span">
{{ auth.privilegeName }}
</span>
</el-row>
<el-row style="margin-top: 5px">
<el-tree
:props="defaultProps"
:load="loadNodes"
:data="treeData"
:node-key="defaultProps.id"
:highlight-current="highlightCurrent"
:default-expanded-keys="expandedKey"
lazy
@node-click="nodeClick"
>
<span slot-scope="{ node, data }" class="custom-tree-node">
<span>
<span style="margin-left: 6px" v-html="data.name" />
</span>
<span v-if="showExtent" @click.stop>
<div v-if="authReady && authDetails[data.id]">
<span v-for="auth in authDetails[data.id]" :key="auth.privilegeType" class="auth-span">
<!-- 1-{{ auth.privilegeType }}-{{ auth.privilegeValue }}-->
<a href="javascript:;" @click="clickAuth(data.id,auth)">
<svg-icon style="width: 22px;height: 22px" :icon-class="auth.privilegeValue===1?'lock_open':'lock_closed'" />
</a>
</span>
</div>
<div v-else>
<span v-for="auth in defaultAuthDetails" :key="auth.privilegeType" class="auth-span">
<!--2-{{ auth.privilegeType }}-{{ auth.privilegeValue }}-->
<a href="javascript:;" @click="clickAuth(data.id,auth)">
<svg-icon style="width: 22px;height: 22px" :icon-class="auth.privilegeValue===1?'lock_open':'lock_closed'" />
</a>
</span>
</div></span>
</span>
</el-tree>
</el-row>
</el-col>
</template>
<script>
import { authChange, authDetails, authDetailsModel, authModel } from '@/api/system/sysAuth'
export default {
name: 'LazyTree',
components: { },
props: {
filterText: {
type: String,
required: false,
default: ''
},
authCondition: {
type: Object,
required: false
},
dataInfo: {
type: Object,
required: true
},
activeName: {
type: String,
required: true
},
defaultProps: {
type: Object,
required: false,
default: function() {
return {
children: 'children',
label: 'name',
id: 'id',
parentId: 'pid',
isLeaf: 'leaf'
}
}
},
showExtent: Boolean,
highlightCurrent: Boolean
},
data() {
return {
treeData: [],
changeIndex: 0,
timeMachine: null,
expandedKey: [], //
defaultCondition: { // pid 0
pid: '0'
},
authDetails: {},
defaultAuthDetails: [],
// authDetails authDetails[id]
authReady: false,
searchStatus: false, //
// ID authTarget
loadedNodeIds: new Set()
}
},
computed: {
},
watch: {
filterText(val) {
this.expandedKey = []
if (val && val.length > 0) {
this.searchStatus = true
}
// activeName
if (this.dataInfo.authType === this.activeName) {
this.destroyTimeMachine()
this.changeIndex++
this.filterNode(this.changeIndex)
}
},
authCondition: {
handler(newVal, oldVla) {
this.loadAuth()
},
deep: true
}
},
created() {
//
if (this.showExtent) {
authDetailsModel(this.dataInfo.authType).then(res => {
debugger
this.defaultAuthDetails = res.data
})
this.loadAuth()
}
},
methods: {
loadAuth() {
if (this.authCondition && this.showExtent) {
debugger
this.authReady = false
let authQueryCondition = {}
if (this.dataInfo.direction === 'source') {
// authTarget authSource
authQueryCondition = {
authTarget: this.authCondition.id,
authTargetType: this.authCondition.type
}
} else {
authQueryCondition = {
authSource: this.authCondition.id,
authSourceType: this.authCondition.type
}
}
authDetails(authQueryCondition).then(res => {
this.authDetails = res.data
this.authReady = true
})
}
},
loadNodes(node, resolve) {
debugger
if (!this.searchStatus) {
if (node.level === 0) {
const queryCondition = {
modelType: this.dataInfo.authType,
...
this.defaultCondition
}
authModel(queryCondition).then(res => {
const data = res.data
resolve(data)
})
} else {
const queryCondition = {
modelType: this.dataInfo.authType
}
queryCondition[this.defaultProps.parentId] = node.data[this.defaultProps.id]
authModel(queryCondition).then(res => {
const data = res.data
resolve(data)
})
}
} else {
resolve([])
}
},
filterNode(index) {
this.timeMachine = setTimeout(() => {
debugger
if (index === this.changeIndex) {
const queryCondition = {
withExtend: 'parent',
modelType: this.dataInfo.authType
}
queryCondition[this.defaultProps.label] = this.filterText
authModel(queryCondition).then(res => {
//
this.highlights(res.data)
this.treeData = this.buildTree(res.data)
// searchStatus
this.$nextTick(() => (this.searchStatus = false))
})
}
this.destroyTimeMachine()
}, 1500)
},
nodeClick(data, node) {
this.$emit('nodeClick', { id: data.id, type: this.dataInfo.authType })
},
destroyTimeMachine() {
this.timeMachine && clearTimeout(this.timeMachine)
this.timeMachine = null
},
buildTree(arrs) {
const idMapping = arrs.reduce((acc, el, i) => {
acc[el[this.defaultProps.id]] = i
return acc
}, {})
const roots = []
arrs.forEach(el => {
// ###
if (el[this.defaultProps.parentId] === null || el[this.defaultProps.parentId] === 0 || el[this.defaultProps.parentId] === '0') {
roots.push(el)
return
}
//
const parentEl = arrs[idMapping[el[this.defaultProps.parentId]]]
// `children`
parentEl.children = [...(parentEl.children || []), el]
//
if (parentEl.children.length > 0) {
this.expandedKey.push(parentEl[this.defaultProps.id])
}
})
return roots
},
//
clickAuth(dataId, auth) {
let authChangeCondition = {}
if (this.dataInfo.direction === 'source') { //
authChangeCondition = {
authSource: dataId,
authSourceType: this.dataInfo.authType,
authTarget: this.authCondition.id,
authTargetType: this.authCondition.type,
authDetail: auth
}
} else {
authChangeCondition = {
authTarget: dataId,
authTargetType: this.dataInfo.authType,
authSource: this.authCondition.id,
authSourceType: this.authCondition.type,
authDetail: auth
}
}
authChange(authChangeCondition).then(res => {
this.authDetails = res.data
//
this.loadAuth()
})
},
//
highlights(data) {
if (data && this.filterText && this.filterText.length > 0) {
const replaceReg = new RegExp(this.filterText, 'g')//
const replaceString = '<span style="color: #faaa39">' + this.filterText + '</span>' // v-html
data.forEach(item => {
item.name = item.name.replace(replaceReg, replaceString) //
})
}
}
}
}
</script>
<style scoped>
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-left: 8px;
}
.tree-main{
height: 100vh;
border: 1px solid #e6e6e6;
}
.tree-head{
height: 30px;
line-height: 30px;
border-bottom: 1px solid #e6e6e6;
background-color: #f7f8fa;
font-size: 12px;
color: #3d4d66 ;
}
.auth-span{
float: right;
width:50px;
margin-right: 30px
}
.highlights-text {
color: #faaa39 !important;
}
</style>

View File

@ -0,0 +1,160 @@
<template xmlns:el-col="http://www.w3.org/1999/html">
<el-col>
<el-row style="margin-top: 5px">
<el-tree
ref="templateTree"
:props="defaultProps"
:load="loadNodes"
:data="treeData"
node-key="deptId"
:highlight-current="true"
:default-expanded-keys="expandedKey"
lazy
@node-click="nodeClick"
/>
</el-row>
</el-col>
</template>
<script>
import { getDeptTree, loadTable } from '@/api/system/dept'
export default {
name: 'AuthDept',
components: { },
props: {
filterText: {
type: String,
required: false,
default: ''
},
activeName: {
type: String,
required: true
}
},
data() {
return {
treeData: [],
changeIndex: 0,
timeMachine: null,
expandedKey: [],
defaultCondition: {
field: 'pid',
operator: 'eq',
value: 0
},
defaultProps: {
children: 'children',
label: 'name',
id: 'deptId',
parentId: 'pid',
isLeaf: 'leaf'
}
}
},
computed: {
},
watch: {
filterText(val) {
// activeName
if (this.$options.name === this.activeName) {
this.destroyTimeMachine()
this.changeIndex++
this.filterNode(this.changeIndex)
}
}
},
methods: {
loadNodes(node, resolve) {
if (node.level === 0) {
getDeptTree(0).then(res => {
const data = res.data
resolve(data)
})
} else {
getDeptTree(node.data.deptId).then(res => {
const data = res.data
resolve(data)
})
}
},
filterNode(index) {
this.timeMachine = setTimeout(() => {
if (index === this.changeIndex) {
const condition = {
field: 'name',
operator: 'like',
value: this.filterText
}
this.search(condition)
}
this.destroyTimeMachine()
}, 1500)
},
nodeClick(data, node) {
this.$emit('nodeClick', { id: data.deptId, type: 'dept' })
},
destroyTimeMachine() {
this.timeMachine && clearTimeout(this.timeMachine)
this.timeMachine = null
},
search(condition) {
let param = {}
if (condition && condition.value) {
param = { conditions: [condition] }
} else {
param = { conditions: [this.defaultCondition] }
}
loadTable(param).then(res => {
this.expandedKey = []
this.treeData = []
const data = res.data
this.treeData = this.buildTree(data)
console.log('===>' + JSON.stringify(this.treeData))
})
},
buildTree(arrs) {
const idMapping = arrs.reduce((acc, el, i) => {
acc[el.deptId] = i
return acc
}, {})
console.log('idMapping>' + JSON.stringify(idMapping))
const roots = []
arrs.forEach(el => {
//
if (el.pid === null || el.pid === 0) {
roots.push(el)
return
}
debugger
//
const parentEl = arrs[idMapping[el.pid]]
console.log('parentEl>' + JSON.stringify(parentEl))
// `children`
parentEl.children = [...(parentEl.children || []), el]
console.log('parentEl>' + JSON.stringify(parentEl))
//
if (parentEl.children.length > 0) {
this.expandedKey.push(parentEl.deptId)
}
})
return roots
}
}
}
</script>
<style scoped>
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
</style>

View File

@ -0,0 +1,78 @@
<template>
<div class="my_table">
<el-table
:data="data.filter(node => !filterText || node[fieldName].toLowerCase().includes(filterText.toLowerCase()))"
:show-header="false"
style="width: 100%"
:row-style="{height: '26px'}"
highlight-current-row
@current-change="nodeClick"
>
<el-table-column :column-key="fieldName" :prop="fieldName" filter-placement="right-start" />
</el-table>
</div>
</template>
<script>
import { roleGrid } from '@/api/system/role'
import { formatCondition } from '@/utils/index'
export default {
name: 'AuthRole',
props: {
resourceId: {
type: String,
default: null
},
filterText: {
type: String,
default: ''
}
},
data() {
return {
data: [],
fieldName: 'name',
type: 1, // 1
shares: []
}
},
created() {
this.search()
},
methods: {
search(condition) {
const temp = formatCondition(condition)
const param = temp || {}
roleGrid(1, 0, param).then(response => {
const data = response.data
this.data = data.listObject
})
},
cancel() {
console.log('role cancel')
},
nodeClick(val) {
// role authTarget
this.$emit('nodeClick', { id: val.roleId, type: 'role' })
}
}
}
</script>
<style scoped>
.my_table >>> .el-table__row>td{
/* 去除表格线 */
border: none;
padding: 0 0;
}
.my_table >>> .el-table th.is-leaf {
/* 去除上边框 */
border: none;
}
.my_table >>> .el-table::before{
/* 去除下边框 */
height: 0;
}
</style>

View File

@ -0,0 +1,74 @@
<template>
<div class="my_table">
<el-table
:data="data.filter(node => !filterText || node[fieldName].toLowerCase().includes(filterText.toLowerCase()))"
:show-header="false"
style="width: 100%"
:row-style="{height: '26px'}"
highlight-current-row
@current-change="handleCurrentChange"
>
<el-table-column :column-key="fieldName" :prop="fieldName" filter-placement="right-start" />
</el-table>
</div>
</template>
<script>
import { userLists } from '@/api/system/user'
import { formatCondition } from '@/utils/index'
export default {
name: 'AuthUser',
props: {
filterText: {
type: String,
default: ''
}
},
data() {
return {
data: [],
fieldName: 'nickName',
type: 0, // 0
shares: []
}
},
created() {
this.search()
},
methods: {
search(condition) {
const temp = formatCondition(condition)
const param = temp || {}
userLists(1, 0, param).then(response => {
debugger
const data = response.data
this.data = data.listObject
})
},
cancel() {
console.log('role cancel')
},
handleCurrentChange(val) {
console.log('handleCurrentChange')
}
}
}
</script>
<style scoped>
.my_table >>> .el-table__row>td{
/* 去除表格线 */
border: none;
padding: 0 0;
}
.my_table >>> .el-table th.is-leaf {
/* 去除上边框 */
border: none;
}
.my_table >>> .el-table::before{
/* 去除下边框 */
height: 0;
}
</style>

View File

@ -0,0 +1,45 @@
<template>
<de-container>
<de-main-container>
<el-tabs v-model="authorityType" @tab-click="handleClick">
<el-tab-pane name="authConfig">
<span slot="label">权限配置</span>
<auth-config />
</el-tab-pane>
<el-tab-pane name="authQuickConfig">
<span slot="label">权限快捷配置</span>
<auth-quick-config />
</el-tab-pane>
</el-tabs>
</de-main-container>
</de-container>
</template>
<script>
import DeMainContainer from '@/components/dataease/DeMainContainer'
import DeContainer from '@/components/dataease/DeContainer'
import AuthConfig from './authConfig'
import AuthQuickConfig from './authQuickConfig'
export default {
name: 'Authority',
components: { DeContainer, DeMainContainer, AuthConfig, AuthQuickConfig },
data() {
return {
authorityType: 'authConfig'
}
},
watch: {
},
mounted() {
},
methods: {
handleClick() {
console.log('===>handleClick')
}
}
}
</script>
<style scoped>
</style>