Browse Source

rptConfig

master
陈裕财 3 years ago
parent
commit
196e4b0165
  1. 59
      xm-core/src/main/java/com/xm/core/ctrl/XmTestPlanCaseController.java
  2. 10
      xm-core/src/main/java/com/xm/core/service/XmTestPlanCaseService.java
  3. 11
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestPlanCaseMapper.xml

59
xm-core/src/main/java/com/xm/core/ctrl/XmTestPlanCaseController.java

@ -81,9 +81,60 @@ public class XmTestPlanCaseController {
m.put("tips", tips); m.put("tips", tips);
return m; return m;
} }
@ApiOperation( value = "查询执行结果分布",notes=" ")
@ApiEntityParams( XmTestPlanCase.class )
@ApiImplicitParams({
@ApiImplicitParam(name="pageSize",value="每页大小,默认20条",required=false),
@ApiImplicitParam(name="pageNum",value="当前页码,从1开始",required=false),
@ApiImplicitParam(name="total",value="总记录数,服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算",required=false),
@ApiImplicitParam(name="count",value="是否计算总记录条数,如果count=true,则计算计算总条数,如果count=false 则不计算",required=false),
@ApiImplicitParam(name="orderBy",value="排序列 如性别、学生编号排序 orderBy = sex desc,student desc",required=false),
})
@ApiResponses({
@ApiResponse(code = 200,response=XmTestPlanCase.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'错误码'},total:总记录数,data:[数据对象1,数据对象2,...]}")
})
@RequestMapping(value="/getXmTestPlanCaseExecStatusDist",method=RequestMethod.GET)
public Map<String,Object> getXmTestPlanCaseExecStatusDist( @ApiIgnore @RequestParam Map<String,Object> xmTestPlanCase){
Map<String,Object> m = new HashMap<>();
Tips tips=new Tips("查询成功");
PageUtils.startPage(xmTestPlanCase);
List<Map<String,Object>> xmTestPlanCaseList = xmTestPlanCaseService.getXmTestPlanCaseExecStatusDist(xmTestPlanCase); //列出XmTestPlanCase列表
PageUtils.responePage(m, xmTestPlanCaseList);
m.put("data",xmTestPlanCaseList);
m.put("tips", tips);
return m;
}
@ApiOperation( value = "查询成员执行结果分布",notes=" ")
@ApiEntityParams( XmTestPlanCase.class )
@ApiImplicitParams({
@ApiImplicitParam(name="pageSize",value="每页大小,默认20条",required=false),
@ApiImplicitParam(name="pageNum",value="当前页码,从1开始",required=false),
@ApiImplicitParam(name="total",value="总记录数,服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算",required=false),
@ApiImplicitParam(name="count",value="是否计算总记录条数,如果count=true,则计算计算总条数,如果count=false 则不计算",required=false),
@ApiImplicitParam(name="orderBy",value="排序列 如性别、学生编号排序 orderBy = sex desc,student desc",required=false),
})
@ApiResponses({
@ApiResponse(code = 200,response=XmTestPlanCase.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'错误码'},total:总记录数,data:[数据对象1,数据对象2,...]}")
})
@RequestMapping(value="/getXmTestPlanCaseUserDist",method=RequestMethod.GET)
public Map<String,Object> getXmTestPlanCaseUserDist( @ApiIgnore @RequestParam Map<String,Object> xmTestPlanCase){
Map<String,Object> m = new HashMap<>();
Tips tips=new Tips("查询成功");
PageUtils.startPage(xmTestPlanCase);
List<Map<String,Object>> xmTestPlanCaseList = xmTestPlanCaseService.getXmTestPlanCaseUserDist(xmTestPlanCase); //列出XmTestPlanCase列表
PageUtils.responePage(m, xmTestPlanCaseList);
m.put("data",xmTestPlanCaseList);
m.put("tips", tips);
return m;
}
@ApiOperation( value = "新增一条测试计划与用例关系表信息",notes=" ") @ApiOperation( value = "新增一条测试计划与用例关系表信息",notes=" ")
@ApiResponses({ @ApiResponses({
@ -121,6 +172,8 @@ public class XmTestPlanCaseController {
return m; return m;
} }
@ApiOperation( value = "从用例库导入用例列表到测试计划中",notes=" ") @ApiOperation( value = "从用例库导入用例列表到测试计划中",notes=" ")
@ApiResponses({ @ApiResponses({
@ApiResponse(code = 200,response=XmTestPlanCase.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") @ApiResponse(code = 200,response=XmTestPlanCase.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}")

10
xm-core/src/main/java/com/xm/core/service/XmTestPlanCaseService.java

@ -7,6 +7,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br> * 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.<br>
* 组织 com 顶级模块 xm 大模块 core 小模块 <br> * 组织 com 顶级模块 xm 大模块 core 小模块 <br>
@ -19,5 +21,13 @@ public class XmTestPlanCaseService extends BaseService {
public List<XmTestPlanCase> selectListByCaseIdsAndPlanId(String planId, List<String> caseIds) { public List<XmTestPlanCase> selectListByCaseIdsAndPlanId(String planId, List<String> caseIds) {
return super.selectList("selectListByCaseIdsAndPlanId",map("planId",planId,"caseIds",caseIds)); return super.selectList("selectListByCaseIdsAndPlanId",map("planId",planId,"caseIds",caseIds));
} }
public List<Map<String, Object>> getXmTestPlanCaseExecStatusDist(Map<String, Object> xmTestPlanCase) {
return super.selectList("getXmTestPlanCaseExecStatusDist",xmTestPlanCase);
}
public List<Map<String, Object>> getXmTestPlanCaseUserDist(Map<String, Object> xmTestPlanCase) {
return super.selectList("getXmTestPlanCaseUserDist",xmTestPlanCase);
}
} }

11
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestPlanCaseMapper.xml

@ -22,6 +22,17 @@
</select> </select>
<select id="getXmTestPlanCaseExecStatusDist" parameterType="HashMap" resultType="HashMap">
select count(*) as total_cnt,res.exec_status from xm_test_plan_case res where res.plan_id=#{planId}
group by res.exec_status
</select>
<select id="getXmTestPlanCaseUserDist" parameterType="HashMap" resultType="HashMap">
select count(*) as total_cnt,sum(case when res.exec_status>='1' then 1 else 0 end) as had_exec,sum(case when res.exec_status='0' then 1 else 0 end) as not_exec from xm_test_plan_case res where res.plan_id=#{planId}
group by res.exec_userid
</select>
<!--结束 自定义sql函数区域--> <!--结束 自定义sql函数区域-->

Loading…
Cancel
Save