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 868b0de84a..df0670d49a 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 @@ -72,9 +72,10 @@ public interface ExtTestPlanTestCaseMapper { List getCaseIdsByIds(@Param("ids") List ids); - void updateExecResultByTestPlanCaseIdList(@Param("ids") List testPlanCaseIdList, @Param("execResult") String execResult); + int updateDiffExecResultByTestPlanCaseIdList(@Param("ids") List testPlanCaseIdList, @Param("execResult") String execResult); - void updateExecResultByTestCaseIdAndTestPlanId(@Param("testCaseId") String testCaseId, @Param("testPlanId") String testPlanId, @Param("execResult") String execResult); + //修改 + int updateDiffExecResultByTestCaseIdAndTestPlanId(@Param("testCaseId") String testCaseId, @Param("testPlanId") String testPlanId, @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 a69d913c40..ebaf58ef44 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 @@ -654,17 +654,18 @@ ); - + UPDATE test_plan_test_case SET status = #{execResult} WHERE id IN #{value} + AND status != #{execResult} - + UPDATE test_plan_test_case SET status = #{execResult} - WHERE case_id = #{testCaseId} AND plan_id = #{testPlanId} + WHERE case_id = #{testCaseId} AND plan_id = #{testPlanId} AND status != #{execResult}