From 1dc9eb9b58a4315974f11983636a55dc683691bf Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 12 May 2021 15:47:48 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=94=A8=E6=88=B7=E7=BB=84=E5=92=8C?= =?UTF-8?q?=E6=9D=83=E9=99=90):=20=E7=94=9F=E6=88=90=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/base/domain/UserGroup.java | 27 + .../base/domain/UserGroupExample.java | 800 ++++++++++++++++++ .../base/domain/UserGroupPermission.java | 17 + .../domain/UserGroupPermissionExample.java | 480 +++++++++++ .../base/mapper/UserGroupMapper.java | 30 + .../base/mapper/UserGroupMapper.xml | 275 ++++++ .../mapper/UserGroupPermissionMapper.java | 30 + .../base/mapper/UserGroupPermissionMapper.xml | 196 +++++ 8 files changed, 1855 insertions(+) create mode 100644 backend/src/main/java/io/metersphere/base/domain/UserGroup.java create mode 100644 backend/src/main/java/io/metersphere/base/domain/UserGroupExample.java create mode 100644 backend/src/main/java/io/metersphere/base/domain/UserGroupPermission.java create mode 100644 backend/src/main/java/io/metersphere/base/domain/UserGroupPermissionExample.java create mode 100644 backend/src/main/java/io/metersphere/base/mapper/UserGroupMapper.java create mode 100644 backend/src/main/java/io/metersphere/base/mapper/UserGroupMapper.xml create mode 100644 backend/src/main/java/io/metersphere/base/mapper/UserGroupPermissionMapper.java create mode 100644 backend/src/main/java/io/metersphere/base/mapper/UserGroupPermissionMapper.xml diff --git a/backend/src/main/java/io/metersphere/base/domain/UserGroup.java b/backend/src/main/java/io/metersphere/base/domain/UserGroup.java new file mode 100644 index 0000000000..7f59a3c14f --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/UserGroup.java @@ -0,0 +1,27 @@ +package io.metersphere.base.domain; + +import java.io.Serializable; +import lombok.Data; + +@Data +public class UserGroup implements Serializable { + private String id; + + private String name; + + private String description; + + private Boolean system; + + private String type; + + private Long createTime; + + private Long updateTime; + + private String creator; + + private String scopeId; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/UserGroupExample.java b/backend/src/main/java/io/metersphere/base/domain/UserGroupExample.java new file mode 100644 index 0000000000..4e3437acb2 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/UserGroupExample.java @@ -0,0 +1,800 @@ +package io.metersphere.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class UserGroupExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public UserGroupExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria 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 values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List 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 values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List 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 andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andSystemIsNull() { + addCriterion("`system` is null"); + return (Criteria) this; + } + + public Criteria andSystemIsNotNull() { + addCriterion("`system` is not null"); + return (Criteria) this; + } + + public Criteria andSystemEqualTo(Boolean value) { + addCriterion("`system` =", value, "system"); + return (Criteria) this; + } + + public Criteria andSystemNotEqualTo(Boolean value) { + addCriterion("`system` <>", value, "system"); + return (Criteria) this; + } + + public Criteria andSystemGreaterThan(Boolean value) { + addCriterion("`system` >", value, "system"); + return (Criteria) this; + } + + public Criteria andSystemGreaterThanOrEqualTo(Boolean value) { + addCriterion("`system` >=", value, "system"); + return (Criteria) this; + } + + public Criteria andSystemLessThan(Boolean value) { + addCriterion("`system` <", value, "system"); + return (Criteria) this; + } + + public Criteria andSystemLessThanOrEqualTo(Boolean value) { + addCriterion("`system` <=", value, "system"); + return (Criteria) this; + } + + public Criteria andSystemIn(List values) { + addCriterion("`system` in", values, "system"); + return (Criteria) this; + } + + public Criteria andSystemNotIn(List values) { + addCriterion("`system` not in", values, "system"); + return (Criteria) this; + } + + public Criteria andSystemBetween(Boolean value1, Boolean value2) { + addCriterion("`system` between", value1, value2, "system"); + return (Criteria) this; + } + + public Criteria andSystemNotBetween(Boolean value1, Boolean value2) { + addCriterion("`system` not between", value1, value2, "system"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("`type` like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("`type` not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Long value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Long value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Long value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Long value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Long value1, Long value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public 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 values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List 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 Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(String value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(String value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(String value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(String value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(String value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(String value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLike(String value) { + addCriterion("creator like", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotLike(String value) { + addCriterion("creator not like", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(String value1, String value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(String value1, String value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andScopeIdIsNull() { + addCriterion("scope_id is null"); + return (Criteria) this; + } + + public Criteria andScopeIdIsNotNull() { + addCriterion("scope_id is not null"); + return (Criteria) this; + } + + public Criteria andScopeIdEqualTo(String value) { + addCriterion("scope_id =", value, "scopeId"); + return (Criteria) this; + } + + public Criteria andScopeIdNotEqualTo(String value) { + addCriterion("scope_id <>", value, "scopeId"); + return (Criteria) this; + } + + public Criteria andScopeIdGreaterThan(String value) { + addCriterion("scope_id >", value, "scopeId"); + return (Criteria) this; + } + + public Criteria andScopeIdGreaterThanOrEqualTo(String value) { + addCriterion("scope_id >=", value, "scopeId"); + return (Criteria) this; + } + + public Criteria andScopeIdLessThan(String value) { + addCriterion("scope_id <", value, "scopeId"); + return (Criteria) this; + } + + public Criteria andScopeIdLessThanOrEqualTo(String value) { + addCriterion("scope_id <=", value, "scopeId"); + return (Criteria) this; + } + + public Criteria andScopeIdLike(String value) { + addCriterion("scope_id like", value, "scopeId"); + return (Criteria) this; + } + + public Criteria andScopeIdNotLike(String value) { + addCriterion("scope_id not like", value, "scopeId"); + return (Criteria) this; + } + + public Criteria andScopeIdIn(List values) { + addCriterion("scope_id in", values, "scopeId"); + return (Criteria) this; + } + + public Criteria andScopeIdNotIn(List values) { + addCriterion("scope_id not in", values, "scopeId"); + return (Criteria) this; + } + + public Criteria andScopeIdBetween(String value1, String value2) { + addCriterion("scope_id between", value1, value2, "scopeId"); + return (Criteria) this; + } + + public Criteria andScopeIdNotBetween(String value1, String value2) { + addCriterion("scope_id not between", value1, value2, "scopeId"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/UserGroupPermission.java b/backend/src/main/java/io/metersphere/base/domain/UserGroupPermission.java new file mode 100644 index 0000000000..11152c469a --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/UserGroupPermission.java @@ -0,0 +1,17 @@ +package io.metersphere.base.domain; + +import java.io.Serializable; +import lombok.Data; + +@Data +public class UserGroupPermission implements Serializable { + private String id; + + private String groupId; + + private String permissionId; + + private String moduleId; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/UserGroupPermissionExample.java b/backend/src/main/java/io/metersphere/base/domain/UserGroupPermissionExample.java new file mode 100644 index 0000000000..2adcbabd5f --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/UserGroupPermissionExample.java @@ -0,0 +1,480 @@ +package io.metersphere.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class UserGroupPermissionExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public UserGroupPermissionExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria 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 values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List 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 andGroupIdIsNull() { + addCriterion("group_id is null"); + return (Criteria) this; + } + + public Criteria andGroupIdIsNotNull() { + addCriterion("group_id is not null"); + return (Criteria) this; + } + + public Criteria andGroupIdEqualTo(String value) { + addCriterion("group_id =", value, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdNotEqualTo(String value) { + addCriterion("group_id <>", value, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdGreaterThan(String value) { + addCriterion("group_id >", value, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdGreaterThanOrEqualTo(String value) { + addCriterion("group_id >=", value, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdLessThan(String value) { + addCriterion("group_id <", value, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdLessThanOrEqualTo(String value) { + addCriterion("group_id <=", value, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdLike(String value) { + addCriterion("group_id like", value, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdNotLike(String value) { + addCriterion("group_id not like", value, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdIn(List values) { + addCriterion("group_id in", values, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdNotIn(List values) { + addCriterion("group_id not in", values, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdBetween(String value1, String value2) { + addCriterion("group_id between", value1, value2, "groupId"); + return (Criteria) this; + } + + public Criteria andGroupIdNotBetween(String value1, String value2) { + addCriterion("group_id not between", value1, value2, "groupId"); + return (Criteria) this; + } + + public Criteria andPermissionIdIsNull() { + addCriterion("permission_id is null"); + return (Criteria) this; + } + + public Criteria andPermissionIdIsNotNull() { + addCriterion("permission_id is not null"); + return (Criteria) this; + } + + public Criteria andPermissionIdEqualTo(String value) { + addCriterion("permission_id =", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdNotEqualTo(String value) { + addCriterion("permission_id <>", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdGreaterThan(String value) { + addCriterion("permission_id >", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdGreaterThanOrEqualTo(String value) { + addCriterion("permission_id >=", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdLessThan(String value) { + addCriterion("permission_id <", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdLessThanOrEqualTo(String value) { + addCriterion("permission_id <=", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdLike(String value) { + addCriterion("permission_id like", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdNotLike(String value) { + addCriterion("permission_id not like", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdIn(List values) { + addCriterion("permission_id in", values, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdNotIn(List values) { + addCriterion("permission_id not in", values, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdBetween(String value1, String value2) { + addCriterion("permission_id between", value1, value2, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdNotBetween(String value1, String value2) { + addCriterion("permission_id not between", value1, value2, "permissionId"); + return (Criteria) this; + } + + public Criteria andModuleIdIsNull() { + addCriterion("module_id is null"); + return (Criteria) this; + } + + public Criteria andModuleIdIsNotNull() { + addCriterion("module_id is not null"); + return (Criteria) this; + } + + public Criteria andModuleIdEqualTo(String value) { + addCriterion("module_id =", value, "moduleId"); + return (Criteria) this; + } + + public Criteria andModuleIdNotEqualTo(String value) { + addCriterion("module_id <>", value, "moduleId"); + return (Criteria) this; + } + + public Criteria andModuleIdGreaterThan(String value) { + addCriterion("module_id >", value, "moduleId"); + return (Criteria) this; + } + + public Criteria andModuleIdGreaterThanOrEqualTo(String value) { + addCriterion("module_id >=", value, "moduleId"); + return (Criteria) this; + } + + public Criteria andModuleIdLessThan(String value) { + addCriterion("module_id <", value, "moduleId"); + return (Criteria) this; + } + + public Criteria andModuleIdLessThanOrEqualTo(String value) { + addCriterion("module_id <=", value, "moduleId"); + return (Criteria) this; + } + + public Criteria andModuleIdLike(String value) { + addCriterion("module_id like", value, "moduleId"); + return (Criteria) this; + } + + public Criteria andModuleIdNotLike(String value) { + addCriterion("module_id not like", value, "moduleId"); + return (Criteria) this; + } + + public Criteria andModuleIdIn(List values) { + addCriterion("module_id in", values, "moduleId"); + return (Criteria) this; + } + + public Criteria andModuleIdNotIn(List values) { + addCriterion("module_id not in", values, "moduleId"); + return (Criteria) this; + } + + public Criteria andModuleIdBetween(String value1, String value2) { + addCriterion("module_id between", value1, value2, "moduleId"); + return (Criteria) this; + } + + public Criteria andModuleIdNotBetween(String value1, String value2) { + addCriterion("module_id not between", value1, value2, "moduleId"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/UserGroupMapper.java b/backend/src/main/java/io/metersphere/base/mapper/UserGroupMapper.java new file mode 100644 index 0000000000..984e3754fa --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/UserGroupMapper.java @@ -0,0 +1,30 @@ +package io.metersphere.base.mapper; + +import io.metersphere.base.domain.UserGroup; +import io.metersphere.base.domain.UserGroupExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface UserGroupMapper { + long countByExample(UserGroupExample example); + + int deleteByExample(UserGroupExample example); + + int deleteByPrimaryKey(String id); + + int insert(UserGroup record); + + int insertSelective(UserGroup record); + + List selectByExample(UserGroupExample example); + + UserGroup selectByPrimaryKey(String id); + + int updateByExampleSelective(@Param("record") UserGroup record, @Param("example") UserGroupExample example); + + int updateByExample(@Param("record") UserGroup record, @Param("example") UserGroupExample example); + + int updateByPrimaryKeySelective(UserGroup record); + + int updateByPrimaryKey(UserGroup record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/UserGroupMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/UserGroupMapper.xml new file mode 100644 index 0000000000..79af5db317 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/UserGroupMapper.xml @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, `name`, description, `system`, `type`, create_time, update_time, creator, scope_id + + + + + delete from user_group + where id = #{id,jdbcType=VARCHAR} + + + delete from user_group + + + + + + insert into user_group (id, `name`, description, + `system`, `type`, create_time, + update_time, creator, scope_id + ) + values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, + #{system,jdbcType=BIT}, #{type,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, + #{updateTime,jdbcType=BIGINT}, #{creator,jdbcType=VARCHAR}, #{scopeId,jdbcType=VARCHAR} + ) + + + insert into user_group + + + id, + + + `name`, + + + description, + + + `system`, + + + `type`, + + + create_time, + + + update_time, + + + creator, + + + scope_id, + + + + + #{id,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{system,jdbcType=BIT}, + + + #{type,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=BIGINT}, + + + #{creator,jdbcType=VARCHAR}, + + + #{scopeId,jdbcType=VARCHAR}, + + + + + + update user_group + + + id = #{record.id,jdbcType=VARCHAR}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + description = #{record.description,jdbcType=VARCHAR}, + + + `system` = #{record.system,jdbcType=BIT}, + + + `type` = #{record.type,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + update_time = #{record.updateTime,jdbcType=BIGINT}, + + + creator = #{record.creator,jdbcType=VARCHAR}, + + + scope_id = #{record.scopeId,jdbcType=VARCHAR}, + + + + + + + + update user_group + set id = #{record.id,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + description = #{record.description,jdbcType=VARCHAR}, + `system` = #{record.system,jdbcType=BIT}, + `type` = #{record.type,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT}, + creator = #{record.creator,jdbcType=VARCHAR}, + scope_id = #{record.scopeId,jdbcType=VARCHAR} + + + + + + update user_group + + + `name` = #{name,jdbcType=VARCHAR}, + + + description = #{description,jdbcType=VARCHAR}, + + + `system` = #{system,jdbcType=BIT}, + + + `type` = #{type,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=BIGINT}, + + + creator = #{creator,jdbcType=VARCHAR}, + + + scope_id = #{scopeId,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=VARCHAR} + + + update user_group + set `name` = #{name,jdbcType=VARCHAR}, + description = #{description,jdbcType=VARCHAR}, + `system` = #{system,jdbcType=BIT}, + `type` = #{type,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=BIGINT}, + creator = #{creator,jdbcType=VARCHAR}, + scope_id = #{scopeId,jdbcType=VARCHAR} + where id = #{id,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/UserGroupPermissionMapper.java b/backend/src/main/java/io/metersphere/base/mapper/UserGroupPermissionMapper.java new file mode 100644 index 0000000000..551819a9ca --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/UserGroupPermissionMapper.java @@ -0,0 +1,30 @@ +package io.metersphere.base.mapper; + +import io.metersphere.base.domain.UserGroupPermission; +import io.metersphere.base.domain.UserGroupPermissionExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface UserGroupPermissionMapper { + long countByExample(UserGroupPermissionExample example); + + int deleteByExample(UserGroupPermissionExample example); + + int deleteByPrimaryKey(String id); + + int insert(UserGroupPermission record); + + int insertSelective(UserGroupPermission record); + + List selectByExample(UserGroupPermissionExample example); + + UserGroupPermission selectByPrimaryKey(String id); + + int updateByExampleSelective(@Param("record") UserGroupPermission record, @Param("example") UserGroupPermissionExample example); + + int updateByExample(@Param("record") UserGroupPermission record, @Param("example") UserGroupPermissionExample example); + + int updateByPrimaryKeySelective(UserGroupPermission record); + + int updateByPrimaryKey(UserGroupPermission record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/UserGroupPermissionMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/UserGroupPermissionMapper.xml new file mode 100644 index 0000000000..ddbddaf47c --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/UserGroupPermissionMapper.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, group_id, permission_id, module_id + + + + + delete from user_group_permission + where id = #{id,jdbcType=VARCHAR} + + + delete from user_group_permission + + + + + + insert into user_group_permission (id, group_id, permission_id, + module_id) + values (#{id,jdbcType=VARCHAR}, #{groupId,jdbcType=VARCHAR}, #{permissionId,jdbcType=VARCHAR}, + #{moduleId,jdbcType=VARCHAR}) + + + insert into user_group_permission + + + id, + + + group_id, + + + permission_id, + + + module_id, + + + + + #{id,jdbcType=VARCHAR}, + + + #{groupId,jdbcType=VARCHAR}, + + + #{permissionId,jdbcType=VARCHAR}, + + + #{moduleId,jdbcType=VARCHAR}, + + + + + + update user_group_permission + + + id = #{record.id,jdbcType=VARCHAR}, + + + group_id = #{record.groupId,jdbcType=VARCHAR}, + + + permission_id = #{record.permissionId,jdbcType=VARCHAR}, + + + module_id = #{record.moduleId,jdbcType=VARCHAR}, + + + + + + + + update user_group_permission + set id = #{record.id,jdbcType=VARCHAR}, + group_id = #{record.groupId,jdbcType=VARCHAR}, + permission_id = #{record.permissionId,jdbcType=VARCHAR}, + module_id = #{record.moduleId,jdbcType=VARCHAR} + + + + + + update user_group_permission + + + group_id = #{groupId,jdbcType=VARCHAR}, + + + permission_id = #{permissionId,jdbcType=VARCHAR}, + + + module_id = #{moduleId,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=VARCHAR} + + + update user_group_permission + set group_id = #{groupId,jdbcType=VARCHAR}, + permission_id = #{permissionId,jdbcType=VARCHAR}, + module_id = #{moduleId,jdbcType=VARCHAR} + where id = #{id,jdbcType=VARCHAR} + + \ No newline at end of file