Merge pull request '测试用例导入导出' (#911) from dev_testCase_export into master

This commit is contained in:
wanjia9506 2025-06-06 16:55:09 +08:00
commit 2f11e78844
17 changed files with 1453 additions and 48 deletions

View File

@ -121,6 +121,12 @@
<artifactId>httpclient</artifactId> <artifactId>httpclient</artifactId>
<version>4.5.14</version> <version>4.5.14</version>
</dependency> </dependency>
<!-- Apache POI for Word processing -->
<!-- <dependency>-->
<!-- <groupId>org.apache.poi</groupId>-->
<!-- <artifactId>poi-ooxml</artifactId>-->
<!-- <version>5.4.0</version>-->
<!-- </dependency>-->
<!-- 自然语言处理,用于自动提取文章概要 --> <!-- 自然语言处理,用于自动提取文章概要 -->
<dependency> <dependency>
<groupId>com.hankcs</groupId> <groupId>com.hankcs</groupId>
@ -139,6 +145,12 @@
<version>0.4.8</version> <version>0.4.8</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- 文件导入、导出库 -->
<!-- <dependency>-->
<!-- <groupId>com.github.ben-manes.caffeine</groupId>-->
<!-- <artifactId>Java2Word</artifactId>-->
<!-- <version>1.0.0</version>-->
<!-- </dependency>-->
</dependencies> </dependencies>
<build> <build>

View File

@ -67,6 +67,15 @@ public interface IPmsProductModuleService
*/ */
List<TreeSelect> selectPmsProductModuleTreeList(PmsProductModule pmsProductModule, int type); List<TreeSelect> selectPmsProductModuleTreeList(PmsProductModule pmsProductModule, int type);
/**
* 构建模块的树状结构
*
* @param projectid 模块搜索条件
* @param type 模块类型1产品模块 2测试用例模块, 3测试单实际取测试用例模块
* @return 模块树状结构
*/
List<TreeSelect> getPmsProductModuleTreeList(Long projectid, int type);
/** /**
* 查询模块及模块子级ID列表 * 查询模块及模块子级ID列表
* @param parentModuleId 父级模块ID * @param parentModuleId 父级模块ID

View File

@ -351,6 +351,63 @@ public class PmsProductModuleServiceImpl implements IPmsProductModuleService
return buildModuleTreeSelect(moduleList); return buildModuleTreeSelect(moduleList);
} }
@Override
public List<TreeSelect> getPmsProductModuleTreeList(Long projectId, int type) {
List<PmsProductModule> moduleList;
PmsProductModule pmsProductModule = new PmsProductModule();
pmsProductModule.setPmsProjectId(projectId);
//模块类型1产品模块 2测试用例模块, 3测试单实际取测试用例模块
if (PmsConstants.TESTSHEET_TAG_AND_MODULE_TYPE.equals(type)) {
pmsProductModule.setType(PmsConstants.TESTCASE_TAG_AND_MODULE_TYPE);
moduleList = pmsProductModuleMapper.selectPmsProductModuleForTestsheetList(pmsProductModule);
} else {
pmsProductModule.setType(type);
moduleList = pmsProductModuleMapper.selectPmsProductModuleList(pmsProductModule);
}
Integer allNodeDataCount;
Integer noModuleNodeDataCount;
String allNodeName = "全部模块";
if (type == PmsConstants.PRODUCT_TAG_AND_MODULE_TYPE) {
// 设置各节点数量为需求数量
moduleList.forEach(x -> x.setNodeDataCount(x.getRequirementCount()));
} else if (type == PmsConstants.TESTSHEET_TAG_AND_MODULE_TYPE) {
// 设置各节点数量为测试单执行用例数量
moduleList.forEach(x -> x.setNodeDataCount(x.getTestsheetCasesCount()));
// 排除0测试单执行用例数据
moduleList = moduleList.stream().filter(e -> e.getTestsheetCasesCount() > 0).collect(Collectors.toList());
} else {
// 设置各节点数量为测试用例数量
moduleList.forEach(x -> x.setNodeDataCount(x.getTestCaseCount()));
}
// 父级需求数需包含子级需求数
aggregateCounts(moduleList, 0L);
// 构建顶级模块全部需求
PmsProductModule allPmsProductModule=new PmsProductModule();
allPmsProductModule.setPmsProductIdentifier(pmsProductModule.getPmsProductIdentifier());
allPmsProductModule.setId(0L);
allPmsProductModule.setModuleName(allNodeName);
allPmsProductModule.setIsFixedModule(true);
moduleList.add(allPmsProductModule);
// 模块根据id排序
moduleList = moduleList.stream()
.sorted(Comparator.comparing(PmsProductModule::getId))
.sorted(Comparator.comparing(PmsProductModule::getIsFixedModule))
.collect(Collectors.toList());
// 构建无所属模块
PmsProductModule noPmsProductModule = new PmsProductModule();
noPmsProductModule.setPmsProductIdentifier(pmsProductModule.getPmsProductIdentifier());
noPmsProductModule.setId(-1L);
noPmsProductModule.setModuleName(NO_MODULE(type));
noPmsProductModule.setParentId(0L);
noPmsProductModule.setIsFixedModule(true);
moduleList.add(noPmsProductModule);
return buildModuleTreeSelect(moduleList);
}
@Override @Override
public List<Long> selectChildrenPmsProductModuleIdList(Long parentModuleId) { public List<Long> selectChildrenPmsProductModuleIdList(Long parentModuleId) {
List<PmsProductModule> pmsProductModuleList=new ArrayList<>(); List<PmsProductModule> pmsProductModuleList=new ArrayList<>();

View File

@ -9,15 +9,20 @@ import com.microservices.common.log.annotation.Log;
import com.microservices.common.log.enums.BusinessType; import com.microservices.common.log.enums.BusinessType;
import com.microservices.common.security.annotation.Logical; import com.microservices.common.security.annotation.Logical;
import com.microservices.common.security.annotation.RequiresPermissions; import com.microservices.common.security.annotation.RequiresPermissions;
import com.microservices.pms.product.domain.vo.TreeSelect;
import com.microservices.pms.product.service.IPmsProductModuleService; import com.microservices.pms.product.service.IPmsProductModuleService;
import com.microservices.pms.project.domain.PmsProjectTestcase; import com.microservices.pms.project.domain.PmsProjectTestcase;
import com.microservices.pms.project.domain.vo.*; import com.microservices.pms.project.domain.vo.*;
import com.microservices.pms.project.service.IPmsProjectTestcaseService; import com.microservices.pms.project.service.IPmsProjectTestcaseService;
import com.microservices.pms.utils.PmsConstants;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List; import java.util.List;
/** /**
@ -132,4 +137,40 @@ public class PmsProjectTestcaseController extends BaseController {
@RequestBody JSONObject batchUpdateVo) { @RequestBody JSONObject batchUpdateVo) {
return toAjax(pmsProjectTestcaseService.batchUpdatePmsProjectTestcase(batchUpdateVo)); return toAjax(pmsProjectTestcaseService.batchUpdatePmsProjectTestcase(batchUpdateVo));
} }
/**
* 批量下载测试用例
*/
@ApiOperation(value = "批量下载测试用例")
@GetMapping("/{projectId}/download")
public void download(@PathVariable("projectId") Long projectId, HttpServletResponse response)throws IOException {
PmsProjectTestcaseModuleSearchVo pmsProjectTestcaseModuleSearchVo = new PmsProjectTestcaseModuleSearchVo();
pmsProjectTestcaseModuleSearchVo.setPmsProjectId(projectId);
List<TreeSelect> treeSelects = pmsProductModuleService.getPmsProductModuleTreeList(projectId, PmsConstants.TESTCASE_TAG_AND_MODULE_TYPE);
pmsProjectTestcaseService.generateWord(treeSelects, projectId, response);
}
/**
* 批量导入测试用例
*/
@ApiOperation(value = "批量导入测试用例")
@PostMapping("/{projectId}/upload")
public AjaxResult upload(@RequestPart("file") MultipartFile file, @PathVariable("projectId") Long projectId) throws IOException {
if (file.isEmpty()) {
return error("上传的文件为空,请选择有效的文件");
}
String fileName = file.getOriginalFilename();
if (fileName == null) {
return error("无法获取文件名,请检查上传的文件");
}
if (fileName.endsWith(".docx")) {
pmsProjectTestcaseService.testcaseImport(projectId, file);
return success("上传的文件是 docx 格式");
} else {
return error("上传的文件不是 docx 格式,请上传 docx 文件");
}
}
} }

View File

@ -126,29 +126,35 @@ public class PmsProjectTestcase extends BaseEntity {
private List<PmsProjectTestcaseStep> testcaseStepList; private List<PmsProjectTestcaseStep> testcaseStepList;
/** /**
* 预留字段1 * 测试用例描述
*/ */
@JsonIgnore @ApiModelProperty(value = "测试用例描述")
private String reservedField1; private String description;
/** /**
* 预留字段2 * 测试方法
*/ */
@JsonIgnore @ApiModelProperty(value = "测试方法")
private String reservedField2; private String testMethod;
/** /**
* 预留字段3 * 测试终止条件
*/ */
@JsonIgnore @ApiModelProperty(value = "测试终止条件")
private String reservedField3; private String terminationConditions;
@ApiModelProperty(value = "测试用例标识") @ApiModelProperty(value = "测试用例标识")
private String identifier; private String identifier;
@ApiModelProperty(value = "测试追踪")
private String testTracking;
@ApiModelProperty(value = "产品需求id") @ApiModelProperty(value = "产品需求id")
private Long productReqSpecsId; private Long productReqSpecsId;
@ApiModelProperty(value = "是否导入")
private Long isImport;
public PmsProjectTestcaseDataVo toPmsProjectTestcaseDataVo() { public PmsProjectTestcaseDataVo toPmsProjectTestcaseDataVo() {
PmsProjectTestcaseDataVo target = new PmsProjectTestcaseDataVo(); PmsProjectTestcaseDataVo target = new PmsProjectTestcaseDataVo();
BeanUtils.copyProperties(this, target); BeanUtils.copyProperties(this, target);

View File

@ -0,0 +1,68 @@
package com.microservices.pms.project.domain.vo;
import lombok.Data;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
@Data
public class PendingOutputDataVo {
private Long id;
private Long pms_projiect_id;
private String title;
private Long type_id;
private String tag_ids;
private List<String> content_list;
private List<String> expected_result;
private String update_by;
private LocalDate update_time;
private String create_by;
private LocalDate create_time;
private String test_type;
private String description;
private String test_method;
private String termination_conditions;
private String identifier;
private String preconditions;
public PendingOutputDataVo() {
content_list = new ArrayList<>();
expected_result = new ArrayList<>();
}
// 添加元素的方法
public void addToContent(String item) {
content_list.add(item);
}
public void addToExpected(String item) {
expected_result.add(item);
}
public void addContent(String item) {
this.content_list.add(item);
}
public void addExpected(String item) {
this.expected_result.add(item);
}
}

View File

@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.Size;
import java.util.List; import java.util.List;
/** /**
@ -35,6 +36,27 @@ public class PmsProjectTestcaseDetailVo extends PmsProjectTestcaseDataVo {
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
/**
* 测试用例描述
*/
@ApiModelProperty(value = "测试用例描述")
@Size(max = 500, message = "长度需要小于500")
private String description;
/**
* 测试方法
*/
@ApiModelProperty(value = "测试方法")
@Size(max = 255, message = "长度需要小于255")
private String testMethod;
/**
* 测试终止条件
*/
@ApiModelProperty(value = "测试终止条件")
@Size(max = 500, message = "长度需要小于500")
private String terminationConditions;
/** /**
* 测试步骤列表 * 测试步骤列表
*/ */

View File

@ -84,6 +84,35 @@ public class PmsProjectTestcaseInputVo {
@Size(max = 500, message = "长度需要小于500") @Size(max = 500, message = "长度需要小于500")
private String remark; private String remark;
/**
* 测试用例描述
*/
@ApiModelProperty(value = "测试用例描述")
@Size(max = 500, message = "长度需要小于500")
private String description;
/**
* 测试方法
*/
@ApiModelProperty(value = "测试方法")
@Size(max = 255, message = "长度需要小于255")
private String testMethod;
/**
* 测试终止条件
*/
@ApiModelProperty(value = "测试终止条件")
@Size(max = 500, message = "长度需要小于500")
private String terminationConditions;
@ApiModelProperty(value = "测试用例标识")
@Size(max = 255, message = "长度需要小于500")
private String identifier;
@ApiModelProperty(value = "测试追踪")
@Size(max = 255, message = "长度需要小于500")
private String testTracking;
/** /**
* 测试步骤列表 * 测试步骤列表
*/ */

View File

@ -0,0 +1,17 @@
package com.microservices.pms.project.domain.vo;
import lombok.Data;
@Data
public class PmsProjectTestcaseStepVo {
private Long index;
private String content;
private String expectedResult;
private String updateBy;
private String createBy;
}

View File

@ -80,6 +80,27 @@ public class PmsProjectTestcaseUpdateVo {
@Size(max = 500, message = "长度需要小于500") @Size(max = 500, message = "长度需要小于500")
private String remark; private String remark;
/**
* 测试用例描述
*/
@ApiModelProperty(value = "测试用例描述")
@Size(max = 500, message = "长度需要小于500")
private String description;
/**
* 测试方法
*/
@ApiModelProperty(value = "测试方法")
@Size(max = 255, message = "长度需要小于255")
private String testMethod;
/**
* 测试终止条件
*/
@ApiModelProperty(value = "测试终止条件")
@Size(max = 500, message = "长度需要小于500")
private String terminationConditions;
/** /**
* 测试步骤列表 * 测试步骤列表
*/ */

View File

@ -0,0 +1,41 @@
package com.microservices.pms.project.domain.vo;
import lombok.Data;
import java.time.LocalDate;
@Data
public class PmsProjectTestcaseVo {
private Long id;
private Long pmsProjiectId;
private String title;
private Long typeId;
private String tagIds;
private Long pmsModuleId;
private LocalDate updateTime;
private String updateBy;
private LocalDate createTime;
private String createBy;
private String preconditions;
private String description;
private String testMethod;
private String terminationConditions;
private String identifier;
private String testTracking;
}

View File

@ -2,6 +2,7 @@ package com.microservices.pms.project.mapper;
import com.microservices.pms.project.domain.PmsProjectTestcase; import com.microservices.pms.project.domain.PmsProjectTestcase;
import com.microservices.pms.project.domain.vo.PmsProjectTestcaseBatchUpdateVo; import com.microservices.pms.project.domain.vo.PmsProjectTestcaseBatchUpdateVo;
import com.microservices.pms.project.domain.vo.PmsProjectTestcaseVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -112,4 +113,12 @@ public interface PmsProjectTestcaseMapper {
List<Long> selectProjectIdListInTestcaseIdList(@Param("idList") List<Long> idList); List<Long> selectProjectIdListInTestcaseIdList(@Param("idList") List<Long> idList);
int deletePmsProjectTestcaseByProjectId(@Param("projectId") Long projectId); int deletePmsProjectTestcaseByProjectId(@Param("projectId") Long projectId);
/**
* 获取testcasevo中部分字段
*
* @param pms_project_id 关联的项目号
*/
public List<PmsProjectTestcaseVo> getTestcase(Long pms_project_id);
} }

View File

@ -1,6 +1,7 @@
package com.microservices.pms.project.mapper; package com.microservices.pms.project.mapper;
import com.microservices.pms.project.domain.PmsProjectTestcaseStep; import com.microservices.pms.project.domain.PmsProjectTestcaseStep;
import com.microservices.pms.project.domain.vo.PmsProjectTestcaseStepVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -77,4 +78,11 @@ public interface PmsProjectTestcaseStepMapper {
* @return 操作步骤 * @return 操作步骤
*/ */
PmsProjectTestcaseStep selectPmsProjectTestcaseStepByIndexAndTestcaseId(@Param("index") Long index, @Param("testcaseId") Long testcaseId); PmsProjectTestcaseStep selectPmsProjectTestcaseStepByIndexAndTestcaseId(@Param("index") Long index, @Param("testcaseId") Long testcaseId);
/**
* 获取testCaseStepvo中部分字段
*
* @param PmsProjectTestcase_id 关联的测试用例号
*/
public List<PmsProjectTestcaseStepVo> getTestcaseStep(Long PmsProjectTestcase_id);
} }

View File

@ -3,10 +3,14 @@ package com.microservices.pms.project.service;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.microservices.common.core.web.page.GenericsTableDataInfo; import com.microservices.common.core.web.page.GenericsTableDataInfo;
import com.microservices.pms.product.domain.vo.ProductReqSpecsAssociatedTestcaseDataVo; import com.microservices.pms.product.domain.vo.ProductReqSpecsAssociatedTestcaseDataVo;
import com.microservices.pms.product.domain.vo.TreeSelect;
import com.microservices.pms.project.domain.PmsProjectTestcase; import com.microservices.pms.project.domain.PmsProjectTestcase;
import com.microservices.pms.project.domain.vo.PmsProjectTestcaseDataVo; import com.microservices.pms.project.domain.vo.PmsProjectTestcaseDataVo;
import com.microservices.pms.project.domain.vo.PmsProjectTestcaseDetailVo; import com.microservices.pms.project.domain.vo.PmsProjectTestcaseDetailVo;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List; import java.util.List;
/** /**
@ -118,4 +122,21 @@ public interface IPmsProjectTestcaseService {
List<ProductReqSpecsAssociatedTestcaseDataVo> selectReqSpecsAssociatedTestcaseList(Long reqSpecsId); List<ProductReqSpecsAssociatedTestcaseDataVo> selectReqSpecsAssociatedTestcaseList(Long reqSpecsId);
PmsProjectTestcase copyPmsProjectTestcase(Long testcaseId); PmsProjectTestcase copyPmsProjectTestcase(Long testcaseId);
/**
* 获取测试用例列表
*
* @param treeSelects 模块树结构
* @param projectId 项目id
* @param response
* @return 导出word数据流
*/
void generateWord(List<TreeSelect> treeSelects, Long projectId, HttpServletResponse response)throws IOException;
/**
* 处理docx文件将测试用例导入到数据库
* @param projectId 项目id
* @param file 导入的docx文件
*/
void testcaseImport(Long projectId, MultipartFile file) throws IOException;
} }

View File

@ -21,11 +21,13 @@
<result property="createBy" column="create_by"/> <result property="createBy" column="create_by"/>
<result property="delFlag" column="del_flag"/> <result property="delFlag" column="del_flag"/>
<result property="index" column="index"/> <result property="index" column="index"/>
<result property="reservedField1" column="reserved_field_1"/> <result property="description" column="description"/>
<result property="reservedField2" column="reserved_field_2"/> <result property="testMethod" column="test_method"/>
<result property="reservedField3" column="reserved_field_3"/> <result property="terminationConditions" column="termination_conditions"/>
<result property="identifier" column="identifier"/> <result property="identifier" column="identifier"/>
<result property="testTracking" column="test_track"/>
<result property="productReqSpecsId" column="product_req_specs_id"/> <result property="productReqSpecsId" column="product_req_specs_id"/>
<result property="isImport" column="is_import"/>
</resultMap> </resultMap>
<sql id="selectPmsProjectTestcaseVo"> <sql id="selectPmsProjectTestcaseVo">
@ -45,9 +47,9 @@
create_by, create_by,
del_flag, del_flag,
`index`, `index`,
reserved_field_1, description,
reserved_field_2, test_method,
reserved_field_3, termination_conditions,
identifier, identifier,
product_req_specs_id product_req_specs_id
from pms_project_testcase from pms_project_testcase
@ -127,11 +129,13 @@
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="delFlag != null">del_flag,</if> <if test="delFlag != null">del_flag,</if>
<if test="index != null">`index`,</if> <if test="index != null">`index`,</if>
<if test="reservedField1 != null">reserved_field_1,</if> <if test="description != null">description,</if>
<if test="reservedField2 != null">reserved_field_2,</if> <if test="testMethod != null">test_method,</if>
<if test="reservedField3 != null">reserved_field_3,</if> <if test="terminationConditions != null">termination_conditions,</if>
<if test="identifier != null">identifier,</if> <if test="identifier != null">identifier,</if>
<if test="testTracking != null">test_tracking,</if>
<if test="productReqSpecsId != null">product_req_specs_id,</if> <if test="productReqSpecsId != null">product_req_specs_id,</if>
<if test="isImport != null">is_import,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="title != null and title != ''">#{title},</if> <if test="title != null and title != ''">#{title},</if>
@ -149,11 +153,13 @@
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="delFlag != null">#{delFlag},</if> <if test="delFlag != null">#{delFlag},</if>
<if test="index != null">#{index},</if> <if test="index != null">#{index},</if>
<if test="reservedField1 != null">#{reservedField1},</if> <if test="description != null">#{description},</if>
<if test="reservedField2 != null">#{reservedField2},</if> <if test="testMethod != null">#{testMethod},</if>
<if test="reservedField3 != null">#{reservedField3},</if> <if test="terminationConditions != null">#{terminationConditions},</if>
<if test="identifier != null">#{identifier},</if> <if test="identifier != null">#{identifier},</if>
<if test="testTracking != null">#{testTracking},</if>
<if test="productReqSpecsId != null">#{productReqSpecsId},</if> <if test="productReqSpecsId != null">#{productReqSpecsId},</if>
<if test="isImport != null">#{isImport},</if>
</trim> </trim>
</insert> </insert>
@ -175,11 +181,13 @@
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if> <if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="index != null">`index` = #{index},</if> <if test="index != null">`index` = #{index},</if>
<if test="reservedField1 != null">reserved_field_1 = #{reservedField1},</if> <if test="description != null">description = #{description},</if>
<if test="reservedField2 != null">reserved_field_2 = #{reservedField2},</if> <if test="testMethod != null">test_method = #{testMethod},</if>
<if test="reservedField3 != null">reserved_field_3 = #{reservedField3},</if> <if test="terminationConditions != null">termination_conditions = #{terminationConditions},</if>
<if test="identifier != null">identifier = #{identifier},</if> <if test="identifier != null">identifier = #{identifier},</if>
<if test="productReqSpecsId != null">product_req_specs_id = #{productReqSpecsId},</if> <if test="testTracking != null">#{testTracking},</if>
<if test="productReqSpecsId != null">#{productReqSpecsId},</if>
<if test="isImport != null">#{isImport},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
@ -296,4 +304,28 @@
#{id} #{id}
</foreach> </foreach>
</select> </select>
<resultMap type="com.microservices.pms.project.domain.vo.PmsProjectTestcaseVo" id="PmsProjectTestcaseVo">
<result property="id" column="id" />
<result property="pmsProjiectId" column="pms_project_id" />
<result property="title" column="title" />
<result property="typeId" column="type_id" />
<result property="tagIds" column="tag_ids"/>
<result property="pmsModuleId" column="pms_module_id"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="preconditions" column="preconditions"/>
<result property="description" column="description"/>
<result property="testMethod" column="test_Method"/>
<result property="terminationConditions" column="termination_conditions"/>
<result property="identifier" column="identifier"/>
<result property="testTracking" column="test_tracking"/>
</resultMap>
<select id="getTestcase" resultMap="PmsProjectTestcaseVo">
SELECT * FROM pms_project_testcase WHERE pms_project_id = #{project_id}
</select>
</mapper> </mapper>

View File

@ -58,6 +58,16 @@
where `index` = #{index} where `index` = #{index}
and pms_testcase_id=#{testcaseId} and pms_testcase_id=#{testcaseId}
</select> </select>
<resultMap type="com.microservices.pms.project.domain.vo.PmsProjectTestcaseStepVo" id="PmsProjectTestcaseStepVo">
<result property="index" column="index"/>
<result property="content" column="content"/>
<result property="expectedResult" column="expected_result"/>
<result property="updateBy" column="update_by"/>
<result property="createBy" column="create_by"/>
</resultMap>
<select id="getTestcaseStep" resultMap="PmsProjectTestcaseStepVo">
SELECT * FROM pms_project_testcase_step WHERE pms_testcase_id = #{pms_project_testcase_id}
</select>
<insert id="insertPmsProjectTestcaseStep" parameterType="PmsProjectTestcaseStep" useGeneratedKeys="true" <insert id="insertPmsProjectTestcaseStep" parameterType="PmsProjectTestcaseStep" useGeneratedKeys="true"
keyProperty="id"> keyProperty="id">