fix(接口测试): 场景定时任务数量统计

--bug=1009438 --user=lyh
[github#9018]接口测试模块,添加了定时任务,且执行完成后,在首页-场景定时任务数量统计栏未显示对应的本周执行、历史总执行、成功率等数据,请修改
https://www.tapd.cn/55049933/s/1088942

Closes #9018
This commit is contained in:
shiziyuan9527 2021-12-31 14:09:03 +08:00 committed by shiziyuan9527
parent 463b6b43a4
commit 61bc49d5f6
1 changed files with 6 additions and 7 deletions

View File

@ -233,22 +233,21 @@
</select>
<select id="countByProjectIdAndCreateAndByScheduleInThisWeek" resultType="java.lang.Long">
SELECT count(acr.report_id) AS countNumber FROM api_scenario_report_detail acr
INNER JOIN api_scenario_report ar ON ar.id = acr.report_id
SELECT count(ar.id) AS countNumber FROM
api_scenario_report ar
INNER JOIN (
SELECT acitem.`name`,acitem.id FROM api_scenario acitem INNER JOIN `schedule` sc ON acitem.id = sc.resource_id
) ac on ar.scenario_id = ac.id
WHERE acr.project_id = #{projectId} AND ar.trigger_mode = 'SCHEDULE' AND ar.create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp}
WHERE ar.project_id = #{projectId} AND ar.trigger_mode = 'SCHEDULE' AND ar.create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp}
</select>
<select id="countByProjectIdGroupByExecuteResult" resultType="io.metersphere.api.dto.datacount.ApiDataCountResult">
SELECT count(acr.report_id) AS countNumber,ar.status AS groupField
FROM api_scenario_report_detail acr
INNER JOIN api_scenario_report ar ON ar.id = acr.report_id
SELECT count(ar.id) AS countNumber,ar.status AS groupField FROM
api_scenario_report ar
INNER JOIN (
SELECT acitem.`name`,acitem.id FROM api_scenario acitem INNER JOIN `schedule` sc ON acitem.id = sc.resource_id
) ac on ar.scenario_id = ac.id
WHERE acr.project_id = #{projectId} AND ar.trigger_mode = 'SCHEDULE'
WHERE ar.project_id = #{projectId} AND ar.trigger_mode = 'SCHEDULE'
GROUP BY groupField;
</select>
<select id="selectLastReportByIds" resultType="io.metersphere.base.domain.ApiScenarioReport">