提交 5dff9012 编写于 作者: W W23123

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	backend/src/main/resources/generatorConfig.xml
......@@ -6,6 +6,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
@SpringBootApplication(exclude = {QuartzAutoConfiguration.class})
@ServletComponentScan
......@@ -14,4 +16,9 @@ public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}
}
......@@ -9,8 +9,6 @@ public class FileMetadata implements Serializable {
private String type;
private String engine;
private Long createTime;
private Long updateTime;
......@@ -43,14 +41,6 @@ public class FileMetadata implements Serializable {
this.type = type == null ? null : type.trim();
}
public String getEngine() {
return engine;
}
public void setEngine(String engine) {
this.engine = engine == null ? null : engine.trim();
}
public Long getCreateTime() {
return createTime;
}
......
......@@ -314,76 +314,6 @@ public class FileMetadataExample {
return (Criteria) this;
}
public Criteria andEngineIsNull() {
addCriterion("engine is null");
return (Criteria) this;
}
public Criteria andEngineIsNotNull() {
addCriterion("engine is not null");
return (Criteria) this;
}
public Criteria andEngineEqualTo(String value) {
addCriterion("engine =", value, "engine");
return (Criteria) this;
}
public Criteria andEngineNotEqualTo(String value) {
addCriterion("engine <>", value, "engine");
return (Criteria) this;
}
public Criteria andEngineGreaterThan(String value) {
addCriterion("engine >", value, "engine");
return (Criteria) this;
}
public Criteria andEngineGreaterThanOrEqualTo(String value) {
addCriterion("engine >=", value, "engine");
return (Criteria) this;
}
public Criteria andEngineLessThan(String value) {
addCriterion("engine <", value, "engine");
return (Criteria) this;
}
public Criteria andEngineLessThanOrEqualTo(String value) {
addCriterion("engine <=", value, "engine");
return (Criteria) this;
}
public Criteria andEngineLike(String value) {
addCriterion("engine like", value, "engine");
return (Criteria) this;
}
public Criteria andEngineNotLike(String value) {
addCriterion("engine not like", value, "engine");
return (Criteria) this;
}
public Criteria andEngineIn(List<String> values) {
addCriterion("engine in", values, "engine");
return (Criteria) this;
}
public Criteria andEngineNotIn(List<String> values) {
addCriterion("engine not in", values, "engine");
return (Criteria) this;
}
public Criteria andEngineBetween(String value1, String value2) {
addCriterion("engine between", value1, value2, "engine");
return (Criteria) this;
}
public Criteria andEngineNotBetween(String value1, String value2) {
addCriterion("engine not between", value1, value2, "engine");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
......
package io.metersphere.base.domain;
import java.io.Serializable;
public class TestCase implements Serializable {
private String id;
private String nodeId;
private String projectId;
private String name;
private String type;
private String priority;
private String method;
private String prerequisite;
private Long createTime;
private Long updateTime;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getNodeId() {
return nodeId;
}
public void setNodeId(String nodeId) {
this.nodeId = nodeId == null ? null : nodeId.trim();
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId == null ? null : projectId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
public String getPriority() {
return priority;
}
public void setPriority(String priority) {
this.priority = priority == null ? null : priority.trim();
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method == null ? null : method.trim();
}
public String getPrerequisite() {
return prerequisite;
}
public void setPrerequisite(String prerequisite) {
this.prerequisite = prerequisite == null ? null : prerequisite.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
package io.metersphere.base.domain;
import java.io.Serializable;
public class TestCaseNode implements Serializable {
private String id;
private String projectId;
private String name;
private String pId;
private Long order;
private Long createTime;
private Long updateTime;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId == null ? null : projectId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getpId() {
return pId;
}
public void setpId(String pId) {
this.pId = pId == null ? null : pId.trim();
}
public Long getOrder() {
return order;
}
public void setOrder(Long order) {
this.order = order;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
package io.metersphere.base.domain;
import java.io.Serializable;
public class TestCaseWithBLOBs extends TestCase implements Serializable {
private String detail;
private String steps;
private String tags;
private static final long serialVersionUID = 1L;
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail == null ? null : detail.trim();
}
public String getSteps() {
return steps;
}
public void setSteps(String steps) {
this.steps = steps == null ? null : steps.trim();
}
public String getTags() {
return tags;
}
public void setTags(String tags) {
this.tags = tags == null ? null : tags.trim();
}
}
\ No newline at end of file
package io.metersphere.base.domain;
import java.io.Serializable;
public class TestPlan implements Serializable {
private String id;
private String projectId;
private String name;
private String description;
private String status;
private String testCaseMatchRule;
private String executorMatchRule;
private Long createTime;
private Long updateTime;
private String tags;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId == null ? null : projectId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public String getTestCaseMatchRule() {
return testCaseMatchRule;
}
public void setTestCaseMatchRule(String testCaseMatchRule) {
this.testCaseMatchRule = testCaseMatchRule == null ? null : testCaseMatchRule.trim();
}
public String getExecutorMatchRule() {
return executorMatchRule;
}
public void setExecutorMatchRule(String executorMatchRule) {
this.executorMatchRule = executorMatchRule == null ? null : executorMatchRule.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public String getTags() {
return tags;
}
public void setTags(String tags) {
this.tags = tags == null ? null : tags.trim();
}
}
\ No newline at end of file
package io.metersphere.base.domain;
import java.io.Serializable;
public class TestPlanTestCase implements Serializable {
private String id;
private String planId;
private String caseId;
private String executor;
private String status;
private String remark;
private Long createTime;
private Long updateTime;
private String results;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getPlanId() {
return planId;
}
public void setPlanId(String planId) {
this.planId = planId == null ? null : planId.trim();
}
public String getCaseId() {
return caseId;
}
public void setCaseId(String caseId) {
this.caseId = caseId == null ? null : caseId.trim();
}
public String getExecutor() {
return executor;
}
public void setExecutor(String executor) {
this.executor = executor == null ? null : executor.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public String getResults() {
return results;
}
public void setResults(String results) {
this.results = results == null ? null : results.trim();
}
}
\ No newline at end of file
......@@ -5,7 +5,6 @@
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="engine" jdbcType="VARCHAR" property="engine" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="size" jdbcType="BIGINT" property="size" />
......@@ -69,7 +68,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, name, type, engine, create_time, update_time, size
id, name, type, create_time, update_time, size
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.FileMetadataExample" resultMap="BaseResultMap">
select
......@@ -103,11 +102,11 @@
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.FileMetadata">
insert into file_metadata (id, name, type,
engine, create_time, update_time,
size)
create_time, update_time, size
)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{engine,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{size,jdbcType=BIGINT})
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{size,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.FileMetadata">
insert into file_metadata
......@@ -121,9 +120,6 @@
<if test="type != null">
type,
</if>
<if test="engine != null">
engine,
</if>
<if test="createTime != null">
create_time,
</if>
......@@ -144,9 +140,6 @@
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="engine != null">
#{engine,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
......@@ -176,9 +169,6 @@
<if test="record.type != null">
type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.engine != null">
engine = #{record.engine,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
......@@ -198,7 +188,6 @@
set id = #{record.id,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR},
engine = #{record.engine,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
size = #{record.size,jdbcType=BIGINT}
......@@ -215,9 +204,6 @@
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
</if>
<if test="engine != null">
engine = #{engine,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
......@@ -234,7 +220,6 @@
update file_metadata
set name = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
engine = #{engine,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
size = #{size,jdbcType=BIGINT}
......
package io.metersphere.base.mapper;
import io.metersphere.base.domain.TestCase;
import io.metersphere.base.domain.TestCaseExample;
import io.metersphere.base.domain.TestCaseWithBLOBs;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TestCaseMapper {
long countByExample(TestCaseExample example);
int deleteByExample(TestCaseExample example);
int deleteByPrimaryKey(String id);
int insert(TestCaseWithBLOBs record);
int insertSelective(TestCaseWithBLOBs record);
List<TestCaseWithBLOBs> selectByExampleWithBLOBs(TestCaseExample example);
List<TestCase> selectByExample(TestCaseExample example);
TestCaseWithBLOBs selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") TestCaseWithBLOBs record, @Param("example") TestCaseExample example);
int updateByExampleWithBLOBs(@Param("record") TestCaseWithBLOBs record, @Param("example") TestCaseExample example);
int updateByExample(@Param("record") TestCase record, @Param("example") TestCaseExample example);
int updateByPrimaryKeySelective(TestCaseWithBLOBs record);
int updateByPrimaryKeyWithBLOBs(TestCaseWithBLOBs record);
int updateByPrimaryKey(TestCase record);
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.metersphere.base.mapper.TestCaseMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestCase">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="node_id" jdbcType="VARCHAR" property="nodeId" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="priority" jdbcType="VARCHAR" property="priority" />
<result column="method" jdbcType="VARCHAR" property="method" />
<result column="prerequisite" jdbcType="VARCHAR" property="prerequisite" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestCaseWithBLOBs">
<result column="detail" jdbcType="LONGVARCHAR" property="detail" />
<result column="steps" jdbcType="LONGVARCHAR" property="steps" />
<result column="tags" jdbcType="LONGVARCHAR" property="tags" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, node_id, project_id, name, type, priority, method, prerequisite, create_time,
update_time
</sql>
<sql id="Blob_Column_List">
detail, steps, tags
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.TestCaseExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from test_case
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestCaseExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from test_case
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from test_case
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from test_case
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.TestCaseExample">
delete from test_case
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
insert into test_case (id, node_id, project_id,
name, type, priority,
method, prerequisite, create_time,
update_time, detail, steps,
tags)
values (#{id,jdbcType=VARCHAR}, #{nodeId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{priority,jdbcType=VARCHAR},
#{method,jdbcType=VARCHAR}, #{prerequisite,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT}, #{detail,jdbcType=LONGVARCHAR}, #{steps,jdbcType=LONGVARCHAR},
#{tags,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
insert into test_case
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="nodeId != null">
node_id,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="name != null">
name,
</if>
<if test="type != null">
type,
</if>
<if test="priority != null">
priority,
</if>
<if test="method != null">
method,
</if>
<if test="prerequisite != null">
prerequisite,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="detail != null">
detail,
</if>
<if test="steps != null">
steps,
</if>
<if test="tags != null">
tags,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="nodeId != null">
#{nodeId,jdbcType=VARCHAR},
</if>
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="priority != null">
#{priority,jdbcType=VARCHAR},
</if>
<if test="method != null">
#{method,jdbcType=VARCHAR},
</if>
<if test="prerequisite != null">
#{prerequisite,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="detail != null">
#{detail,jdbcType=LONGVARCHAR},
</if>
<if test="steps != null">
#{steps,jdbcType=LONGVARCHAR},
</if>
<if test="tags != null">
#{tags,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.TestCaseExample" resultType="java.lang.Long">
select count(*) from test_case
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update test_case
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.nodeId != null">
node_id = #{record.nodeId,jdbcType=VARCHAR},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.priority != null">
priority = #{record.priority,jdbcType=VARCHAR},
</if>
<if test="record.method != null">
method = #{record.method,jdbcType=VARCHAR},
</if>
<if test="record.prerequisite != null">
prerequisite = #{record.prerequisite,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.detail != null">
detail = #{record.detail,jdbcType=LONGVARCHAR},
</if>
<if test="record.steps != null">
steps = #{record.steps,jdbcType=LONGVARCHAR},
</if>
<if test="record.tags != null">
tags = #{record.tags,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update test_case
set id = #{record.id,jdbcType=VARCHAR},
node_id = #{record.nodeId,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR},
priority = #{record.priority,jdbcType=VARCHAR},
method = #{record.method,jdbcType=VARCHAR},
prerequisite = #{record.prerequisite,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
detail = #{record.detail,jdbcType=LONGVARCHAR},
steps = #{record.steps,jdbcType=LONGVARCHAR},
tags = #{record.tags,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update test_case
set id = #{record.id,jdbcType=VARCHAR},
node_id = #{record.nodeId,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR},
priority = #{record.priority,jdbcType=VARCHAR},
method = #{record.method,jdbcType=VARCHAR},
prerequisite = #{record.prerequisite,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
update test_case
<set>
<if test="nodeId != null">
node_id = #{nodeId,jdbcType=VARCHAR},
</if>
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
</if>
<if test="priority != null">
priority = #{priority,jdbcType=VARCHAR},
</if>
<if test="method != null">
method = #{method,jdbcType=VARCHAR},
</if>
<if test="prerequisite != null">
prerequisite = #{prerequisite,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="detail != null">
detail = #{detail,jdbcType=LONGVARCHAR},
</if>
<if test="steps != null">
steps = #{steps,jdbcType=LONGVARCHAR},
</if>
<if test="tags != null">
tags = #{tags,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.TestCaseWithBLOBs">
update test_case
set node_id = #{nodeId,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
priority = #{priority,jdbcType=VARCHAR},
method = #{method,jdbcType=VARCHAR},
prerequisite = #{prerequisite,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
detail = #{detail,jdbcType=LONGVARCHAR},
steps = #{steps,jdbcType=LONGVARCHAR},
tags = #{tags,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestCase">
update test_case
set node_id = #{nodeId,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
priority = #{priority,jdbcType=VARCHAR},
method = #{method,jdbcType=VARCHAR},
prerequisite = #{prerequisite,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
package io.metersphere.base.mapper;
import io.metersphere.base.domain.TestCaseNode;
import io.metersphere.base.domain.TestCaseNodeExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TestCaseNodeMapper {
long countByExample(TestCaseNodeExample example);
int deleteByExample(TestCaseNodeExample example);
int deleteByPrimaryKey(String id);
int insert(TestCaseNode record);
int insertSelective(TestCaseNode record);
List<TestCaseNode> selectByExample(TestCaseNodeExample example);
TestCaseNode selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") TestCaseNode record, @Param("example") TestCaseNodeExample example);
int updateByExample(@Param("record") TestCaseNode record, @Param("example") TestCaseNodeExample example);
int updateByPrimaryKeySelective(TestCaseNode record);
int updateByPrimaryKey(TestCaseNode record);
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.metersphere.base.mapper.TestCaseNodeMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestCaseNode">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="p_id" jdbcType="VARCHAR" property="pId" />
<result column="order" jdbcType="BIGINT" property="order" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, project_id, name, p_id, order, create_time, update_time
</sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestCaseNodeExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from test_case_node
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from test_case_node
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from test_case_node
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.TestCaseNodeExample">
delete from test_case_node
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestCaseNode">
insert into test_case_node (id, project_id, name,
p_id, order, create_time,
update_time)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{pId,jdbcType=VARCHAR}, #{order,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestCaseNode">
insert into test_case_node
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="name != null">
name,
</if>
<if test="pId != null">
p_id,
</if>
<if test="order != null">
order,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="pId != null">
#{pId,jdbcType=VARCHAR},
</if>
<if test="order != null">
#{order,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.TestCaseNodeExample" resultType="java.lang.Long">
select count(*) from test_case_node
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update test_case_node
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.pId != null">
p_id = #{record.pId,jdbcType=VARCHAR},
</if>
<if test="record.order != null">
order = #{record.order,jdbcType=BIGINT},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update test_case_node
set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
p_id = #{record.pId,jdbcType=VARCHAR},
order = #{record.order,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.TestCaseNode">
update test_case_node
<set>
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="pId != null">
p_id = #{pId,jdbcType=VARCHAR},
</if>
<if test="order != null">
order = #{order,jdbcType=BIGINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestCaseNode">
update test_case_node
set project_id = #{projectId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
p_id = #{pId,jdbcType=VARCHAR},
order = #{order,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
package io.metersphere.base.mapper;
import io.metersphere.base.domain.TestPlan;
import io.metersphere.base.domain.TestPlanExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TestPlanMapper {
long countByExample(TestPlanExample example);
int deleteByExample(TestPlanExample example);
int deleteByPrimaryKey(String id);
int insert(TestPlan record);
int insertSelective(TestPlan record);
List<TestPlan> selectByExampleWithBLOBs(TestPlanExample example);
List<TestPlan> selectByExample(TestPlanExample example);
TestPlan selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") TestPlan record, @Param("example") TestPlanExample example);
int updateByExampleWithBLOBs(@Param("record") TestPlan record, @Param("example") TestPlanExample example);
int updateByExample(@Param("record") TestPlan record, @Param("example") TestPlanExample example);
int updateByPrimaryKeySelective(TestPlan record);
int updateByPrimaryKeyWithBLOBs(TestPlan record);
int updateByPrimaryKey(TestPlan record);
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.metersphere.base.mapper.TestPlanMapper">
<resultMap id="BaseResultMap" type="io.metersphere.base.domain.TestPlan">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="test_case_match_rule" jdbcType="VARCHAR" property="testCaseMatchRule" />
<result column="executor_match_rule" jdbcType="VARCHAR" property="executorMatchRule" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.metersphere.base.domain.TestPlan">
<result column="tags" jdbcType="LONGVARCHAR" property="tags" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, project_id, name, description, status, test_case_match_rule, executor_match_rule,
create_time, update_time
</sql>
<sql id="Blob_Column_List">
tags
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.metersphere.base.domain.TestPlanExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from test_plan
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="io.metersphere.base.domain.TestPlanExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from test_plan
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from test_plan
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from test_plan
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.metersphere.base.domain.TestPlanExample">
delete from test_plan
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.metersphere.base.domain.TestPlan">
insert into test_plan (id, project_id, name,
description, status, test_case_match_rule,
executor_match_rule, create_time, update_time,
tags)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{testCaseMatchRule,jdbcType=VARCHAR},
#{executorMatchRule,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{tags,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.TestPlan">
insert into test_plan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="name != null">
name,
</if>
<if test="description != null">
description,
</if>
<if test="status != null">
status,
</if>
<if test="testCaseMatchRule != null">
test_case_match_rule,
</if>
<if test="executorMatchRule != null">
executor_match_rule,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="tags != null">
tags,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="testCaseMatchRule != null">
#{testCaseMatchRule,jdbcType=VARCHAR},
</if>
<if test="executorMatchRule != null">
#{executorMatchRule,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="tags != null">
#{tags,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.TestPlanExample" resultType="java.lang.Long">
select count(*) from test_plan
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update test_plan
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
status = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.testCaseMatchRule != null">
test_case_match_rule = #{record.testCaseMatchRule,jdbcType=VARCHAR},
</if>
<if test="record.executorMatchRule != null">
executor_match_rule = #{record.executorMatchRule,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.tags != null">
tags = #{record.tags,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update test_plan
set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
status = #{record.status,jdbcType=VARCHAR},
test_case_match_rule = #{record.testCaseMatchRule,jdbcType=VARCHAR},
executor_match_rule = #{record.executorMatchRule,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
tags = #{record.tags,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update test_plan
set id = #{record.id,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
status = #{record.status,jdbcType=VARCHAR},
test_case_match_rule = #{record.testCaseMatchRule,jdbcType=VARCHAR},
executor_match_rule = #{record.executorMatchRule,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.metersphere.base.domain.TestPlan">
update test_plan
<set>
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=VARCHAR},
</if>
<if test="testCaseMatchRule != null">
test_case_match_rule = #{testCaseMatchRule,jdbcType=VARCHAR},
</if>
<if test="executorMatchRule != null">
executor_match_rule = #{executorMatchRule,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="tags != null">
tags = #{tags,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.metersphere.base.domain.TestPlan">
update test_plan
set project_id = #{projectId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR},
test_case_match_rule = #{testCaseMatchRule,jdbcType=VARCHAR},
executor_match_rule = #{executorMatchRule,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
tags = #{tags,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.metersphere.base.domain.TestPlan">
update test_plan
set project_id = #{projectId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR},
test_case_match_rule = #{testCaseMatchRule,jdbcType=VARCHAR},
executor_match_rule = #{executorMatchRule,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
package io.metersphere.base.mapper;
import io.metersphere.base.domain.TestPlanTestCase;
import io.metersphere.base.domain.TestPlanTestCaseExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TestPlanTestCaseMapper {
long countByExample(TestPlanTestCaseExample example);
int deleteByExample(TestPlanTestCaseExample example);
int deleteByPrimaryKey(String id);
int insert(TestPlanTestCase record);
int insertSelective(TestPlanTestCase record);
List<TestPlanTestCase> selectByExampleWithBLOBs(TestPlanTestCaseExample example);
List<TestPlanTestCase> selectByExample(TestPlanTestCaseExample example);
TestPlanTestCase selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") TestPlanTestCase record, @Param("example") TestPlanTestCaseExample example);
int updateByExampleWithBLOBs(@Param("record") TestPlanTestCase record, @Param("example") TestPlanTestCaseExample example);
int updateByExample(@Param("record") TestPlanTestCase record, @Param("example") TestPlanTestCaseExample example);
int updateByPrimaryKeySelective(TestPlanTestCase record);
int updateByPrimaryKeyWithBLOBs(TestPlanTestCase record);
int updateByPrimaryKey(TestPlanTestCase record);
}
\ No newline at end of file
package io.metersphere.commons.constants;
public enum EngineType {
DOCKER, KUBERNETES
}
......@@ -8,6 +8,7 @@ import io.metersphere.commons.utils.PageUtils;
import io.metersphere.commons.utils.Pager;
import io.metersphere.controller.request.ReportRequest;
import io.metersphere.dto.ReportDTO;
import io.metersphere.report.base.RequestStatistics;
import io.metersphere.service.ReportService;
import io.metersphere.user.SessionUtils;
import org.apache.shiro.authz.annotation.Logical;
......@@ -52,5 +53,10 @@ public class ReportController {
return reportService.getReportTestAndProInfo(reportId);
}
@GetMapping("/content/{reportId}")
public List<RequestStatistics> getReportContent(@PathVariable String reportId) {
return reportService.getReport(reportId);
}
}
......@@ -40,4 +40,13 @@ public class TestResourcePoolController {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, testResourcePoolService.listResourcePools(request));
}
@GetMapping("list/all")
public List<TestResourcePool> listResourcePools() {
PageHelper.startPage(1, 10000, true);
QueryResourcePoolRequest request = new QueryResourcePoolRequest();
return testResourcePoolService.listResourcePools(request);
}
}
......@@ -7,9 +7,9 @@ public class EngineContext {
private String testId;
private String testName;
private String namespace;
private String engineType;
private String fileType;
private String content;
private String resourcePoolId;
private Map<String, Object> properties = new HashMap<>();
private Map<String, String> testData = new HashMap<>();
......@@ -37,14 +37,6 @@ public class EngineContext {
this.namespace = namespace;
}
public String getEngineType() {
return engineType;
}
public void setEngineType(String engineType) {
this.engineType = engineType;
}
public void addProperty(String key, Object value) {
this.properties.put(key, value);
}
......@@ -76,4 +68,12 @@ public class EngineContext {
public void setTestData(Map<String, String> testData) {
this.testData = testData;
}
public String getResourcePoolId() {
return resourcePoolId;
}
public void setResourcePoolId(String resourcePoolId) {
this.resourcePoolId = resourcePoolId;
}
}
......@@ -5,7 +5,8 @@ import com.alibaba.fastjson.JSONObject;
import io.metersphere.base.domain.FileContent;
import io.metersphere.base.domain.FileMetadata;
import io.metersphere.base.domain.LoadTestWithBLOBs;
import io.metersphere.commons.constants.EngineType;
import io.metersphere.base.domain.TestResourcePool;
import io.metersphere.commons.constants.ResourcePoolTypeEnum;
import io.metersphere.commons.exception.MSException;
import io.metersphere.engine.docker.DockerTestEngine;
import io.metersphere.engine.kubernetes.KubernetesTestEngine;
......@@ -13,6 +14,7 @@ import io.metersphere.i18n.Translator;
import io.metersphere.parse.EngineSourceParser;
import io.metersphere.parse.EngineSourceParserFactory;
import io.metersphere.service.FileService;
import io.metersphere.service.TestResourcePoolService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
......@@ -26,14 +28,35 @@ import java.util.Map;
@Service
public class EngineFactory {
private static FileService fileService;
private static TestResourcePoolService testResourcePoolService;
public static Engine createEngine(String engineType) {
final EngineType type = EngineType.valueOf(engineType);
public static Engine createEngine(LoadTestWithBLOBs loadTest) {
String resourcePoolId = null;
if (!StringUtils.isEmpty(loadTest.getLoadConfiguration())) {
final JSONArray jsonArray = JSONObject.parseArray(loadTest.getLoadConfiguration());
for (int i = 0; i < jsonArray.size(); i++) {
final JSONObject jsonObject = jsonArray.getJSONObject(i);
if (StringUtils.equals(jsonObject.getString("key"), "resourcePoolId")) {
resourcePoolId = jsonObject.getString("value");
break;
}
}
}
if (StringUtils.isBlank(resourcePoolId)) {
MSException.throwException("Resource Pool ID is empty.");
}
TestResourcePool resourcePool = testResourcePoolService.getResourcePool(resourcePoolId);
if (resourcePool == null) {
MSException.throwException("Resource Pool is empty.");
}
final ResourcePoolTypeEnum type = ResourcePoolTypeEnum.valueOf(resourcePool.getType());
switch (type) {
case DOCKER:
case NODE:
return new DockerTestEngine();
case KUBERNETES:
case K8S:
return new KubernetesTestEngine();
}
return null;
......@@ -48,7 +71,6 @@ public class EngineFactory {
engineContext.setTestId(loadTest.getId());
engineContext.setTestName(loadTest.getName());
engineContext.setNamespace(loadTest.getProjectId());
engineContext.setEngineType(fileMetadata.getEngine());
engineContext.setFileType(fileMetadata.getType());
if (!StringUtils.isEmpty(loadTest.getLoadConfiguration())) {
......@@ -57,6 +79,9 @@ public class EngineFactory {
for (int i = 0; i < jsonArray.size(); i++) {
final JSONObject jsonObject = jsonArray.getJSONObject(i);
engineContext.addProperty(jsonObject.getString("key"), jsonObject.get("value"));
if (StringUtils.equals(jsonObject.getString("key"), "resourcePoolId")) {
engineContext.setResourcePoolId(jsonObject.getString("value"));
}
}
}
......@@ -86,4 +111,9 @@ public class EngineFactory {
private void setFileService(FileService fileService) {
EngineFactory.fileService = fileService;
}
@Resource
public void setTestResourcePoolService(TestResourcePoolService testResourcePoolService) {
EngineFactory.testResourcePoolService = testResourcePoolService;
}
}
......@@ -135,4 +135,8 @@ public class TestResourcePoolService {
testResourceExample.createCriteria().andTestResourcePoolIdEqualTo(testResourcePoolId);
testResourceMapper.deleteByExample(testResourceExample);
}
public TestResourcePool getResourcePool(String resourcePoolId) {
return testResourcePoolMapper.selectByPrimaryKey(resourcePoolId);
}
}
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册