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)