fix(工作台): 修复工作台中我的待办查到了已完成的功能用例的问题

--bug=1025573 --user=宋天阳 【我的工作台】我的待办-功能用例数统计错误-用例状态是已完成,仍统计在我的待办中。
https://www.tapd.cn/55049933/s/1364029
This commit is contained in:
song-tianyang 2023-04-18 19:38:19 +08:00 committed by xiaomeinvG
parent 9bc3ddd6a8
commit c63d9ac722
1 changed files with 33 additions and 31 deletions

View File

@ -115,30 +115,30 @@
<if test="${condition}.customs != null and ${condition}.customs.size() > 0"> <if test="${condition}.customs != null and ${condition}.customs.size() > 0">
<foreach collection="${condition}.customs" item="custom" separator="" open="" close=""> <foreach collection="${condition}.customs" item="custom" separator="" open="" close="">
and test_case.id ${custom.operator} ( and test_case.id ${custom.operator} (
select resource_id from custom_field_test_case where field_id = #{custom.id} select resource_id from custom_field_test_case where field_id = #{custom.id}
<choose> <choose>
<when test="custom.type == 'multipleMember' or custom.type == 'checkbox' or custom.type == 'multipleSelect'"> <when test="custom.type == 'multipleMember' or custom.type == 'checkbox' or custom.type == 'multipleSelect'">
and ${custom.value} and ${custom.value}
</when> </when>
<when test="custom.type == 'date' or custom.type == 'datetime'"> <when test="custom.type == 'date' or custom.type == 'datetime'">
and left(replace(unix_timestamp(trim(both '"' from `value`)), '.', ''), 13) and left(replace(unix_timestamp(trim(both '"' from `value`)), '.', ''), 13)
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.condition"> <include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.condition">
<property name="object" value="custom"/> <property name="object" value="custom"/>
</include> </include>
</when> </when>
<when test="custom.type == 'richText' or custom.type == 'textarea'"> <when test="custom.type == 'richText' or custom.type == 'textarea'">
and text_value and text_value
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.condition"> <include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.condition">
<property name="object" value="custom"/> <property name="object" value="custom"/>
</include> </include>
</when> </when>
<otherwise> <otherwise>
and trim(both '"' from value) and trim(both '"' from value)
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.condition"> <include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.condition">
<property name="object" value="custom"/> <property name="object" value="custom"/>
</include> </include>
</otherwise> </otherwise>
</choose> </choose>
) )
</foreach> </foreach>
</if> </if>
@ -188,9 +188,9 @@
</select> </select>
<select id="getCountFollow" resultType="java.lang.Integer"> <select id="getCountFollow" resultType="java.lang.Integer">
select count(*) from test_case tc where select count(*) from test_case tc where
tc.id in (select tf.case_id from test_case_follow tf where tf.follow_id = #{userId,jdbcType=VARCHAR}) tc.id in (select tf.case_id from test_case_follow tf where tf.follow_id = #{userId,jdbcType=VARCHAR})
and and
tc.project_id in tc.project_id in
<foreach collection="projectIds" item="projectId" separator="," open="(" close=")"> <foreach collection="projectIds" item="projectId" separator="," open="(" close=")">
#{projectId} #{projectId}
</foreach> </foreach>
@ -198,13 +198,13 @@
</select> </select>
<select id="getCountUpcoming" resultType="java.lang.Integer"> <select id="getCountUpcoming" resultType="java.lang.Integer">
select count(*) from test_case tc where select count(*) from test_case tc where
tc.project_id in tc.project_id in
<foreach collection="projectIds" item="projectId" separator="," open="(" close=")"> <foreach collection="projectIds" item="projectId" separator="," open="(" close=")">
#{projectId} #{projectId}
</foreach> </foreach>
and tc.review_status in ('Prepare','Pass','UnPass') and tc.review_status in ('Prepare','Pass','UnPass')
and tc.create_user = #{userId,jdbcType=VARCHAR} and tc.create_user = #{userId,jdbcType=VARCHAR}
and (tc.status is null or tc.status != 'Trash'); and (tc.status is null or tc.status Not IN ('Trash','Completed'));
</select> </select>
<sql id="queryPublicCaseWhere"> <sql id="queryPublicCaseWhere">
@ -303,14 +303,16 @@
</when> </when>
<when test="key.startsWith('custom_single')"> <when test="key.startsWith('custom_single')">
and test_case.id in ( and test_case.id in (
select resource_id from custom_field_test_case where concat('custom_single-',field_id) = #{key} select resource_id from custom_field_test_case where concat('custom_single-',field_id) =
#{key}
and trim(both '"' from value) in and trim(both '"' from value) in
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.filterInWrapper"/> <include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.filterInWrapper"/>
) )
</when> </when>
<when test="key.startsWith('custom_multiple')"> <when test="key.startsWith('custom_multiple')">
and test_case.id in ( and test_case.id in (
select resource_id from custom_field_test_case where concat('custom_multiple-',field_id) = #{key} select resource_id from custom_field_test_case where concat('custom_multiple-',field_id) =
#{key}
and and
<foreach collection="values" item="value" separator="or" open="(" close=")"> <foreach collection="values" item="value" separator="or" open="(" close=")">
JSON_CONTAINS(value, #{value}) JSON_CONTAINS(value, #{value})