From f0b9b631b5b5c73f1ed95984ca5101e616a19e66 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Mon, 22 Mar 2021 17:33:19 +0800 Subject: [PATCH 1/3] fix: i18n --- .../business/components/api/automation/scenario/EnvPopover.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/business/components/api/automation/scenario/EnvPopover.vue b/frontend/src/business/components/api/automation/scenario/EnvPopover.vue index e9807cddab..f17b968995 100644 --- a/frontend/src/business/components/api/automation/scenario/EnvPopover.vue +++ b/frontend/src/business/components/api/automation/scenario/EnvPopover.vue @@ -8,7 +8,8 @@ - 环境配置 + {{ $t('api_test.definition.request.run_env') }} + From c532baf241fea6684f0ca59e65a3c242b6144b1b Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Mon, 22 Mar 2021 17:39:07 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix(xPack):=20=E6=8A=A5=E8=A1=A8=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E6=9D=A1=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/business/components/xpack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index 3dbd5a3d7e..f63ebb68eb 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit 3dbd5a3d7ec96a10e11d817cdec25832986af1d2 +Subproject commit f63ebb68ebad78de42fd711f17e2671e34577a86 From a0d6e056a219f14b8a8eaccae3487502d9fdcc4c Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Mon, 22 Mar 2021 17:58:52 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/base/domain/TestCaseTest.java | 9 +- .../base/domain/TestCaseTestExample.java | 190 ++++++---- .../base/mapper/TestCaseTestMapper.java | 11 +- .../base/mapper/TestCaseTestMapper.xml | 358 ++++++++---------- .../base/mapper/ext/ExtTestCaseMapper.java | 2 +- .../base/mapper/ext/ExtTestCaseMapper.xml | 18 +- .../track/controller/TrackController.java | 13 +- .../track/service/TestCaseService.java | 12 +- .../track/service/TrackService.java | 2 +- .../db/migration/V78__v1.8_release.sql | 2 + 10 files changed, 325 insertions(+), 292 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseTest.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseTest.java index 16f0754d4f..47e4c5c535 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseTest.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseTest.java @@ -1,18 +1,19 @@ package io.metersphere.base.domain; -import lombok.Data; - import java.io.Serializable; +import lombok.Data; @Data public class TestCaseTest implements Serializable { - private String id; - private String testCaseId; private String testId; private String testType; + private Long createTime; + + private Long updateTime; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseTestExample.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseTestExample.java index dade071131..6453335cc2 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseTestExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseTestExample.java @@ -104,76 +104,6 @@ public class TestCaseTestExample { 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 andTestCaseIdIsNull() { addCriterion("test_case_id is null"); return (Criteria) this; @@ -383,6 +313,126 @@ public class TestCaseTestExample { addCriterion("test_type not between", value1, value2, "testType"); 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 static class Criteria extends GeneratedCriteria { diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestCaseTestMapper.java b/backend/src/main/java/io/metersphere/base/mapper/TestCaseTestMapper.java index 444584fe4e..f8fcb8eee6 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseTestMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseTestMapper.java @@ -2,30 +2,21 @@ package io.metersphere.base.mapper; import io.metersphere.base.domain.TestCaseTest; import io.metersphere.base.domain.TestCaseTestExample; -import org.apache.ibatis.annotations.Param; - import java.util.List; +import org.apache.ibatis.annotations.Param; public interface TestCaseTestMapper { long countByExample(TestCaseTestExample example); int deleteByExample(TestCaseTestExample example); - int deleteByPrimaryKey(String id); - int insert(TestCaseTest record); int insertSelective(TestCaseTest record); List selectByExample(TestCaseTestExample example); - TestCaseTest selectByPrimaryKey(String id); - int updateByExampleSelective(@Param("record") TestCaseTest record, @Param("example") TestCaseTestExample example); int updateByExample(@Param("record") TestCaseTest record, @Param("example") TestCaseTestExample example); - - int updateByPrimaryKeySelective(TestCaseTest record); - - int updateByPrimaryKey(TestCaseTest record); } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestCaseTestMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestCaseTestMapper.xml index af19225f39..45bf667ec5 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseTestMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseTestMapper.xml @@ -1,201 +1,175 @@ - - - - - - - - - - - - - - - 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} + + + - - - - - - - - - - - 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, test_case_id, test_id, test_type - - - - - delete - from test_case_test - where id = #{id,jdbcType=VARCHAR} - - - delete from test_case_test - - - - - - insert into test_case_test (id, test_case_id, test_id, - test_type) - values (#{id,jdbcType=VARCHAR}, #{testCaseId,jdbcType=VARCHAR}, #{testId,jdbcType=VARCHAR}, - #{testType,jdbcType=VARCHAR}) - - - insert into test_case_test - - - id, - - - test_case_id, - - - test_id, - - - test_type, - - - - - #{id,jdbcType=VARCHAR}, - - - #{testCaseId,jdbcType=VARCHAR}, - - - #{testId,jdbcType=VARCHAR}, - - - #{testType,jdbcType=VARCHAR}, - - - - - - update test_case_test - - - id = #{record.id,jdbcType=VARCHAR}, - - - test_case_id = #{record.testCaseId,jdbcType=VARCHAR}, - - - test_id = #{record.testId,jdbcType=VARCHAR}, - - - test_type = #{record.testType,jdbcType=VARCHAR}, - - - - - - - - update test_case_test - set id = #{record.id,jdbcType=VARCHAR}, + + + + + test_case_id, test_id, test_type, create_time, update_time + + + + delete from test_case_test + + + + + + insert into test_case_test (test_case_id, test_id, test_type, + create_time, update_time) + values (#{testCaseId,jdbcType=VARCHAR}, #{testId,jdbcType=VARCHAR}, #{testType,jdbcType=VARCHAR}, + #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}) + + + insert into test_case_test + + + test_case_id, + + + test_id, + + + test_type, + + + create_time, + + + update_time, + + + + + #{testCaseId,jdbcType=VARCHAR}, + + + #{testId,jdbcType=VARCHAR}, + + + #{testType,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=BIGINT}, + + + + + + update test_case_test + + test_case_id = #{record.testCaseId,jdbcType=VARCHAR}, + + test_id = #{record.testId,jdbcType=VARCHAR}, - test_type = #{record.testType,jdbcType=VARCHAR} - - - - - - update test_case_test - - - test_case_id = #{testCaseId,jdbcType=VARCHAR}, - - - test_id = #{testId,jdbcType=VARCHAR}, - - - test_type = #{testType,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=VARCHAR} - - - update test_case_test - set test_case_id = #{testCaseId,jdbcType=VARCHAR}, - test_id = #{testId,jdbcType=VARCHAR}, - test_type = #{testType,jdbcType=VARCHAR} - where id = #{id,jdbcType=VARCHAR} - + + + test_type = #{record.testType,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + update_time = #{record.updateTime,jdbcType=BIGINT}, + + + + + + + + update test_case_test + set test_case_id = #{record.testCaseId,jdbcType=VARCHAR}, + test_id = #{record.testId,jdbcType=VARCHAR}, + test_type = #{record.testType,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT} + + + + \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java index 17ae2078b3..9a8e381c1f 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java @@ -65,7 +65,7 @@ public interface ExtTestCaseMapper { long countRelevanceCreatedThisWeek(@Param("projectId") String projectId,@Param("firstDayTimestamp") long firstDayTimestamp, @Param("lastDayTimestamp") long lastDayTimestamp); - List countCoverage(@Param("projectId") String projectId); + int countCoverage(@Param("projectId") String projectId); List countFuncMaintainer(@Param("projectId") String projectId); diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml index aeef002a4e..f5a09e4567 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml @@ -343,17 +343,19 @@ - + select count(test_case.id) from test_case where test_case.project_id = #{projectId} + and test_case.id in (select distinct test_case_test.test_case_id from test_case_test)