Browse Source

缺陷回归分布

master
陈裕财 3 years ago
parent
commit
3313de1412
  1. 15
      xm-core/src/main/java/com/xm/core/ctrl/XmTestPlanCaseController.java
  2. 5
      xm-core/src/main/java/com/xm/core/service/XmTestPlanCaseService.java
  3. 40
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestPlanCaseMapper.xml

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

@ -139,7 +139,22 @@ public class XmTestPlanCaseController {
m.put("tips", tips);
return m;
}
@ApiOperation( value = "查询测试用例规划到测试计划的数目",notes=" ")
@ApiResponses({
@ApiResponse(code = 200,response=XmTestPlanCase.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'错误码'},total:总记录数,data:[数据对象1,数据对象2,...]}")
})
@RequestMapping(value="/getXmTestCaseToPlanCalcList",method=RequestMethod.GET)
public Map<String,Object> getXmTestCaseToPlanCalcList( @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.getXmTestCaseToPlanCalcList(xmTestPlanCase); //列出XmTestPlanCase列表
PageUtils.responePage(m, xmTestPlanCaseList);
m.put("data",xmTestPlanCaseList);
m.put("tips", tips);
return m;
}
@ApiOperation( value = "新增一条测试计划与用例关系表信息",notes=" ")
@ApiResponses({

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

@ -34,5 +34,10 @@ public class XmTestPlanCaseService extends BaseService {
return super.selectList("getXmTestDayTimesList",xmTestPlanCase);
}
public List<Map<String, Object>> getXmTestCaseToPlanCalcList(Map<String, Object> xmTestPlanCase) {
return super.selectList("getXmTestCaseToPlanCalcList",xmTestPlanCase);
}
}

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

@ -6,17 +6,27 @@
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 -->
<sql id="whereForMap">
<if test="planId!=null and planId!=''">
and res.plan_id=#{planId}
<if test=" pkList != null"> and (res.case_id, res.plan_id) in
<foreach collection="pkList" item="item" index="index" open="(" separator="," close=")" >
( #{item.caseId}, #{item.planId})
</foreach>
</if>
<if test="key != null and key !='' "> and c.case_name like concat('%',#{key},'%') </if>
<if test="funcPidPathsLike!=null and funcPidPathsLike!=''">
and exists( select 1 from xm_func f where f.pid_paths like concat(#{funcPidPathsLike},'%') and c.func_id=f.id)
</if>
<if test="productId!=null and productId!=''">
and c.product_id=#{productId}
</if>
<if test="casedbId!=null and casedbId!=''">
and p.casedb_id=#{casedbId}
and c.casedb_id=#{casedbId}
</if>
<if test="projectId!=null and projectId!=''">
and p.project_id=#{projectId}
<if test="linkIterationId!=null">
and c.iteration_id=#{linkIterationId}
</if>
<if test="productId!=null and productId!=''">
and p.product_id=#{productId}
<if test="pbranchId!=null and pbranchId!=''">
and c.pbranch_id=#{pbranchId}
</if>
</sql>
<sql id="whereForRpt">
@ -87,6 +97,22 @@
order by res.exec_date asc
</select>
<select id="getXmTestCaseToPlanCalcList" parameterType="HashMap" resultType="HashMap">
select count(*) as case_num,use_times from
(
SELECT count(*) as use_times,res.id FROM xm_test_case c inner join xm_test_plan_case res
on res.id=pc.case_id
<where>
<include refid="whereForMap"/>
<include refid="where"/>
</where>
group by res.id ) as ret
group by ret.use_times
order by use_times desc
</select>
<!--结束 自定义sql函数区域-->

Loading…
Cancel
Save