From 0e8123cbb23f99fc5361ae8b1f5e2293d523f841 Mon Sep 17 00:00:00 2001 From: zhangdahai112 Date: Wed, 12 Jan 2022 10:40:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BC=96=E8=BE=91=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E8=AE=A1=E5=88=92-=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/track/service/TestCaseService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index 678b699bd6..f93540483c 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -267,7 +267,10 @@ public class TestCaseService { testCase.setUpdateTime(System.currentTimeMillis()); // 更新数据 TestCaseExample example = new TestCaseExample(); - example.createCriteria().andIdEqualTo(testCase.getId()).andVersionIdEqualTo(testCase.getVersionId()); + example.createCriteria().andIdEqualTo(testCase.getId()); + if (StringUtils.isNotBlank(testCase.getVersionId())) { + example.getOredCriteria().get(0).andVersionIdEqualTo(testCase.getVersionId()); + } if (testCaseMapper.updateByExampleSelective(testCase, example) == 0) { // 插入新版本的数据 TestCaseWithBLOBs oldTestCase = testCaseMapper.selectByPrimaryKey(testCase.getId());