Browse Source

缺陷回归分布

master
陈裕财 3 years ago
parent
commit
b80a258cd9
  1. 97
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestPlanCaseMapper.xml

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

@ -6,33 +6,6 @@
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 -->
<sql id="whereForMap">
<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>
</sql>
<select id="selectListByCaseIdsAndPlanId" parameterType="HashMap" resultType="com.xm.core.entity.XmTestPlanCase">
select * from xm_test_plan_case res where res.plan_id=#{planId} and res.case_id in
<foreach collection="caseIds" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</select>
<select id="getXmTestPlanCaseExecStatusDist" parameterType="HashMap" resultType="HashMap">
select count(*) as total_cnt,res.exec_status from xm_test_plan_case res left join xm_test_plan p on res.plan_id=p.id
<where>
<if test="planId!=null and planId!=''">
and res.plan_id=#{planId}
</if>
@ -45,38 +18,8 @@
<if test="productId!=null and productId!=''">
and p.product_id=#{productId}
</if>
</where>
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
,res.exec_userid,max(res.exec_username) as exec_username
from xm_test_plan_case res left join xm_test_plan p on res.plan_id=p.id
<where>
<if test="planId!=null and planId!=''">
and res.plan_id=#{planId}
</if>
<if test="casedbId!=null and casedbId!=''">
and p.casedb_id=#{casedbId}
</if>
<if test="projectId!=null and projectId!=''">
and p.project_id=#{projectId}
</if>
<if test="productId!=null and productId!=''">
and p.product_id=#{productId}
</if>
</where>
group by res.exec_userid
</select>
<select id="getXmTestDayTimesList" parameterType="HashMap" resultType="HashMap">
select res.exec_date, sum(case when res.exec_status>='1' then 1 else 0 end) as had_exec
from xm_test_plan_case res inner join xm_test_plan p on res.plan_id=p.id
<where>
</sql>
<sql id="whereForRpt">
<if test="planId!=null and planId!=''">
and res.plan_id=#{planId}
</if>
@ -103,6 +46,42 @@
</if>
)
</if>
</sql>
<select id="selectListByCaseIdsAndPlanId" parameterType="HashMap" resultType="com.xm.core.entity.XmTestPlanCase">
select * from xm_test_plan_case res where res.plan_id=#{planId} and res.case_id in
<foreach collection="caseIds" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</select>
<select id="getXmTestPlanCaseExecStatusDist" parameterType="HashMap" resultType="HashMap">
select count(*) as total_cnt,res.exec_status from xm_test_plan_case res left join xm_test_plan p on res.plan_id=p.id
<where>
<include refid="whereForRpt"/>
</where>
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
,res.exec_userid,max(res.exec_username) as exec_username
from xm_test_plan_case res left join xm_test_plan p on res.plan_id=p.id
<where>
<include refid="whereForRpt"/>
</where>
group by res.exec_userid
</select>
<select id="getXmTestDayTimesList" parameterType="HashMap" resultType="HashMap">
select res.exec_date, sum(case when res.exec_status>='1' then 1 else 0 end) as had_exec
from xm_test_plan_case res inner join xm_test_plan p on res.plan_id=p.id
<where>
<include refid="whereForRpt"/>
</where>
group by res.exec_date
order by res.exec_date asc

Loading…
Cancel
Save