fix(接口测试): 修复批量删除api接口报sql异常的缺陷
--bug=1024917 --user=王孝刚 【接口测试】api-回收站- 全选批量删除报sql异常 https://www.tapd.cn/55049933/s/1356281
This commit is contained in:
parent
85f4431132
commit
38a81803e9
|
@ -682,14 +682,16 @@ public class MockConfigService {
|
|||
MockConfigExample configExample = new MockConfigExample();
|
||||
configExample.createCriteria().andApiIdIn(apiIds);
|
||||
List<MockConfig> mockConfigList = mockConfigMapper.selectByExample(configExample);
|
||||
MockExpectConfigExample example = new MockExpectConfigExample();
|
||||
List<String> mockConfigIds = mockConfigList.stream().map(MockConfig::getId).toList();
|
||||
example.createCriteria().andMockConfigIdIn(mockConfigIds);
|
||||
List<MockExpectConfigWithBLOBs> deleteBlobs = mockExpectConfigMapper.selectByExampleWithBLOBs(example);
|
||||
for (MockExpectConfigWithBLOBs model : deleteBlobs) {
|
||||
this.deleteMockExpectFiles(model);
|
||||
if (CollectionUtils.isNotEmpty(mockConfigIds)) {
|
||||
MockExpectConfigExample example = new MockExpectConfigExample();
|
||||
example.createCriteria().andMockConfigIdIn(mockConfigIds);
|
||||
List<MockExpectConfigWithBLOBs> deleteBlobs = mockExpectConfigMapper.selectByExampleWithBLOBs(example);
|
||||
for (MockExpectConfigWithBLOBs model : deleteBlobs) {
|
||||
this.deleteMockExpectFiles(model);
|
||||
}
|
||||
mockExpectConfigMapper.deleteByExample(example);
|
||||
}
|
||||
mockExpectConfigMapper.deleteByExample(example);
|
||||
mockConfigMapper.deleteByExample(configExample);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue