refactor(测试用例): 自定义ID项目下唯一

This commit is contained in:
shiziyuan9527 2021-04-27 10:31:45 +08:00 committed by 刘瑞斌
parent 474e09fe51
commit 28afb751ee
1 changed files with 3 additions and 1 deletions

View File

@ -145,7 +145,9 @@ public class TestCaseService {
private void checkCustomNumExist(TestCaseWithBLOBs testCase) { private void checkCustomNumExist(TestCaseWithBLOBs testCase) {
TestCaseExample example = new TestCaseExample(); TestCaseExample example = new TestCaseExample();
example.createCriteria().andCustomNumEqualTo(testCase.getCustomNum()) example.createCriteria()
.andCustomNumEqualTo(testCase.getCustomNum())
.andProjectIdEqualTo(testCase.getProjectId())
.andIdNotEqualTo(testCase.getId()); .andIdNotEqualTo(testCase.getId());
List<TestCase> list = testCaseMapper.selectByExample(example); List<TestCase> list = testCaseMapper.selectByExample(example);
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {