fix: 编辑测试计划-测试用例报错

This commit is contained in:
zhangdahai112 2022-01-12 10:40:04 +08:00 committed by fit2-zhao
parent 3264e56b1d
commit 6e64e57e3a
1 changed files with 4 additions and 1 deletions

View File

@ -267,7 +267,10 @@ public class TestCaseService {
testCase.setUpdateTime(System.currentTimeMillis()); testCase.setUpdateTime(System.currentTimeMillis());
// 更新数据 // 更新数据
TestCaseExample example = new TestCaseExample(); 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) { if (testCaseMapper.updateByExampleSelective(testCase, example) == 0) {
// 插入新版本的数据 // 插入新版本的数据
TestCaseWithBLOBs oldTestCase = testCaseMapper.selectByPrimaryKey(testCase.getId()); TestCaseWithBLOBs oldTestCase = testCaseMapper.selectByPrimaryKey(testCase.getId());