fix: 首页-过去七天失败用例数量统计错误

修复首页-过去七天失败用例数量统计错误的问题
This commit is contained in:
song.tianyang 2020-12-24 11:11:47 +08:00
parent 6b68429a47
commit 4ae66e176b
1 changed files with 11 additions and 3 deletions

View File

@ -50,12 +50,20 @@
) caseErrorCountData ON caseErrorCountData.testCaseID =testCase.testCaseID
WHERE caseErrorCountData.executeTime >= #{startTimestamp}
UNION
SELECT scene.`name` AS caseName,testPlan.`name` AS testPlan,count(report.id) AS failureTimes,'scenario' AS caseType
SELECT scene.`name` AS caseName,apiScene.testPlanName AS testPlan,count(report.id) AS failureTimes,'scenario' AS caseType
FROM api_scenario_report report
INNER JOIN api_scenario_report_detail reportDetail ON report.id = reportDetail.report_id
INNER JOIN api_scenario scene ON reportDetail.content like concat('%"', scene.`name`,'"%')
LEFT JOIN test_plan_api_scenario apiScene ON apiScene.api_scenario_id = scene.id
LEFT JOIN test_plan testPlan ON testPlan.id = apiScene.test_plan_id
LEFT JOIN
(
SELECT
apiScene.api_scenario_id,
group_concat(testPlan.`name`) AS testPlanName
FROM
test_plan_api_scenario apiScene
INNER JOIN test_plan testPlan ON testPlan.id = apiScene.test_plan_id
GROUP BY apiScene.api_scenario_id
)apiScene ON apiScene.api_scenario_id = scene.id
WHERE report.project_id = #{projectId}
AND report.status = 'Error' AND report.create_time >= #{startTimestamp}
GROUP BY scene.id