diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.java b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.java index df0670d49a..968fb1bd81 100644 --- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.java +++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.java @@ -73,9 +73,10 @@ public interface ExtTestPlanTestCaseMapper { List getCaseIdsByIds(@Param("ids") List ids); int updateDiffExecResultByTestPlanCaseIdList(@Param("ids") List testPlanCaseIdList, @Param("execResult") String execResult); - + int updateTestCaseLastResultByIds(@Param("caseIds") List caseIds, @Param("execResult") String execResult); //修改 int updateDiffExecResultByTestCaseIdAndTestPlanId(@Param("testCaseId") String testCaseId, @Param("testPlanId") String testPlanId, @Param("execResult") String execResult); + int updateTestCaseLastResult(@Param("testCaseId") String testCaseId, @Param("execResult") String execResult); List selectByAutomationCaseIdAndTestPlanId(@Param("automationCaseId") String automationCaseId, @Param("test_plan_id") String testPlanId); diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml index 6e19ba9020..f29eccd81d 100644 --- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml +++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml @@ -682,10 +682,23 @@ AND status != #{execResult} + + UPDATE test_case SET last_execute_result = #{execResult} + WHERE id IN + + #{value} + + AND (last_execute_result != #{execResult} or last_execute_result is null) + + UPDATE test_plan_test_case SET status = #{execResult} WHERE case_id = #{testCaseId} AND plan_id = #{testPlanId} AND status != #{execResult} + + UPDATE test_case SET last_execute_result = #{execResult} + WHERE id = #{testCaseId} AND (last_execute_result != #{execResult} or last_execute_result is null) +