8 changed files with 75 additions and 1015 deletions
-
44xm-core/src/main/java/com/xm/core/ctrl/XmTestCaseController.java
-
283xm-core/src/main/java/com/xm/core/ctrl/XmTestCaseExecController.java
-
45xm-core/src/main/java/com/xm/core/ctrl/XmTestCasedbController.java
-
45xm-core/src/main/java/com/xm/core/ctrl/XmTestPlanCaseController.java
-
45xm-core/src/main/java/com/xm/core/ctrl/XmTestPlanController.java
-
334xm-core/src/main/java/com/xm/core/entity/XmTestCaseExec.java
-
29xm-core/src/main/java/com/xm/core/service/XmTestCaseExecService.java
-
241xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestCaseExecMapper.xml
@ -1,283 +0,0 @@ |
|||||
package com.xm.core.ctrl; |
|
||||
|
|
||||
import com.mdp.core.entity.Tips; |
|
||||
import com.mdp.core.err.BizException; |
|
||||
import com.mdp.core.utils.RequestUtils; |
|
||||
import com.mdp.mybatis.PageUtils; |
|
||||
import com.mdp.qx.HasQx; |
|
||||
import com.mdp.safe.client.utils.LoginUtils; |
|
||||
import com.xm.core.entity.XmTestCaseExec; |
|
||||
import com.xm.core.service.XmTestCaseExecService; |
|
||||
import io.swagger.annotations.*; |
|
||||
import org.apache.commons.logging.Log; |
|
||||
import org.apache.commons.logging.LogFactory; |
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||
import org.springframework.util.StringUtils; |
|
||||
import org.springframework.web.bind.annotation.*; |
|
||||
import springfox.documentation.annotations.ApiIgnore; |
|
||||
|
|
||||
import java.util.ArrayList; |
|
||||
import java.util.HashMap; |
|
||||
import java.util.List; |
|
||||
import java.util.Map; |
|
||||
|
|
||||
/** |
|
||||
* url编制采用rest风格,如对XM.xm_test_case_exec xm_test_case_exec的操作有增删改查,对应的url分别为:<br> |
|
||||
* 新增: core/xmTestCaseExec/add <br> |
|
||||
* 查询: core/xmTestCaseExec/list<br> |
|
||||
* 模糊查询: core/xmTestCaseExec/listKey<br> |
|
||||
* 修改: core/xmTestCaseExec/edit <br> |
|
||||
* 删除: core/xmTestCaseExec/del<br> |
|
||||
* 批量删除: core/xmTestCaseExec/batchDel<br> |
|
||||
* 组织 com.qqkj 顶级模块 xm 大模块 core 小模块 <br> |
|
||||
* 实体 XmTestCaseExec 表 XM.xm_test_case_exec 当前主键(包括多主键): id; |
|
||||
***/ |
|
||||
@RestController("xm.core.xmTestCaseExecController") |
|
||||
@RequestMapping(value="/**/core/xmTestCaseExec") |
|
||||
@Api(tags={"xm_test_case_exec操作接口"}) |
|
||||
public class XmTestCaseExecController { |
|
||||
|
|
||||
static Log logger=LogFactory.getLog(XmTestCaseExecController.class); |
|
||||
|
|
||||
@Autowired |
|
||||
private XmTestCaseExecService xmTestCaseExecService; |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
@ApiOperation( value = "查询xm_test_case_exec信息列表",notes="listXmTestCaseExec,条件之间是 and关系,模糊查询写法如 {studentName:'%才哥%'}") |
|
||||
@ApiImplicitParams({ |
|
||||
@ApiImplicitParam(name="id",value="执行编号,主键",required=false), |
|
||||
@ApiImplicitParam(name="execUserid",value="执行人",required=false), |
|
||||
@ApiImplicitParam(name="startTime",value="开始时间",required=false), |
|
||||
@ApiImplicitParam(name="projectId",value="项目编号",required=false), |
|
||||
@ApiImplicitParam(name="projectName",value="项目名称",required=false), |
|
||||
@ApiImplicitParam(name="caseId",value="测试案例编号",required=false), |
|
||||
@ApiImplicitParam(name="caseName",value="测试案例名称",required=false), |
|
||||
@ApiImplicitParam(name="endTime",value="到期时间",required=false), |
|
||||
@ApiImplicitParam(name="remark",value="问题描述",required=false), |
|
||||
@ApiImplicitParam(name="createUserid",value="问题创建人编号",required=false), |
|
||||
@ApiImplicitParam(name="createUsername",value="问题创建人",required=false), |
|
||||
@ApiImplicitParam(name="createTime",value="创建时间",required=false), |
|
||||
@ApiImplicitParam(name="execStatus",value="0新建1测试中2已完成",required=false), |
|
||||
@ApiImplicitParam(name="iterationId",value="迭代编号",required=false), |
|
||||
@ApiImplicitParam(name="iterationName",value="迭代名称",required=false), |
|
||||
@ApiImplicitParam(name="execUsername",value="执行人姓名",required=false), |
|
||||
@ApiImplicitParam(name="taskId",value="归属测试任务编号",required=false), |
|
||||
@ApiImplicitParam(name="taskName",value="归属测试任务名称",required=false), |
|
||||
@ApiImplicitParam(name="menuId",value="需求编号",required=false), |
|
||||
@ApiImplicitParam(name="pageSize",value="每页记录数",required=false), |
|
||||
@ApiImplicitParam(name="pageNum",value="当前页码,从1开始",required=false), |
|
||||
@ApiImplicitParam(name="total",value="总记录数,服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算",required=false), |
|
||||
@ApiImplicitParam(name="orderBy",value="排序列 如性别、学生编号排序 orderBy = sex desc,student_id desc",required=false), |
|
||||
@ApiImplicitParam(name="count",value="是否进行总条数计算,count=true|false",required=false) |
|
||||
}) |
|
||||
@ApiResponses({ |
|
||||
@ApiResponse(code = 200,response= XmTestCaseExec.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'错误码'},total:总记录数,data:[数据对象1,数据对象2,...]}") |
|
||||
}) |
|
||||
@RequestMapping(value="/list",method=RequestMethod.GET) |
|
||||
public Map<String,Object> listXmTestCaseExec( @ApiIgnore @RequestParam Map<String,Object> xmTestCaseExec){ |
|
||||
Map<String,Object> m = new HashMap<>(); |
|
||||
RequestUtils.transformArray(xmTestCaseExec, "ids"); |
|
||||
RequestUtils.transformArray(xmTestCaseExec, "menuIds"); |
|
||||
PageUtils.startPage(xmTestCaseExec); |
|
||||
Tips tips=new Tips("查询成功"); |
|
||||
String id= (String) xmTestCaseExec.get("id"); |
|
||||
String menuId= (String) xmTestCaseExec.get("menuId"); |
|
||||
Object ids= xmTestCaseExec.get("ids"); |
|
||||
Object menuIds= xmTestCaseExec.get("menuIds"); |
|
||||
String projectId= (String) xmTestCaseExec.get("projectId"); |
|
||||
String productId= (String) xmTestCaseExec.get("productId"); |
|
||||
String caseId= (String) xmTestCaseExec.get("caseId"); |
|
||||
if( !( StringUtils.hasText(caseId)||StringUtils.hasText(id) || StringUtils.hasText(menuId) || StringUtils.hasText(projectId)|| StringUtils.hasText(productId)||menuIds!=null||ids!=null ) ){ |
|
||||
xmTestCaseExec.put("compete", LoginUtils.getCurrentUserInfo().getUserid()); |
|
||||
} |
|
||||
List<Map<String,Object>> xmTestCaseExecList = xmTestCaseExecService.selectListMapByWhere(xmTestCaseExec); //列出XmTestCaseExec列表 |
|
||||
PageUtils.responePage(m, xmTestCaseExecList); |
|
||||
m.put("data",xmTestCaseExecList); |
|
||||
|
|
||||
m.put("tips", tips); |
|
||||
return m; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
/***/ |
|
||||
@ApiOperation( value = "新增一条xm_test_case_exec信息",notes="addXmTestCaseExec,主键如果为空,后台自动生成") |
|
||||
@ApiResponses({ |
|
||||
@ApiResponse(code = 200,response=XmTestCaseExec.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") |
|
||||
}) |
|
||||
@HasQx(value = "xm_core_xmTestCaseExec_add",name = "新增测试计划",moduleId = "xm-project",moduleName = "管理端-项目管理系统") |
|
||||
@RequestMapping(value="/add",method=RequestMethod.POST) |
|
||||
public Map<String,Object> addXmTestCaseExec(@RequestBody XmTestCaseExec xmTestCaseExec) { |
|
||||
Map<String,Object> m = new HashMap<>(); |
|
||||
Tips tips=new Tips("成功新增一条数据"); |
|
||||
try{ |
|
||||
if(StringUtils.isEmpty(xmTestCaseExec.getId())) { |
|
||||
xmTestCaseExec.setId(xmTestCaseExecService.createKey("id")); |
|
||||
}else{ |
|
||||
XmTestCaseExec xmTestCaseExecQuery = new XmTestCaseExec(xmTestCaseExec.getId()); |
|
||||
if(xmTestCaseExecService.countByWhere(xmTestCaseExecQuery)>0){ |
|
||||
tips.setFailureMsg("编号重复,请修改编号再提交"); |
|
||||
m.put("tips", tips); |
|
||||
return m; |
|
||||
} |
|
||||
} |
|
||||
xmTestCaseExecService.insert(xmTestCaseExec); |
|
||||
m.put("data",xmTestCaseExec); |
|
||||
}catch (BizException e) { |
|
||||
tips=e.getTips(); |
|
||||
logger.error("",e); |
|
||||
}catch (Exception e) { |
|
||||
tips.setFailureMsg(e.getMessage()); |
|
||||
logger.error("",e); |
|
||||
} |
|
||||
m.put("tips", tips); |
|
||||
return m; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/** */ |
|
||||
@ApiOperation( value = "删除一条xm_test_case_exec信息",notes="delXmTestCaseExec,仅需要上传主键字段") |
|
||||
@ApiResponses({ |
|
||||
@ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}}") |
|
||||
}) |
|
||||
@HasQx(value = "xm_core_xmTestCaseExec_del",name = "删除测试计划",moduleId = "xm-project",moduleName = "管理端-项目管理系统") |
|
||||
@RequestMapping(value="/del",method=RequestMethod.POST) |
|
||||
public Map<String,Object> delXmTestCaseExec(@RequestBody XmTestCaseExec xmTestCaseExec){ |
|
||||
Map<String,Object> m = new HashMap<>(); |
|
||||
Tips tips=new Tips("成功删除一条数据"); |
|
||||
try{ |
|
||||
xmTestCaseExecService.deleteByPk(xmTestCaseExec); |
|
||||
}catch (BizException e) { |
|
||||
tips=e.getTips(); |
|
||||
logger.error("",e); |
|
||||
}catch (Exception e) { |
|
||||
tips.setFailureMsg(e.getMessage()); |
|
||||
logger.error("",e); |
|
||||
} |
|
||||
m.put("tips", tips); |
|
||||
return m; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/***/ |
|
||||
@ApiOperation( value = "根据主键修改一条xm_test_case_exec信息",notes="editXmTestCaseExec") |
|
||||
@ApiResponses({ |
|
||||
@ApiResponse(code = 200,response=XmTestCaseExec.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") |
|
||||
}) |
|
||||
@HasQx(value = "xm_core_xmTestCaseExec_edit",name = "修改测试计划",moduleId = "xm-project",moduleName = "管理端-项目管理系统") |
|
||||
@RequestMapping(value="/edit",method=RequestMethod.POST) |
|
||||
public Map<String,Object> editXmTestCaseExec(@RequestBody XmTestCaseExec xmTestCaseExec) { |
|
||||
Map<String,Object> m = new HashMap<>(); |
|
||||
Tips tips=new Tips("成功更新一条数据"); |
|
||||
try{ |
|
||||
xmTestCaseExecService.updateByPk(xmTestCaseExec); |
|
||||
m.put("data",xmTestCaseExec); |
|
||||
}catch (BizException e) { |
|
||||
tips=e.getTips(); |
|
||||
logger.error("",e); |
|
||||
}catch (Exception e) { |
|
||||
tips.setFailureMsg(e.getMessage()); |
|
||||
logger.error("",e); |
|
||||
} |
|
||||
m.put("tips", tips); |
|
||||
return m; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
/***/ |
|
||||
@ApiOperation( value = "根据主键列表批量删除xm_test_case_exec信息",notes="batchDelXmTestCaseExec,仅需要上传主键字段") |
|
||||
@ApiResponses({ |
|
||||
@ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}") |
|
||||
}) |
|
||||
@HasQx(value = "xm_core_xmTestCaseExec_batchDel",name = "批量删除测试计划",moduleId = "xm-project",moduleName = "管理端-项目管理系统") |
|
||||
@RequestMapping(value="/batchDel",method=RequestMethod.POST) |
|
||||
public Map<String,Object> batchDelXmTestCaseExec(@RequestBody List<XmTestCaseExec> xmTestCaseExecs) { |
|
||||
Map<String,Object> m = new HashMap<>(); |
|
||||
Tips tips=new Tips("成功删除"+xmTestCaseExecs.size()+"条数据"); |
|
||||
try{ |
|
||||
xmTestCaseExecService.batchDelete(xmTestCaseExecs); |
|
||||
}catch (BizException e) { |
|
||||
tips=e.getTips(); |
|
||||
logger.error("",e); |
|
||||
}catch (Exception e) { |
|
||||
tips.setFailureMsg(e.getMessage()); |
|
||||
logger.error("",e); |
|
||||
} |
|
||||
m.put("tips", tips); |
|
||||
return m; |
|
||||
} |
|
||||
@ApiOperation( value = "批量新增") |
|
||||
@ApiResponses({ |
|
||||
@ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}") |
|
||||
}) |
|
||||
@HasQx(value = "xm_core_xmTestCaseExec_batchAdd",name = "批量新增测试计划",moduleId = "xm-project",moduleName = "管理端-项目管理系统") |
|
||||
@RequestMapping(value="/batchAdd",method=RequestMethod.POST) |
|
||||
public Map<String,Object> batchAddXmTestCaseExec(@RequestBody List<XmTestCaseExec> xmTestCaseExecs) { |
|
||||
Map<String,Object> m = new HashMap<>(); |
|
||||
Tips tips=new Tips("成功新增"+xmTestCaseExecs.size()+"条数据"); |
|
||||
try{ |
|
||||
/** |
|
||||
* 根据caseId,projectId判断是否重复,重复的应该忽略 |
|
||||
*/ |
|
||||
List<String> caseIds=new ArrayList<>(); |
|
||||
String projectId=""; |
|
||||
for (XmTestCaseExec ce : xmTestCaseExecs) { |
|
||||
caseIds.add(ce.getCaseId()); |
|
||||
projectId=ce.getProjectId(); |
|
||||
} |
|
||||
List<XmTestCaseExec> existsList=this.xmTestCaseExecService.listByProjectAndCaseIds(projectId,caseIds); |
|
||||
List<XmTestCaseExec> canAddList=new ArrayList<>(); |
|
||||
for (XmTestCaseExec xmTestCaseExec : xmTestCaseExecs) { |
|
||||
boolean exists=false; |
|
||||
for (XmTestCaseExec ce : existsList) { |
|
||||
if(xmTestCaseExec.getProjectId().equals(ce.getProjectId()) && xmTestCaseExec.getCaseId().equals(ce.getCaseId())) { |
|
||||
exists=true; |
|
||||
break; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
if(exists==false) { |
|
||||
canAddList.add(xmTestCaseExec); |
|
||||
} |
|
||||
} |
|
||||
if(canAddList.size()>0) { |
|
||||
xmTestCaseExecService.batchInsert(canAddList); |
|
||||
} |
|
||||
tips.setOkMsg("成功新增"+canAddList.size()+"条数据,忽略已存在的"+(xmTestCaseExecs.size()-canAddList.size())+"条数据"); |
|
||||
}catch (BizException e) { |
|
||||
tips=e.getTips(); |
|
||||
logger.error("",e); |
|
||||
}catch (Exception e) { |
|
||||
tips.setFailureMsg(e.getMessage()); |
|
||||
logger.error("",e); |
|
||||
} |
|
||||
m.put("tips", tips); |
|
||||
return m; |
|
||||
} |
|
||||
@ApiOperation( value = "批量修改") |
|
||||
@ApiResponses({ |
|
||||
@ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}") |
|
||||
}) |
|
||||
@HasQx(value = "xm_core_xmTestCaseExec_batchEdit",name = "批量修改测试计划",moduleId = "xm-project",moduleName = "管理端-项目管理系统") |
|
||||
@RequestMapping(value="/batchEdit",method=RequestMethod.POST) |
|
||||
public Map<String,Object> batchEditXmTestCaseExec(@RequestBody List<XmTestCaseExec> xmTestCaseExecs) { |
|
||||
Map<String,Object> m = new HashMap<>(); |
|
||||
Tips tips=new Tips("成功修改"+xmTestCaseExecs.size()+"条数据"); |
|
||||
try{ |
|
||||
xmTestCaseExecService.batchUpdate(xmTestCaseExecs); |
|
||||
}catch (BizException e) { |
|
||||
tips=e.getTips(); |
|
||||
logger.error("",e); |
|
||||
}catch (Exception e) { |
|
||||
tips.setFailureMsg(e.getMessage()); |
|
||||
logger.error("",e); |
|
||||
} |
|
||||
m.put("tips", tips); |
|
||||
return m; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
@ -1,334 +0,0 @@ |
|||||
package com.xm.core.entity; |
|
||||
|
|
||||
import io.swagger.annotations.ApiModel; |
|
||||
import io.swagger.annotations.ApiModelProperty; |
|
||||
|
|
||||
import java.util.Date; |
|
||||
|
|
||||
/** |
|
||||
* 组织 com.qqkj 顶级模块 xm 大模块 core 小模块 <br> |
|
||||
* 实体 XmTestCaseExec所有属性名: <br> |
|
||||
* execUserid,startTime,id,projectId,projectName,caseId,caseName,endTime,remark,createUserid,createUsername,createTime,execStatus,iterationId,iterationName,execUsername,taskId,taskName,menuId,menuName;<br> |
|
||||
* 表 XM.xm_test_case_exec xm_test_case_exec的所有字段名: <br> |
|
||||
* exec_userid,start_time,id,project_id,project_name,case_id,case_name,end_time,remark,create_userid,create_username,create_time,exec_status,iteration_id,iteration_name,exec_username,task_id,task_name,menu_id,menu_name;<br> |
|
||||
* 当前主键(包括多主键):<br> |
|
||||
* id;<br> |
|
||||
*/ |
|
||||
@ApiModel(description="xm_test_case_exec") |
|
||||
public class XmTestCaseExec implements java.io.Serializable { |
|
||||
|
|
||||
private static final long serialVersionUID = 1L; |
|
||||
|
|
||||
@ApiModelProperty(notes="执行编号,主键",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String id; |
|
||||
|
|
||||
|
|
||||
@ApiModelProperty(notes="执行人",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String execUserid; |
|
||||
|
|
||||
@ApiModelProperty(notes="开始时间",allowEmptyValue=true,example="",allowableValues="") |
|
||||
Date startTime; |
|
||||
|
|
||||
@ApiModelProperty(notes="项目编号",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String projectId; |
|
||||
|
|
||||
@ApiModelProperty(notes="项目名称",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String projectName; |
|
||||
|
|
||||
@ApiModelProperty(notes="测试案例编号",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String caseId; |
|
||||
|
|
||||
@ApiModelProperty(notes="测试案例名称",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String caseName; |
|
||||
|
|
||||
@ApiModelProperty(notes="到期时间",allowEmptyValue=true,example="",allowableValues="") |
|
||||
Date endTime; |
|
||||
|
|
||||
@ApiModelProperty(notes="问题描述",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String remark; |
|
||||
|
|
||||
@ApiModelProperty(notes="问题创建人编号",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String createUserid; |
|
||||
|
|
||||
@ApiModelProperty(notes="问题创建人",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String createUsername; |
|
||||
|
|
||||
@ApiModelProperty(notes="创建时间",allowEmptyValue=true,example="",allowableValues="") |
|
||||
Date createTime; |
|
||||
|
|
||||
@ApiModelProperty(notes="0新建1测试中2已完成",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String execStatus; |
|
||||
|
|
||||
@ApiModelProperty(notes="迭代编号",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String iterationId; |
|
||||
|
|
||||
@ApiModelProperty(notes="迭代名称",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String iterationName; |
|
||||
|
|
||||
@ApiModelProperty(notes="执行人姓名",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String execUsername; |
|
||||
|
|
||||
@ApiModelProperty(notes="归属测试任务编号",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String taskId; |
|
||||
|
|
||||
@ApiModelProperty(notes="归属测试任务名称",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String taskName; |
|
||||
|
|
||||
@ApiModelProperty(notes="需求编号",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String menuId; |
|
||||
|
|
||||
@ApiModelProperty(notes="需求名称",allowEmptyValue=true,example="",allowableValues="") |
|
||||
String menuName; |
|
||||
|
|
||||
/**执行编号**/ |
|
||||
public XmTestCaseExec(String id) { |
|
||||
this.id = id; |
|
||||
} |
|
||||
|
|
||||
/**xm_test_case_exec**/ |
|
||||
public XmTestCaseExec() { |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 执行人 |
|
||||
**/ |
|
||||
public void setExecUserid(String execUserid) { |
|
||||
this.execUserid = execUserid; |
|
||||
} |
|
||||
/** |
|
||||
* 开始时间 |
|
||||
**/ |
|
||||
public void setStartTime(Date startTime) { |
|
||||
this.startTime = startTime; |
|
||||
} |
|
||||
/** |
|
||||
* 执行编号 |
|
||||
**/ |
|
||||
public void setId(String id) { |
|
||||
this.id = id; |
|
||||
} |
|
||||
/** |
|
||||
* 项目编号 |
|
||||
**/ |
|
||||
public void setProjectId(String projectId) { |
|
||||
this.projectId = projectId; |
|
||||
} |
|
||||
/** |
|
||||
* 项目名称 |
|
||||
**/ |
|
||||
public void setProjectName(String projectName) { |
|
||||
this.projectName = projectName; |
|
||||
} |
|
||||
/** |
|
||||
* 测试案例编号 |
|
||||
**/ |
|
||||
public void setCaseId(String caseId) { |
|
||||
this.caseId = caseId; |
|
||||
} |
|
||||
/** |
|
||||
* 测试案例名称 |
|
||||
**/ |
|
||||
public void setCaseName(String caseName) { |
|
||||
this.caseName = caseName; |
|
||||
} |
|
||||
/** |
|
||||
* 到期时间 |
|
||||
**/ |
|
||||
public void setEndTime(Date endTime) { |
|
||||
this.endTime = endTime; |
|
||||
} |
|
||||
/** |
|
||||
* 问题描述 |
|
||||
**/ |
|
||||
public void setRemark(String remark) { |
|
||||
this.remark = remark; |
|
||||
} |
|
||||
/** |
|
||||
* 问题创建人编号 |
|
||||
**/ |
|
||||
public void setCreateUserid(String createUserid) { |
|
||||
this.createUserid = createUserid; |
|
||||
} |
|
||||
/** |
|
||||
* 问题创建人 |
|
||||
**/ |
|
||||
public void setCreateUsername(String createUsername) { |
|
||||
this.createUsername = createUsername; |
|
||||
} |
|
||||
/** |
|
||||
* 创建时间 |
|
||||
**/ |
|
||||
public void setCreateTime(Date createTime) { |
|
||||
this.createTime = createTime; |
|
||||
} |
|
||||
/** |
|
||||
* 0新建1测试中2已完成 |
|
||||
**/ |
|
||||
public void setExecStatus(String execStatus) { |
|
||||
this.execStatus = execStatus; |
|
||||
} |
|
||||
/** |
|
||||
* 迭代编号 |
|
||||
**/ |
|
||||
public void setIterationId(String iterationId) { |
|
||||
this.iterationId = iterationId; |
|
||||
} |
|
||||
/** |
|
||||
* 迭代名称 |
|
||||
**/ |
|
||||
public void setIterationName(String iterationName) { |
|
||||
this.iterationName = iterationName; |
|
||||
} |
|
||||
/** |
|
||||
* 执行人姓名 |
|
||||
**/ |
|
||||
public void setExecUsername(String execUsername) { |
|
||||
this.execUsername = execUsername; |
|
||||
} |
|
||||
/** |
|
||||
* 归属测试任务编号 |
|
||||
**/ |
|
||||
public void setTaskId(String taskId) { |
|
||||
this.taskId = taskId; |
|
||||
} |
|
||||
/** |
|
||||
* 归属测试任务名称 |
|
||||
**/ |
|
||||
public void setTaskName(String taskName) { |
|
||||
this.taskName = taskName; |
|
||||
} |
|
||||
/** |
|
||||
* 需求编号 |
|
||||
**/ |
|
||||
public void setMenuId(String menuId) { |
|
||||
this.menuId = menuId; |
|
||||
} |
|
||||
/** |
|
||||
* 需求名称 |
|
||||
**/ |
|
||||
public void setMenuName(String menuName) { |
|
||||
this.menuName = menuName; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 执行人 |
|
||||
**/ |
|
||||
public String getExecUserid() { |
|
||||
return this.execUserid; |
|
||||
} |
|
||||
/** |
|
||||
* 开始时间 |
|
||||
**/ |
|
||||
public Date getStartTime() { |
|
||||
return this.startTime; |
|
||||
} |
|
||||
/** |
|
||||
* 执行编号 |
|
||||
**/ |
|
||||
public String getId() { |
|
||||
return this.id; |
|
||||
} |
|
||||
/** |
|
||||
* 项目编号 |
|
||||
**/ |
|
||||
public String getProjectId() { |
|
||||
return this.projectId; |
|
||||
} |
|
||||
/** |
|
||||
* 项目名称 |
|
||||
**/ |
|
||||
public String getProjectName() { |
|
||||
return this.projectName; |
|
||||
} |
|
||||
/** |
|
||||
* 测试案例编号 |
|
||||
**/ |
|
||||
public String getCaseId() { |
|
||||
return this.caseId; |
|
||||
} |
|
||||
/** |
|
||||
* 测试案例名称 |
|
||||
**/ |
|
||||
public String getCaseName() { |
|
||||
return this.caseName; |
|
||||
} |
|
||||
/** |
|
||||
* 到期时间 |
|
||||
**/ |
|
||||
public Date getEndTime() { |
|
||||
return this.endTime; |
|
||||
} |
|
||||
/** |
|
||||
* 问题描述 |
|
||||
**/ |
|
||||
public String getRemark() { |
|
||||
return this.remark; |
|
||||
} |
|
||||
/** |
|
||||
* 问题创建人编号 |
|
||||
**/ |
|
||||
public String getCreateUserid() { |
|
||||
return this.createUserid; |
|
||||
} |
|
||||
/** |
|
||||
* 问题创建人 |
|
||||
**/ |
|
||||
public String getCreateUsername() { |
|
||||
return this.createUsername; |
|
||||
} |
|
||||
/** |
|
||||
* 创建时间 |
|
||||
**/ |
|
||||
public Date getCreateTime() { |
|
||||
return this.createTime; |
|
||||
} |
|
||||
/** |
|
||||
* 0新建1测试中2已完成 |
|
||||
**/ |
|
||||
public String getExecStatus() { |
|
||||
return this.execStatus; |
|
||||
} |
|
||||
/** |
|
||||
* 迭代编号 |
|
||||
**/ |
|
||||
public String getIterationId() { |
|
||||
return this.iterationId; |
|
||||
} |
|
||||
/** |
|
||||
* 迭代名称 |
|
||||
**/ |
|
||||
public String getIterationName() { |
|
||||
return this.iterationName; |
|
||||
} |
|
||||
/** |
|
||||
* 执行人姓名 |
|
||||
**/ |
|
||||
public String getExecUsername() { |
|
||||
return this.execUsername; |
|
||||
} |
|
||||
/** |
|
||||
* 归属测试任务编号 |
|
||||
**/ |
|
||||
public String getTaskId() { |
|
||||
return this.taskId; |
|
||||
} |
|
||||
/** |
|
||||
* 归属测试任务名称 |
|
||||
**/ |
|
||||
public String getTaskName() { |
|
||||
return this.taskName; |
|
||||
} |
|
||||
/** |
|
||||
* 需求编号 |
|
||||
**/ |
|
||||
public String getMenuId() { |
|
||||
return this.menuId; |
|
||||
} |
|
||||
/** |
|
||||
* 需求名称 |
|
||||
**/ |
|
||||
public String getMenuName() { |
|
||||
return this.menuName; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
@ -1,29 +0,0 @@ |
|||||
package com.xm.core.service; |
|
||||
|
|
||||
import com.mdp.core.service.BaseService; |
|
||||
import com.xm.core.entity.XmTestCaseExec; |
|
||||
import org.springframework.stereotype.Service; |
|
||||
|
|
||||
import java.util.HashMap; |
|
||||
import java.util.List; |
|
||||
import java.util.Map; |
|
||||
/** |
|
||||
* 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br> |
|
||||
* 组织 com.qqkj 顶级模块 xm 大模块 core 小模块 <br> |
|
||||
* 实体 XmTestCaseExec 表 XM.xm_test_case_exec 当前主键(包括多主键): id; |
|
||||
***/ |
|
||||
@Service("xm.core.xmTestCaseExecService") |
|
||||
public class XmTestCaseExecService extends BaseService { |
|
||||
|
|
||||
public List<XmTestCaseExec> listByProjectAndCaseIds(String projectId, List<String> caseIds) { |
|
||||
// TODO Auto-generated method stub |
|
||||
Map<String,Object> p=new HashMap<>(); |
|
||||
p.put("projectId", projectId); |
|
||||
p.put("caseIds", caseIds.toArray()); |
|
||||
return this.selectList("listByProjectAndCaseIds", p); |
|
||||
} |
|
||||
|
|
||||
/** 请在此类添加自定义函数 */ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
@ -1,241 +0,0 @@ |
|||||
<?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="com.xm.core.entity.XmTestCaseExec"> |
|
||||
|
|
||||
|
|
||||
<!--开始 自定sql函数区域 --> |
|
||||
<!--请在此区域添加自定义函数--> |
|
||||
|
|
||||
<select id="listByProjectAndCaseIds" parameterType="HashMap" resultType="com.xm.core.entity.XmTestCaseExec"> |
|
||||
select * from xm_test_case_exec res |
|
||||
<where> |
|
||||
and res.project_id=#{projectId} |
|
||||
<if test="caseIds != null"> and |
|
||||
case_id in |
|
||||
<foreach collection="caseIds" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item} |
|
||||
</foreach> |
|
||||
</if> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!--结束 自定义sql函数区域--> |
|
||||
|
|
||||
|
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
||||
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
||||
select res.*,c.* from xm_test_case_exec res left join xm_test_case c on res.case_id=c.id |
|
||||
<where> |
|
||||
<if test="ids != null"> and |
|
||||
id in |
|
||||
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item} |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<if test="projectId!=null and projectId!=''"> and res.project_id = #{projectId}</if> |
|
||||
<if test=" createTimeStart !=null "> and res.create_time > #{createTimeStart} </if> |
|
||||
<if test=" createTimeEnd !=null "> and res.create_time < #{createTimeEnd} </if> |
|
||||
<include refid="where"/> |
|
||||
<if test="menuIds != null"> and |
|
||||
res.menu_id in |
|
||||
<foreach collection="menuIds" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item} |
|
||||
</foreach> |
|
||||
</if> |
|
||||
<if test="compete !=null and compete!=''"> |
|
||||
and exists ( select 1 from xm_group_user gu where gu.userid=#{compete} and gu.project_id=res.project_id ) |
|
||||
</if> |
|
||||
<if test="productId != null and productId !='' "> and exists( select 1 from xm_menu m where m.menu_id =res.menu_id and m.product_id=#{productId}) </if> |
|
||||
<if test="key != null and key !='' "> and res.case_name like #{key} </if> |
|
||||
|
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过条件查询获取数据列表 不分页 返回 list<Object> --> |
|
||||
<select id="selectListByWhere" parameterType="com.xm.core.entity.XmTestCaseExec" resultType="com.xm.core.entity.XmTestCaseExec"> |
|
||||
select * from xm_test_case_exec res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过主键查询获取数据对象 返回object --> |
|
||||
<select id="selectOneObject" parameterType="com.xm.core.entity.XmTestCaseExec" resultType="com.xm.core.entity.XmTestCaseExec"> |
|
||||
select * from xm_test_case_exec res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
|
|
||||
<!-- 通过主键查询获取数据对象 返回map--> |
|
||||
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|
||||
select * from xm_test_case_exec res |
|
||||
where |
|
||||
res.id = #{id} |
|
||||
</select> |
|
||||
<!-- 获取数据条目 返回long --> |
|
||||
<select id="countByWhere" parameterType="com.xm.core.entity.XmTestCaseExec" resultType="long"> |
|
||||
select count(1) from xm_test_case_exec res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</select> |
|
||||
<!-- 新增一条记录 主键id,--> |
|
||||
<insert id="insert" parameterType="com.xm.core.entity.XmTestCaseExec" useGeneratedKeys="false" keyProperty="id"> |
|
||||
insert into xm_test_case_exec( |
|
||||
<include refid="columns"/> |
|
||||
) values ( |
|
||||
#{execUserid},#{startTime},#{id},#{projectId},#{projectName},#{caseId},#{caseName},#{endTime},#{remark},#{createUserid},#{createUsername},#{createTime},#{execStatus},#{iterationId},#{iterationName},#{execUsername},#{taskId},#{taskName},#{menuId},#{menuName} |
|
||||
) |
|
||||
</insert> |
|
||||
|
|
||||
<!-- 按条件删除若干条记录--> |
|
||||
<delete id="deleteByWhere" parameterType="com.xm.core.entity.XmTestCaseExec"> |
|
||||
delete from xm_test_case_exec res |
|
||||
<where> |
|
||||
<include refid="where"/> |
|
||||
</where> |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 按主键删除一条记录--> |
|
||||
<delete id="deleteByPk" parameterType="com.xm.core.entity.XmTestCaseExec"> |
|
||||
delete from xm_test_case_exec |
|
||||
where id = #{id} |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 根据条件修改若干条记录 --> |
|
||||
<update id="updateSomeFieldByPk" parameterType="com.xm.core.entity.XmTestCaseExec"> |
|
||||
update xm_test_case_exec |
|
||||
<set> |
|
||||
<include refid="someFieldSet"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 根据主键修改一条记录 --> |
|
||||
<update id="updateByPk" parameterType="com.xm.core.entity.XmTestCaseExec"> |
|
||||
update xm_test_case_exec |
|
||||
<set> |
|
||||
<include refid="set"/> |
|
||||
</set> |
|
||||
where id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量新增 批量插入 借用insert 循环插入实现 |
|
||||
<insert id="batchInsert" parameterType="List"> |
|
||||
</insert> |
|
||||
--> |
|
||||
|
|
||||
<!-- 批量更新 --> |
|
||||
<update id="batchUpdate" parameterType="List"> |
|
||||
<foreach collection="list" item="item" index="index" separator=";" > |
|
||||
update xm_test_case_exec |
|
||||
set |
|
||||
<include refid="batchSet"/> |
|
||||
where id = #{item.id} |
|
||||
</foreach> |
|
||||
</update> |
|
||||
<!-- 批量删除 --> |
|
||||
<delete id="batchDelete" parameterType="List"> |
|
||||
delete from xm_test_case_exec |
|
||||
where id in |
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
||||
#{item.id } |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
|
|
||||
|
|
||||
<!--sql片段 列--> |
|
||||
<sql id="columns"> |
|
||||
exec_userid,start_time,id,project_id,project_name,case_id,case_name,end_time,remark,create_userid,create_username,create_time,exec_status,iteration_id,iteration_name,exec_username,task_id,task_name,menu_id,menu_name |
|
||||
</sql> |
|
||||
|
|
||||
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
||||
<sql id="where"> |
|
||||
<if test="execUserid != null and execUserid != ''"> and res.exec_userid = #{execUserid} </if> |
|
||||
<if test="startTime != null"> and TO_CHAR(res.start_time,'YYYY-MM-DD') = TO_CHAR(#{startTime},'YYYY-MM-DD') </if> |
|
||||
<if test="id != null and id != ''"> and res.id = #{id} </if> |
|
||||
<if test="projectId != null and projectId != ''"> and res.project_id = #{projectId} </if> |
|
||||
<if test="projectName != null and projectName != ''"> and res.project_name = #{projectName} </if> |
|
||||
<if test="caseId != null and caseId != ''"> and res.case_id = #{caseId} </if> |
|
||||
<if test="caseName != null and caseName != ''"> and res.case_name = #{caseName} </if> |
|
||||
<if test="endTime != null"> and TO_CHAR(res.end_time,'YYYY-MM-DD') = TO_CHAR(#{endTime},'YYYY-MM-DD') </if> |
|
||||
<if test="remark != null and remark != ''"> and res.remark = #{remark} </if> |
|
||||
<if test="createUserid != null and createUserid != ''"> and res.create_userid = #{createUserid} </if> |
|
||||
<if test="createUsername != null and createUsername != ''"> and res.create_username = #{createUsername} </if> |
|
||||
<if test="createTime != null"> and TO_CHAR(res.create_time,'YYYY-MM-DD') = TO_CHAR(#{createTime},'YYYY-MM-DD') </if> |
|
||||
<if test="execStatus != null and execStatus != ''"> and res.exec_status = #{execStatus} </if> |
|
||||
<if test="iterationId != null and iterationId != ''"> and res.iteration_id = #{iterationId} </if> |
|
||||
<if test="iterationName != null and iterationName != ''"> and res.iteration_name = #{iterationName} </if> |
|
||||
<if test="execUsername != null and execUsername != ''"> and res.exec_username = #{execUsername} </if> |
|
||||
<if test="taskId != null and taskId != ''"> and res.task_id = #{taskId} </if> |
|
||||
<if test="taskName != null and taskName != ''"> and res.task_name = #{taskName} </if> |
|
||||
<if test="menuId != null and menuId != ''"> and res.menu_id = #{menuId} </if> |
|
||||
<if test="menuName != null and menuName != ''"> and res.menu_name = #{menuName} </if> |
|
||||
</sql> |
|
||||
<!--sql片段 更新字段 --> |
|
||||
<sql id="set"> |
|
||||
exec_userid = #{execUserid}, |
|
||||
start_time = #{startTime}, |
|
||||
project_id = #{projectId}, |
|
||||
project_name = #{projectName}, |
|
||||
case_id = #{caseId}, |
|
||||
case_name = #{caseName}, |
|
||||
end_time = #{endTime}, |
|
||||
remark = #{remark}, |
|
||||
create_userid = #{createUserid}, |
|
||||
create_username = #{createUsername}, |
|
||||
create_time = #{createTime}, |
|
||||
exec_status = #{execStatus}, |
|
||||
iteration_id = #{iterationId}, |
|
||||
iteration_name = #{iterationName}, |
|
||||
exec_username = #{execUsername}, |
|
||||
task_id = #{taskId}, |
|
||||
task_name = #{taskName}, |
|
||||
menu_id = #{menuId}, |
|
||||
menu_name = #{menuName} |
|
||||
</sql> |
|
||||
<sql id="someFieldSet"> |
|
||||
<if test="execUserid != null and execUserid != ''"> exec_userid = #{execUserid}, </if> |
|
||||
<if test="startTime != null"> start_time = #{startTime}, </if> |
|
||||
<if test="projectId != null and projectId != ''"> project_id = #{projectId}, </if> |
|
||||
<if test="projectName != null and projectName != ''"> project_name = #{projectName}, </if> |
|
||||
<if test="caseId != null and caseId != ''"> case_id = #{caseId}, </if> |
|
||||
<if test="caseName != null and caseName != ''"> case_name = #{caseName}, </if> |
|
||||
<if test="endTime != null"> end_time = #{endTime}, </if> |
|
||||
<if test="remark != null and remark != ''"> remark = #{remark}, </if> |
|
||||
<if test="createUserid != null and createUserid != ''"> create_userid = #{createUserid}, </if> |
|
||||
<if test="createUsername != null and createUsername != ''"> create_username = #{createUsername}, </if> |
|
||||
<if test="createTime != null"> create_time = #{createTime}, </if> |
|
||||
<if test="execStatus != null and execStatus != ''"> exec_status = #{execStatus}, </if> |
|
||||
<if test="iterationId != null and iterationId != ''"> iteration_id = #{iterationId}, </if> |
|
||||
<if test="iterationName != null and iterationName != ''"> iteration_name = #{iterationName}, </if> |
|
||||
<if test="execUsername != null and execUsername != ''"> exec_username = #{execUsername}, </if> |
|
||||
<if test="taskId != null and taskId != ''"> task_id = #{taskId}, </if> |
|
||||
<if test="taskName != null and taskName != ''"> task_name = #{taskName}, </if> |
|
||||
<if test="menuId != null and menuId != ''"> menu_id = #{menuId}, </if> |
|
||||
<if test="menuName != null and menuName != ''"> menu_name = #{menuName}, </if> |
|
||||
</sql> |
|
||||
<!--sql片段 批量更新 --> |
|
||||
<sql id="batchSet"> |
|
||||
exec_userid = #{item.execUserid}, |
|
||||
start_time = #{item.startTime}, |
|
||||
project_id = #{item.projectId}, |
|
||||
project_name = #{item.projectName}, |
|
||||
case_id = #{item.caseId}, |
|
||||
case_name = #{item.caseName}, |
|
||||
end_time = #{item.endTime}, |
|
||||
remark = #{item.remark}, |
|
||||
create_userid = #{item.createUserid}, |
|
||||
create_username = #{item.createUsername}, |
|
||||
create_time = #{item.createTime}, |
|
||||
exec_status = #{item.execStatus}, |
|
||||
iteration_id = #{item.iterationId}, |
|
||||
iteration_name = #{item.iterationName}, |
|
||||
exec_username = #{item.execUsername}, |
|
||||
task_id = #{item.taskId}, |
|
||||
task_name = #{item.taskName}, |
|
||||
menu_id = #{item.menuId}, |
|
||||
menu_name = #{item.menuName} |
|
||||
</sql> |
|
||||
</mapper> |
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue