fix(补充SQL): 补充项目的字段增加SQL。场景的执行次数SQL

补充项目的字段增加SQL。场景的执行次数SQL
This commit is contained in:
song-tianyang 2021-08-18 14:19:22 +08:00 committed by 刘瑞斌
parent c3359328ce
commit 3ff5f03f90
7 changed files with 101 additions and 8 deletions

View File

@ -55,5 +55,7 @@ public class ApiScenario implements Serializable {
private String deleteUserId;
private Integer executeTimes;
private static final long serialVersionUID = 1L;
}

View File

@ -1793,6 +1793,66 @@ public class ApiScenarioExample {
addCriterion("delete_user_id not between", value1, value2, "deleteUserId");
return (Criteria) this;
}
public Criteria andExecuteTimesIsNull() {
addCriterion("execute_times is null");
return (Criteria) this;
}
public Criteria andExecuteTimesIsNotNull() {
addCriterion("execute_times is not null");
return (Criteria) this;
}
public Criteria andExecuteTimesEqualTo(Integer value) {
addCriterion("execute_times =", value, "executeTimes");
return (Criteria) this;
}
public Criteria andExecuteTimesNotEqualTo(Integer value) {
addCriterion("execute_times <>", value, "executeTimes");
return (Criteria) this;
}
public Criteria andExecuteTimesGreaterThan(Integer value) {
addCriterion("execute_times >", value, "executeTimes");
return (Criteria) this;
}
public Criteria andExecuteTimesGreaterThanOrEqualTo(Integer value) {
addCriterion("execute_times >=", value, "executeTimes");
return (Criteria) this;
}
public Criteria andExecuteTimesLessThan(Integer value) {
addCriterion("execute_times <", value, "executeTimes");
return (Criteria) this;
}
public Criteria andExecuteTimesLessThanOrEqualTo(Integer value) {
addCriterion("execute_times <=", value, "executeTimes");
return (Criteria) this;
}
public Criteria andExecuteTimesIn(List<Integer> values) {
addCriterion("execute_times in", values, "executeTimes");
return (Criteria) this;
}
public Criteria andExecuteTimesNotIn(List<Integer> values) {
addCriterion("execute_times not in", values, "executeTimes");
return (Criteria) this;
}
public Criteria andExecuteTimesBetween(Integer value1, Integer value2) {
addCriterion("execute_times between", value1, value2, "executeTimes");
return (Criteria) this;
}
public Criteria andExecuteTimesNotBetween(Integer value1, Integer value2) {
addCriterion("execute_times not between", value1, value2, "executeTimes");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -27,6 +27,7 @@
<result column="version" jdbcType="INTEGER" property="version" />
<result column="delete_time" jdbcType="BIGINT" property="deleteTime" />
<result column="delete_user_id" jdbcType="VARCHAR" property="deleteUserId" />
<result column="execute_times" jdbcType="INTEGER" property="executeTimes" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.ApiScenarioWithBLOBs">
<result column="scenario_definition" jdbcType="LONGVARCHAR" property="scenarioDefinition" />
@ -95,7 +96,7 @@
id, project_id, tags, user_id, api_scenario_module_id, module_path, `name`, `level`,
`status`, principal, step_total, follow_people, schedule, create_time, update_time,
pass_rate, last_result, report_id, num, original_state, custom_num, create_user,
version, delete_time, delete_user_id
version, delete_time, delete_user_id, execute_times
</sql>
<sql id="Blob_Column_List">
scenario_definition, description, use_url
@ -157,8 +158,8 @@
pass_rate, last_result, report_id,
num, original_state, custom_num,
create_user, version, delete_time,
delete_user_id, scenario_definition, description,
use_url)
delete_user_id, execute_times, scenario_definition,
description, use_url)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{tags,jdbcType=VARCHAR},
#{userId,jdbcType=VARCHAR}, #{apiScenarioModuleId,jdbcType=VARCHAR}, #{modulePath,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{level,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
@ -167,8 +168,8 @@
#{passRate,jdbcType=VARCHAR}, #{lastResult,jdbcType=VARCHAR}, #{reportId,jdbcType=VARCHAR},
#{num,jdbcType=INTEGER}, #{originalState,jdbcType=VARCHAR}, #{customNum,jdbcType=VARCHAR},
#{createUser,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER}, #{deleteTime,jdbcType=BIGINT},
#{deleteUserId,jdbcType=VARCHAR}, #{scenarioDefinition,jdbcType=LONGVARCHAR}, #{description,jdbcType=LONGVARCHAR},
#{useUrl,jdbcType=LONGVARCHAR})
#{deleteUserId,jdbcType=VARCHAR}, #{executeTimes,jdbcType=INTEGER}, #{scenarioDefinition,jdbcType=LONGVARCHAR},
#{description,jdbcType=LONGVARCHAR}, #{useUrl,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.ApiScenarioWithBLOBs">
insert into api_scenario
@ -248,6 +249,9 @@
<if test="deleteUserId != null">
delete_user_id,
</if>
<if test="executeTimes != null">
execute_times,
</if>
<if test="scenarioDefinition != null">
scenario_definition,
</if>
@ -334,6 +338,9 @@
<if test="deleteUserId != null">
#{deleteUserId,jdbcType=VARCHAR},
</if>
<if test="executeTimes != null">
#{executeTimes,jdbcType=INTEGER},
</if>
<if test="scenarioDefinition != null">
#{scenarioDefinition,jdbcType=LONGVARCHAR},
</if>
@ -429,6 +436,9 @@
<if test="record.deleteUserId != null">
delete_user_id = #{record.deleteUserId,jdbcType=VARCHAR},
</if>
<if test="record.executeTimes != null">
execute_times = #{record.executeTimes,jdbcType=INTEGER},
</if>
<if test="record.scenarioDefinition != null">
scenario_definition = #{record.scenarioDefinition,jdbcType=LONGVARCHAR},
</if>
@ -470,6 +480,7 @@
version = #{record.version,jdbcType=INTEGER},
delete_time = #{record.deleteTime,jdbcType=BIGINT},
delete_user_id = #{record.deleteUserId,jdbcType=VARCHAR},
execute_times = #{record.executeTimes,jdbcType=INTEGER},
scenario_definition = #{record.scenarioDefinition,jdbcType=LONGVARCHAR},
description = #{record.description,jdbcType=LONGVARCHAR},
use_url = #{record.useUrl,jdbcType=LONGVARCHAR}
@ -503,7 +514,8 @@
create_user = #{record.createUser,jdbcType=VARCHAR},
version = #{record.version,jdbcType=INTEGER},
delete_time = #{record.deleteTime,jdbcType=BIGINT},
delete_user_id = #{record.deleteUserId,jdbcType=VARCHAR}
delete_user_id = #{record.deleteUserId,jdbcType=VARCHAR},
execute_times = #{record.executeTimes,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -583,6 +595,9 @@
<if test="deleteUserId != null">
delete_user_id = #{deleteUserId,jdbcType=VARCHAR},
</if>
<if test="executeTimes != null">
execute_times = #{executeTimes,jdbcType=INTEGER},
</if>
<if test="scenarioDefinition != null">
scenario_definition = #{scenarioDefinition,jdbcType=LONGVARCHAR},
</if>
@ -621,6 +636,7 @@
version = #{version,jdbcType=INTEGER},
delete_time = #{deleteTime,jdbcType=BIGINT},
delete_user_id = #{deleteUserId,jdbcType=VARCHAR},
execute_times = #{executeTimes,jdbcType=INTEGER},
scenario_definition = #{scenarioDefinition,jdbcType=LONGVARCHAR},
description = #{description,jdbcType=LONGVARCHAR},
use_url = #{useUrl,jdbcType=LONGVARCHAR}
@ -651,7 +667,8 @@
create_user = #{createUser,jdbcType=VARCHAR},
version = #{version,jdbcType=INTEGER},
delete_time = #{deleteTime,jdbcType=BIGINT},
delete_user_id = #{deleteUserId,jdbcType=VARCHAR}
delete_user_id = #{deleteUserId,jdbcType=VARCHAR},
execute_times = #{executeTimes,jdbcType=INTEGER}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -65,4 +65,12 @@ CREATE TABLE IF NOT EXISTS `notification`
KEY `IDX_RECEIVER` (`receiver`) USING BTREE
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE utf8mb4_general_ci;
COLLATE utf8mb4_general_ci;
-- 项目表增加tcp相关的字段
ALTER TABLE `project` ADD `mock_tcp_port` int(11) NULL;
ALTER TABLE `project` ADD `is_mock_tcp_open` tinyint(1) NOT NULL DEFAULT 0;
-- 场景表增加执行次数字段
ALTER TABLE `api_scenario` ADD `execute_times` int(11) NULL;

View File

@ -998,6 +998,8 @@ export default {
database_config: "Database Config",
tcp_config: "TCP Config",
import: "Import Environment",
request_timeout: "Request Timeout",
response_timeout: "Response Timeout",
},
scenario: {
scenario: "Scenario",

View File

@ -1002,6 +1002,8 @@ export default {
database_config: "数据库配置",
tcp_config: "TCP配置",
import: "导入环境",
request_timeout: "链接超时",
response_timeout: "响应超时",
},
scenario: {
scenario: "场景",

View File

@ -1004,6 +1004,8 @@ export default {
database_config: "數據庫配置",
tcp_config: "TCP配置",
import: "導入環境",
request_timeout: "連接超時",
response_timeout: "響應超市",
},
scenario: {
scenario: "場景",