diff --git a/xm-core/src/main/java/com/xm/core/entity/XmTestCase.java b/xm-core/src/main/java/com/xm/core/entity/XmTestCase.java index 1cdf467b..e81404e1 100644 --- a/xm-core/src/main/java/com/xm/core/entity/XmTestCase.java +++ b/xm-core/src/main/java/com/xm/core/entity/XmTestCase.java @@ -1,19 +1,18 @@ -package com.xm.core.entity; +package com.xm.core.entity; +import lombok.Data; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - import java.util.Date; /** - * 组织 com.qqkj 顶级模块 xm 大模块 core 小模块
+ * 组织 com 顶级模块 xm 大模块 core 小模块
* 实体 XmTestCase所有属性名:
- * id,caseName,caseRemark,testStep,expectResult,menuId,menuName,ctime,ltime,luserid,lusername,cbranchId,moduleId,moduleName,caseStatus;
- * 表 XM.xm_test_case 测试用例的所有字段名:
- * id,case_name,case_remark,test_step,expect_result,menu_id,menu_name,ctime,ltime,luserid,lusername,cbranch_id,module_id,module_name,case_status;
+ * "id","主键","caseName","标题","caseRemark","备注","testStep","测试步骤","expectResult","期望结果","menuId","关联的故事","menuName","关联故事名","ctime","创建时间","ltime","更新时间","luserid","更新人编号","lusername","更新人姓名","cbranchId","创建机构","moduleId","模块编号","moduleName","模块名称","caseStatus","用例状态1正常0废弃","cuserid","创建人编号","cusername","创建人姓名","productId","产品编号","verNum","版本号","casedbId","用例库编号","casedbName","用例库名称";
* 当前主键(包括多主键):
* id;
*/ + @Data @ApiModel(description="测试用例") public class XmTestCase implements java.io.Serializable { @@ -35,10 +34,10 @@ public class XmTestCase implements java.io.Serializable { @ApiModelProperty(notes="期望结果",allowEmptyValue=true,example="",allowableValues="") String expectResult; - @ApiModelProperty(notes="关联的需求",allowEmptyValue=true,example="",allowableValues="") + @ApiModelProperty(notes="关联的故事",allowEmptyValue=true,example="",allowableValues="") String menuId; - @ApiModelProperty(notes="关联需求名",allowEmptyValue=true,example="",allowableValues="") + @ApiModelProperty(notes="关联故事名",allowEmptyValue=true,example="",allowableValues="") String menuName; @ApiModelProperty(notes="创建时间",allowEmptyValue=true,example="",allowableValues="") @@ -64,196 +63,36 @@ public class XmTestCase implements java.io.Serializable { @ApiModelProperty(notes="用例状态1正常0废弃",allowEmptyValue=true,example="",allowableValues="") String caseStatus; + + @ApiModelProperty(notes="创建人编号",allowEmptyValue=true,example="",allowableValues="") + String cuserid; + + @ApiModelProperty(notes="创建人姓名",allowEmptyValue=true,example="",allowableValues="") + String cusername; + + @ApiModelProperty(notes="产品编号",allowEmptyValue=true,example="",allowableValues="") + String productId; + + @ApiModelProperty(notes="版本号",allowEmptyValue=true,example="",allowableValues="") + String verNum; + + @ApiModelProperty(notes="用例库编号",allowEmptyValue=true,example="",allowableValues="") + String casedbId; + + @ApiModelProperty(notes="用例库名称",allowEmptyValue=true,example="",allowableValues="") + String casedbName; - /**主键**/ + /** + *主键 + **/ public XmTestCase(String id) { this.id = id; } - /**测试用例**/ + /** + * 测试用例 + **/ public XmTestCase() { } - - /** - * 主键 - **/ - public void setId(String id) { - this.id = id; - } - /** - * 标题 - **/ - public void setCaseName(String caseName) { - this.caseName = caseName; - } - /** - * 备注 - **/ - public void setCaseRemark(String caseRemark) { - this.caseRemark = caseRemark; - } - /** - * 测试步骤 - **/ - public void setTestStep(String testStep) { - this.testStep = testStep; - } - /** - * 期望结果 - **/ - public void setExpectResult(String expectResult) { - this.expectResult = expectResult; - } - /** - * 关联的需求 - **/ - public void setMenuId(String menuId) { - this.menuId = menuId; - } - /** - * 关联需求名 - **/ - public void setMenuName(String menuName) { - this.menuName = menuName; - } - /** - * 创建时间 - **/ - public void setCtime(Date ctime) { - this.ctime = ctime; - } - /** - * 更新时间 - **/ - public void setLtime(Date ltime) { - this.ltime = ltime; - } - /** - * 更新人编号 - **/ - public void setLuserid(String luserid) { - this.luserid = luserid; - } - /** - * 更新人姓名 - **/ - public void setLusername(String lusername) { - this.lusername = lusername; - } - /** - * 创建机构 - **/ - public void setCbranchId(String cbranchId) { - this.cbranchId = cbranchId; - } - /** - * 模块编号 - **/ - public void setModuleId(String moduleId) { - this.moduleId = moduleId; - } - /** - * 模块名称 - **/ - public void setModuleName(String moduleName) { - this.moduleName = moduleName; - } - /** - * 用例状态1正常0废弃 - **/ - public void setCaseStatus(String caseStatus) { - this.caseStatus = caseStatus; - } - - /** - * 主键 - **/ - public String getId() { - return this.id; - } - /** - * 标题 - **/ - public String getCaseName() { - return this.caseName; - } - /** - * 备注 - **/ - public String getCaseRemark() { - return this.caseRemark; - } - /** - * 测试步骤 - **/ - public String getTestStep() { - return this.testStep; - } - /** - * 期望结果 - **/ - public String getExpectResult() { - return this.expectResult; - } - /** - * 关联的需求 - **/ - public String getMenuId() { - return this.menuId; - } - /** - * 关联需求名 - **/ - public String getMenuName() { - return this.menuName; - } - /** - * 创建时间 - **/ - public Date getCtime() { - return this.ctime; - } - /** - * 更新时间 - **/ - public Date getLtime() { - return this.ltime; - } - /** - * 更新人编号 - **/ - public String getLuserid() { - return this.luserid; - } - /** - * 更新人姓名 - **/ - public String getLusername() { - return this.lusername; - } - /** - * 创建机构 - **/ - public String getCbranchId() { - return this.cbranchId; - } - /** - * 模块编号 - **/ - public String getModuleId() { - return this.moduleId; - } - /** - * 模块名称 - **/ - public String getModuleName() { - return this.moduleName; - } - /** - * 用例状态1正常0废弃 - **/ - public String getCaseStatus() { - return this.caseStatus; - } } \ No newline at end of file diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestCaseMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestCaseMapper.xml index 1bd7b2bd..26ea6ef1 100644 --- a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestCaseMapper.xml +++ b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestCaseMapper.xml @@ -3,11 +3,35 @@ - - - - - + + + + and (res.id) in + + ( #{item}) + + + and res.ctime > #{ctimeStart} + and res.ctime < #{ctimeTimeEnd} + + and (res.luserid=#{myUserid} or res.cuserid=#{myUserid}) + and (res.luserid=#{compete} or res.cuserid=#{compete}) + and + res.menu_id in + + #{item} + + + and exists ( select 1 from xm_test_case_exec c where c.case_id=res.id and c.project_id=#{projectId} ) + and exists( select 1 from xm_menu m where m.menu_id =res.menu_id + and m.product_id=#{productId} + and m.iteration_id=#{iterationId} + ) + + and res.case_name like #{key} + + + @@ -15,32 +39,9 @@ @@ -58,7 +59,13 @@ where res.id = #{id} - + - + insert into xm_test_case( ) values ( - #{id},#{caseName},#{caseRemark},#{testStep},#{expectResult},#{menuId},#{menuName},#{ctime},#{ltime},#{luserid},#{lusername},#{cbranchId},#{moduleId},#{moduleName},#{caseStatus} + #{id},#{caseName},#{caseRemark},#{testStep},#{expectResult},#{menuId},#{menuName},#{ctime},#{ltime},#{luserid},#{lusername},#{cbranchId},#{moduleId},#{moduleName},#{caseStatus},#{cuserid},#{cusername},#{productId},#{verNum},#{casedbId},#{casedbName} ) @@ -91,13 +98,13 @@ - delete from xm_test_case + delete from xm_test_case where id = #{id} - update xm_test_case + update xm_test_case @@ -106,7 +113,7 @@ - update xm_test_case + update xm_test_case @@ -121,27 +128,40 @@ - update xm_test_case + update xm_test_case set where id = #{item.id} + + + + update xm_test_case + + + + where (id) in + + ( #{item}) + + - delete from xm_test_case - where id in - - #{item.id } - + delete from xm_test_case + where + (id) in + + ( #{item.id} ) + - id,case_name,case_remark,test_step,expect_result,menu_id,menu_name,ctime,ltime,luserid,lusername,cbranch_id,module_id,module_name,case_status + id,case_name,case_remark,test_step,expect_result,menu_id,menu_name,ctime,ltime,luserid,lusername,cbranch_id,module_id,module_name,case_status,cuserid,cusername,product_id,ver_num,casedb_id,casedb_name - + and res.id = #{id} @@ -151,14 +171,20 @@ and res.expect_result = #{expectResult} and res.menu_id = #{menuId} and res.menu_name = #{menuName} - and TO_CHAR(res.ctime,'YYYY-MM-DD') = TO_CHAR(#{ctime},'YYYY-MM-DD') - and TO_CHAR(res.ltime,'YYYY-MM-DD') = TO_CHAR(#{ltime},'YYYY-MM-DD') + and date_format(res.ctime,'%Y-%m-%d') = date_format(#{ctime},'%Y-%m-%d') + and date_format(res.ltime,'%Y-%m-%d') = date_format(#{ltime},'%Y-%m-%d') and res.luserid = #{luserid} and res.lusername = #{lusername} and res.cbranch_id = #{cbranchId} and res.module_id = #{moduleId} and res.module_name = #{moduleName} and res.case_status = #{caseStatus} + and res.cuserid = #{cuserid} + and res.cusername = #{cusername} + and res.product_id = #{productId} + and res.ver_num = #{verNum} + and res.casedb_id = #{casedbId} + and res.casedb_name = #{casedbName} @@ -175,7 +201,13 @@ cbranch_id = #{cbranchId}, module_id = #{moduleId}, module_name = #{moduleName}, - case_status = #{caseStatus} + case_status = #{caseStatus}, + cuserid = #{cuserid}, + cusername = #{cusername}, + product_id = #{productId}, + ver_num = #{verNum}, + casedb_id = #{casedbId}, + casedb_name = #{casedbName} case_name = #{caseName}, @@ -192,6 +224,12 @@ module_id = #{moduleId}, module_name = #{moduleName}, case_status = #{caseStatus}, + cuserid = #{cuserid}, + cusername = #{cusername}, + product_id = #{productId}, + ver_num = #{verNum}, + casedb_id = #{casedbId}, + casedb_name = #{casedbName}, @@ -208,6 +246,12 @@ cbranch_id = #{item.cbranchId}, module_id = #{item.moduleId}, module_name = #{item.moduleName}, - case_status = #{item.caseStatus} + case_status = #{item.caseStatus}, + cuserid = #{item.cuserid}, + cusername = #{item.cusername}, + product_id = #{item.productId}, + ver_num = #{item.verNum}, + casedb_id = #{item.casedbId}, + casedb_name = #{item.casedbName} \ No newline at end of file