Browse Source

测试用例、测试执行增加按故事列表查询、按产品查询、按项目查询条件

master
陈裕财 5 years ago
parent
commit
c7061914b9
  1. 8
      xm-core/src/main/java/com/xm/core/ctrl/XmTestCaseController.java
  2. 3
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestCaseExecMapper.xml
  3. 6
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestCaseMapper.xml

8
xm-core/src/main/java/com/xm/core/ctrl/XmTestCaseController.java

@ -5,6 +5,7 @@ import com.mdp.core.err.BizException;
import com.mdp.core.utils.RequestUtils; import com.mdp.core.utils.RequestUtils;
import com.mdp.mybatis.PageUtils; import com.mdp.mybatis.PageUtils;
import com.mdp.qx.HasQx; import com.mdp.qx.HasQx;
import com.mdp.safe.client.utils.LoginUtils;
import com.xm.core.entity.XmTestCase; import com.xm.core.entity.XmTestCase;
import com.xm.core.service.XmTestCaseService; import com.xm.core.service.XmTestCaseService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
@ -80,10 +81,9 @@ public class XmTestCaseController {
Object ids= xmTestCase.get("ids"); Object ids= xmTestCase.get("ids");
Object menuIds= xmTestCase.get("menuIds"); Object menuIds= xmTestCase.get("menuIds");
String productId= (String) xmTestCase.get("productId"); String productId= (String) xmTestCase.get("productId");
if( !( StringUtils.hasText(id) || StringUtils.hasText(menuId) || StringUtils.hasText(productId)||menuIds!=null||ids!=null ) ){
tips.setFailureMsg("产品编号productId或者故事编号列表menuIds或者故事编号menuId必传");
m.put("tips", tips);
return m;
String projectId= (String) xmTestCase.get("projectId");
if( !( StringUtils.hasText(id) || StringUtils.hasText(menuId) || StringUtils.hasText(productId)|| StringUtils.hasText(projectId)||menuIds!=null||ids!=null ) ){
xmTestCase.put("compete", LoginUtils.getCurrentUserInfo().getUserid());
} }
List<Map<String,Object>> xmTestCaseList = xmTestCaseService.selectListMapByWhere(xmTestCase); //列出XmTestCase列表 List<Map<String,Object>> xmTestCaseList = xmTestCaseService.selectListMapByWhere(xmTestCase); //列出XmTestCase列表
PageUtils.responePage(m, xmTestCaseList); PageUtils.responePage(m, xmTestCaseList);

3
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestCaseExecMapper.xml

@ -33,6 +33,9 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="projectId!=null and projectId!=''"> and res.project_id = #{projectId}</if>
<if test=" createTimeStart !=null "> and res.create_time &gt; #{createTimeStart} </if>
<if test=" createTimeEnd !=null "> and res.create_time &lt; #{createTimeEnd} </if>
<include refid="where"/> <include refid="where"/>
<if test="menuIds != null"> and <if test="menuIds != null"> and
res.menu_id in res.menu_id in

6
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestCaseMapper.xml

@ -22,14 +22,18 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<include refid="where"/>
<if test=" ctimeStart !=null "> and res.ctime &gt; #{ctimeStart} </if>
<if test=" ctimeTimeEnd !=null "> and res.ctime &lt; #{ctimeTimeEnd} </if>
<include refid="where"/>
<if test=" compete!=null and compete!='' "> and (res.luserid=#{compete} or res.cuserid=#{compete})</if>
<if test="menuIds != null"> and <if test="menuIds != null"> and
res.menu_id in res.menu_id in
<foreach collection="menuIds" item="item" index="index" open="(" separator="," close=")" > <foreach collection="menuIds" item="item" index="index" open="(" separator="," close=")" >
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="projectId !=null and projectId !=''"> and exists ( select 1 from xm.xm_test_case_exec c where c.case_id=res.id and c.project_id=#{projectId} )</if>
<if test="productId != null and productId !='' "> and exists( select 1 from xm.xm_menu m where m.menu_id =res.menu_id and m.product_id=#{productId}) </if> <if test="productId != null and productId !='' "> and exists( select 1 from xm.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> <if test="key != null and key !='' "> and res.case_name like #{key} </if>
</where> </where>

Loading…
Cancel
Save