From ae624768b3992ac32fb801b369a6bf9f09b5892c Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 7 May 2021 14:53:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=BC=BA=E9=99=B7=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=88=9B=E5=BB=BA=E4=BA=BA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/base/domain/Issues.java | 2 + .../io/metersphere/base/domain/IssuesDao.java | 1 + .../base/domain/IssuesExample.java | 70 +++++++++++++++++++ .../metersphere/base/mapper/IssuesMapper.xml | 30 ++++++-- .../base/mapper/ext/ExtIssuesMapper.xml | 1 + .../commons/utils/ServiceUtils.java | 14 ++++ .../track/service/IssuesService.java | 11 +++ .../db/migration/V82__v1.9.2_release.sql | 6 ++ .../src/main/resources/generatorConfig.xml | 4 +- .../track/issue/IssueEditDetail.vue | 27 ++++++- .../components/track/issue/IssueList.vue | 5 ++ 11 files changed, 162 insertions(+), 9 deletions(-) create mode 100644 backend/src/main/resources/db/migration/V82__v1.9.2_release.sql diff --git a/backend/src/main/java/io/metersphere/base/domain/Issues.java b/backend/src/main/java/io/metersphere/base/domain/Issues.java index d5ac807e35..434f515348 100644 --- a/backend/src/main/java/io/metersphere/base/domain/Issues.java +++ b/backend/src/main/java/io/metersphere/base/domain/Issues.java @@ -23,5 +23,7 @@ public class Issues implements Serializable { private String projectId; + private String creator; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/IssuesDao.java b/backend/src/main/java/io/metersphere/base/domain/IssuesDao.java index 868ac6cba0..f8b99ab1cd 100644 --- a/backend/src/main/java/io/metersphere/base/domain/IssuesDao.java +++ b/backend/src/main/java/io/metersphere/base/domain/IssuesDao.java @@ -8,4 +8,5 @@ import lombok.Setter; public class IssuesDao extends IssuesWithBLOBs { private String model; private String projectName; + private String creatorName; } diff --git a/backend/src/main/java/io/metersphere/base/domain/IssuesExample.java b/backend/src/main/java/io/metersphere/base/domain/IssuesExample.java index 0beea9d72d..ffd977730e 100644 --- a/backend/src/main/java/io/metersphere/base/domain/IssuesExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/IssuesExample.java @@ -713,6 +713,76 @@ public class IssuesExample { addCriterion("project_id not between", value1, value2, "projectId"); 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 static class Criteria extends GeneratedCriteria { diff --git a/backend/src/main/java/io/metersphere/base/mapper/IssuesMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/IssuesMapper.xml index 5f6ca6d4e8..d17e5a6147 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/IssuesMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/IssuesMapper.xml @@ -11,6 +11,7 @@ + @@ -75,7 +76,8 @@ - id, title, `status`, create_time, update_time, reporter, lastmodify, platform, project_id + id, title, `status`, create_time, update_time, reporter, lastmodify, platform, project_id, + creator description, custom_fields @@ -132,11 +134,13 @@ insert into issues (id, title, `status`, create_time, update_time, reporter, lastmodify, platform, project_id, - description, custom_fields) + creator, description, custom_fields + ) values (#{id,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{reporter,jdbcType=VARCHAR}, #{lastmodify,jdbcType=VARCHAR}, #{platform,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, - #{description,jdbcType=LONGVARCHAR}, #{customFields,jdbcType=LONGVARCHAR}) + #{creator,jdbcType=VARCHAR}, #{description,jdbcType=LONGVARCHAR}, #{customFields,jdbcType=LONGVARCHAR} + ) insert into issues @@ -168,6 +172,9 @@ project_id, + + creator, + description, @@ -203,6 +210,9 @@ #{projectId,jdbcType=VARCHAR}, + + #{creator,jdbcType=VARCHAR}, + #{description,jdbcType=LONGVARCHAR}, @@ -247,6 +257,9 @@ project_id = #{record.projectId,jdbcType=VARCHAR}, + + creator = #{record.creator,jdbcType=VARCHAR}, + description = #{record.description,jdbcType=LONGVARCHAR}, @@ -269,6 +282,7 @@ lastmodify = #{record.lastmodify,jdbcType=VARCHAR}, platform = #{record.platform,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR}, + creator = #{record.creator,jdbcType=VARCHAR}, description = #{record.description,jdbcType=LONGVARCHAR}, custom_fields = #{record.customFields,jdbcType=LONGVARCHAR} @@ -285,7 +299,8 @@ reporter = #{record.reporter,jdbcType=VARCHAR}, lastmodify = #{record.lastmodify,jdbcType=VARCHAR}, platform = #{record.platform,jdbcType=VARCHAR}, - project_id = #{record.projectId,jdbcType=VARCHAR} + project_id = #{record.projectId,jdbcType=VARCHAR}, + creator = #{record.creator,jdbcType=VARCHAR} @@ -317,6 +332,9 @@ project_id = #{projectId,jdbcType=VARCHAR}, + + creator = #{creator,jdbcType=VARCHAR}, + description = #{description,jdbcType=LONGVARCHAR}, @@ -336,6 +354,7 @@ lastmodify = #{lastmodify,jdbcType=VARCHAR}, platform = #{platform,jdbcType=VARCHAR}, project_id = #{projectId,jdbcType=VARCHAR}, + creator = #{creator,jdbcType=VARCHAR}, description = #{description,jdbcType=LONGVARCHAR}, custom_fields = #{customFields,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=VARCHAR} @@ -349,7 +368,8 @@ reporter = #{reporter,jdbcType=VARCHAR}, lastmodify = #{lastmodify,jdbcType=VARCHAR}, platform = #{platform,jdbcType=VARCHAR}, - project_id = #{projectId,jdbcType=VARCHAR} + project_id = #{projectId,jdbcType=VARCHAR}, + creator = #{creator,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml index 4ff587bd67..f90fc91d1c 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtIssuesMapper.xml @@ -14,6 +14,7 @@