refactor: 删除版本时删除相关资源

This commit is contained in:
CaptainB 2022-01-17 19:03:23 +08:00 committed by 刘瑞斌
parent 739e2d25f2
commit 38eaefc5da
9 changed files with 106 additions and 16 deletions

View File

@ -32,11 +32,13 @@ public class ApiScenarioReport implements Serializable {
private String actuator; private String actuator;
private String description; private Long endTime;
private Integer reportVersion; private Integer reportVersion;
private Long endTime; private String versionId;
private String description;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

View File

@ -1113,6 +1113,76 @@ public class ApiScenarioReportExample {
addCriterion("report_version not between", value1, value2, "reportVersion"); addCriterion("report_version not between", value1, value2, "reportVersion");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andVersionIdIsNull() {
addCriterion("version_id is null");
return (Criteria) this;
}
public Criteria andVersionIdIsNotNull() {
addCriterion("version_id is not null");
return (Criteria) this;
}
public Criteria andVersionIdEqualTo(String value) {
addCriterion("version_id =", value, "versionId");
return (Criteria) this;
}
public Criteria andVersionIdNotEqualTo(String value) {
addCriterion("version_id <>", value, "versionId");
return (Criteria) this;
}
public Criteria andVersionIdGreaterThan(String value) {
addCriterion("version_id >", value, "versionId");
return (Criteria) this;
}
public Criteria andVersionIdGreaterThanOrEqualTo(String value) {
addCriterion("version_id >=", value, "versionId");
return (Criteria) this;
}
public Criteria andVersionIdLessThan(String value) {
addCriterion("version_id <", value, "versionId");
return (Criteria) this;
}
public Criteria andVersionIdLessThanOrEqualTo(String value) {
addCriterion("version_id <=", value, "versionId");
return (Criteria) this;
}
public Criteria andVersionIdLike(String value) {
addCriterion("version_id like", value, "versionId");
return (Criteria) this;
}
public Criteria andVersionIdNotLike(String value) {
addCriterion("version_id not like", value, "versionId");
return (Criteria) this;
}
public Criteria andVersionIdIn(List<String> values) {
addCriterion("version_id in", values, "versionId");
return (Criteria) this;
}
public Criteria andVersionIdNotIn(List<String> values) {
addCriterion("version_id not in", values, "versionId");
return (Criteria) this;
}
public Criteria andVersionIdBetween(String value1, String value2) {
addCriterion("version_id between", value1, value2, "versionId");
return (Criteria) this;
}
public Criteria andVersionIdNotBetween(String value1, String value2) {
addCriterion("version_id not between", value1, value2, "versionId");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {

View File

@ -17,6 +17,7 @@
<result column="actuator" jdbcType="VARCHAR" property="actuator" /> <result column="actuator" jdbcType="VARCHAR" property="actuator" />
<result column="end_time" jdbcType="BIGINT" property="endTime" /> <result column="end_time" jdbcType="BIGINT" property="endTime" />
<result column="report_version" jdbcType="INTEGER" property="reportVersion" /> <result column="report_version" jdbcType="INTEGER" property="reportVersion" />
<result column="version_id" jdbcType="VARCHAR" property="versionId" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiScenarioReport"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiScenarioReport">
<result column="description" jdbcType="LONGVARCHAR" property="description" /> <result column="description" jdbcType="LONGVARCHAR" property="description" />
@ -81,7 +82,8 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, project_id, `name`, create_time, update_time, `status`, user_id, trigger_mode, id, project_id, `name`, create_time, update_time, `status`, user_id, trigger_mode,
execute_type, scenario_name, scenario_id, create_user, actuator, end_time, report_version execute_type, scenario_name, scenario_id, create_user, actuator, end_time, report_version,
version_id
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
description description
@ -135,18 +137,18 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="io.metersphere.base.domain.ApiScenarioReport"> <insert id="insert" parameterType="io.metersphere.base.domain.ApiScenarioReport">
insert into api_scenario_report (id, project_id, `name`, INSERT INTO api_scenario_report (id, project_id, `name`,
create_time, update_time, `status`, create_time, update_time, `status`,
user_id, trigger_mode, execute_type, user_id, trigger_mode, execute_type,
scenario_name, scenario_id, create_user, scenario_name, scenario_id, create_user,
actuator, end_time, report_version, actuator, end_time, report_version,
description) version_id, description)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, VALUES (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{status,jdbcType=VARCHAR},
#{userId,jdbcType=VARCHAR}, #{triggerMode,jdbcType=VARCHAR}, #{executeType,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{triggerMode,jdbcType=VARCHAR}, #{executeType,jdbcType=VARCHAR},
#{scenarioName,jdbcType=VARCHAR}, #{scenarioId,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, #{scenarioName,jdbcType=VARCHAR}, #{scenarioId,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR},
#{actuator,jdbcType=VARCHAR}, #{endTime,jdbcType=BIGINT}, #{reportVersion,jdbcType=INTEGER}, #{actuator,jdbcType=VARCHAR}, #{endTime,jdbcType=BIGINT}, #{reportVersion,jdbcType=INTEGER},
#{description,jdbcType=LONGVARCHAR}) #{versionId,jdbcType=VARCHAR}, #{description,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiScenarioReport"> <insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiScenarioReport">
insert into api_scenario_report insert into api_scenario_report
@ -196,6 +198,9 @@
<if test="reportVersion != null"> <if test="reportVersion != null">
report_version, report_version,
</if> </if>
<if test="versionId != null">
version_id,
</if>
<if test="description != null"> <if test="description != null">
description, description,
</if> </if>
@ -246,6 +251,9 @@
<if test="reportVersion != null"> <if test="reportVersion != null">
#{reportVersion,jdbcType=INTEGER}, #{reportVersion,jdbcType=INTEGER},
</if> </if>
<if test="versionId != null">
#{versionId,jdbcType=VARCHAR},
</if>
<if test="description != null"> <if test="description != null">
#{description,jdbcType=LONGVARCHAR}, #{description,jdbcType=LONGVARCHAR},
</if> </if>
@ -305,6 +313,9 @@
<if test="record.reportVersion != null"> <if test="record.reportVersion != null">
report_version = #{record.reportVersion,jdbcType=INTEGER}, report_version = #{record.reportVersion,jdbcType=INTEGER},
</if> </if>
<if test="record.versionId != null">
version_id = #{record.versionId,jdbcType=VARCHAR},
</if>
<if test="record.description != null"> <if test="record.description != null">
description = #{record.description,jdbcType=LONGVARCHAR}, description = #{record.description,jdbcType=LONGVARCHAR},
</if> </if>
@ -330,6 +341,7 @@
actuator = #{record.actuator,jdbcType=VARCHAR}, actuator = #{record.actuator,jdbcType=VARCHAR},
end_time = #{record.endTime,jdbcType=BIGINT}, end_time = #{record.endTime,jdbcType=BIGINT},
report_version = #{record.reportVersion,jdbcType=INTEGER}, report_version = #{record.reportVersion,jdbcType=INTEGER},
version_id = #{record.versionId,jdbcType=VARCHAR},
description = #{record.description,jdbcType=LONGVARCHAR} description = #{record.description,jdbcType=LONGVARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -351,7 +363,8 @@
create_user = #{record.createUser,jdbcType=VARCHAR}, create_user = #{record.createUser,jdbcType=VARCHAR},
actuator = #{record.actuator,jdbcType=VARCHAR}, actuator = #{record.actuator,jdbcType=VARCHAR},
end_time = #{record.endTime,jdbcType=BIGINT}, end_time = #{record.endTime,jdbcType=BIGINT},
report_version = #{record.reportVersion,jdbcType=INTEGER} report_version = #{record.reportVersion,jdbcType=INTEGER},
version_id = #{record.versionId,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -401,6 +414,9 @@
<if test="reportVersion != null"> <if test="reportVersion != null">
report_version = #{reportVersion,jdbcType=INTEGER}, report_version = #{reportVersion,jdbcType=INTEGER},
</if> </if>
<if test="versionId != null">
version_id = #{versionId,jdbcType=VARCHAR},
</if>
<if test="description != null"> <if test="description != null">
description = #{description,jdbcType=LONGVARCHAR}, description = #{description,jdbcType=LONGVARCHAR},
</if> </if>
@ -423,6 +439,7 @@
actuator = #{actuator,jdbcType=VARCHAR}, actuator = #{actuator,jdbcType=VARCHAR},
end_time = #{endTime,jdbcType=BIGINT}, end_time = #{endTime,jdbcType=BIGINT},
report_version = #{reportVersion,jdbcType=INTEGER}, report_version = #{reportVersion,jdbcType=INTEGER},
version_id = #{versionId,jdbcType=VARCHAR},
description = #{description,jdbcType=LONGVARCHAR} description = #{description,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
@ -441,7 +458,8 @@
create_user = #{createUser,jdbcType=VARCHAR}, create_user = #{createUser,jdbcType=VARCHAR},
actuator = #{actuator,jdbcType=VARCHAR}, actuator = #{actuator,jdbcType=VARCHAR},
end_time = #{endTime,jdbcType=BIGINT}, end_time = #{endTime,jdbcType=BIGINT},
report_version = #{reportVersion,jdbcType=INTEGER} report_version = #{reportVersion,jdbcType=INTEGER},
version_id = #{versionId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>

@ -1 +1 @@
Subproject commit b35dfb7f4571ed9e9496ff67339b9118232b4bbd Subproject commit e04313eb9468be0ee83c8713478bbf2ba3aaa25f

View File

@ -71,7 +71,7 @@
<!--<table tableName="test_plan"/>--> <!--<table tableName="test_plan"/>-->
<!--<table tableName="api_scenario_report"/>--> <!--<table tableName="api_scenario_report"/>-->
<!--<table tableName="test_case_review"/>--> <!--<table tableName="test_case_review"/>-->
<table tableName="test_plan_report_content"/> <table tableName="api_scenario_report"/>
<!--<table tableName="enterprise_test_report_send_record"/>--> <!--<table tableName="enterprise_test_report_send_record"/>-->
<!--<table tableName="test_case_review_api_case"/> <!--<table tableName="test_case_review_api_case"/>
<table tableName="test_case_review_load"/> <table tableName="test_case_review_load"/>

@ -1 +1 @@
Subproject commit 8b60bbae9617eed3903ffc847a20ecd9b22c4fe8 Subproject commit b556a5ad3171ae92050b8f85c50c5a3735ab6efc

View File

@ -777,7 +777,7 @@ export default {
enable: 'Enable version management', enable: 'Enable version management',
latest: 'Latest', latest: 'Latest',
set_latest: 'Latest', set_latest: 'Latest',
delete_tip: 'This version has been associated with system resources. Deleting it will cause the version information lost', delete_tip: 'This version has associated system resources, this operation will delete the associated resources',
checkout: 'Checkout', checkout: 'Checkout',
compare: 'Compare', compare: 'Compare',
}, },

View File

@ -781,7 +781,7 @@ export default {
enable: '启用版本管理', enable: '启用版本管理',
latest: '最新版', latest: '最新版',
set_latest: '设置为最新版本', set_latest: '设置为最新版本',
delete_tip: '此版本已经关联系统资源,删除会导致无法查询到版本信息', delete_tip: '此版本已经关联系统资源,此操作会将所关联的资源一并删除',
checkout: '切换', checkout: '切换',
compare: '对比', compare: '对比',
}, },

View File

@ -781,7 +781,7 @@ export default {
enable: '啟用版本管理', enable: '啟用版本管理',
latest: '最新版', latest: '最新版',
set_latest: '設置為最新版本', set_latest: '設置為最新版本',
delete_tip: '此版本已經關聯繫統資源,刪除會導致無法查詢到版本信息', delete_tip: '此版本已經關聯繫統資源,此操作會將所關聯的資源一併刪除',
checkout: '切換', checkout: '切換',
compare: '對比', compare: '對比',
}, },