fix(工作台): 修复工作台仪表板本周创建数量不对的问题

--bug=1025473 --user=宋天阳
【工作台】github#23653,工作台->我的仪表盘->我创建的用例中,本周新增用例数量统计错误
https://www.tapd.cn/55049933/s/1363235
This commit is contained in:
建国 2023-04-17 11:13:08 +08:00 committed by 建国
parent 5f09ae7577
commit c7863d2db3
2 changed files with 15 additions and 8 deletions

View File

@ -281,16 +281,17 @@
</select> </select>
<select id="getCountFollow" resultType="java.lang.Integer"> <select id="getCountFollow" resultType="java.lang.Integer">
select count(*) from api_test_case ac where select count(*) from api_test_case ac where
ac.id in (select af.case_id from api_test_case_follow af where af.follow_id = #{userId,jdbcType=VARCHAR}) ac.id in (select af.case_id from api_test_case_follow af where af.follow_id = #{userId,jdbcType=VARCHAR})
and and
ac.project_id in ac.project_id in
<foreach collection="projectIds" item="projectId" separator="," open="(" close=")"> <foreach collection="projectIds" item="projectId" separator="," open="(" close=")">
#{projectId} #{projectId}
</foreach> </foreach>
and (ac.status is null or ac.status != 'Trash'); and (ac.status is null or ac.status != 'Trash');
</select> </select>
<select id="getUpdateCount" resultType="java.lang.Integer"> <select id="getUpdateCount" resultType="java.lang.Integer">
select count(*) from api_test_case ac where ac.project_id = #{projectId,jdbcType=VARCHAR} and ac.create_user_id = #{userId,jdbcType=VARCHAR} select count(*) from api_test_case ac where ac.project_id = #{projectId,jdbcType=VARCHAR} and ac.create_user_id
= #{userId,jdbcType=VARCHAR}
and case_status in ('Prepare', 'Underway', 'Completed') and case_status in ('Prepare', 'Underway', 'Completed')
<if test="statusList !=null and statusList.size() > 0"> <if test="statusList !=null and statusList.size() > 0">
and ( ac.to_be_updated = 'true' or ac.status and ( ac.to_be_updated = 'true' or ac.status
@ -306,7 +307,7 @@
<foreach collection="statusList" item="value" separator="," open="(" close=")"> <foreach collection="statusList" item="value" separator="," open="(" close=")">
#{value} #{value}
</foreach> </foreach>
)) ))
</if> </if>
<if test="toBeUpdateTime !=null and (statusList ==null or statusList.size() == 0)"> <if test="toBeUpdateTime !=null and (statusList ==null or statusList.size() == 0)">
and ac.to_be_update_time >= #{toBeUpdateTime} and ac.to_be_update_time >= #{toBeUpdateTime}
@ -314,7 +315,7 @@
</select> </select>
<select id="getCountUpcoming" resultType="java.lang.Integer"> <select id="getCountUpcoming" resultType="java.lang.Integer">
select count(*) from api_test_case ac where select count(*) from api_test_case ac where
ac.project_id in ac.project_id in
<foreach collection="projectIds" item="projectId" separator="," open="(" close=")"> <foreach collection="projectIds" item="projectId" separator="," open="(" close=")">
#{projectId} #{projectId}
</foreach> </foreach>
@ -400,6 +401,9 @@
<if test="request.filters == null || request.filters.size() == 0 "> <if test="request.filters == null || request.filters.size() == 0 ">
and (api_test_case.status is null or api_test_case.status != 'Trash') and (api_test_case.status is null or api_test_case.status != 'Trash')
</if> </if>
<if test="request.createTime >0 ">
AND api_test_case.create_time >= #{request.createTime}
</if>
</where> </where>
</sql> </sql>

View File

@ -154,13 +154,16 @@
<if test="request.workspaceId != null"> <if test="request.workspaceId != null">
AND project.workspace_id = #{request.workspaceId} AND project.workspace_id = #{request.workspaceId}
</if> </if>
<if test="request.createTime >0 ">
AND load_test.create_time >= #{request.createTime}
</if>
</where> </where>
</select> </select>
<select id="getCountFollow" resultType="java.lang.Integer"> <select id="getCountFollow" resultType="java.lang.Integer">
select count(*) from load_test lt where select count(*) from load_test lt where
lt.id in (select lf.test_id from load_test_follow lf where lf.follow_id = #{userId,jdbcType=VARCHAR}) lt.id in (select lf.test_id from load_test_follow lf where lf.follow_id = #{userId,jdbcType=VARCHAR})
and and
lt.project_id in lt.project_id in
<foreach collection="projectIds" item="projectId" separator="," open="(" close=")"> <foreach collection="projectIds" item="projectId" separator="," open="(" close=")">
#{projectId} #{projectId}
</foreach> </foreach>
@ -168,7 +171,7 @@
</select> </select>
<select id="getCountUpcoming" resultType="java.lang.Integer"> <select id="getCountUpcoming" resultType="java.lang.Integer">
select count(*) from load_test lt where select count(*) from load_test lt where
lt.project_id in lt.project_id in
<foreach collection="projectIds" item="projectId" separator="," open="(" close=")"> <foreach collection="projectIds" item="projectId" separator="," open="(" close=")">
#{projectId} #{projectId}
</foreach> </foreach>