update 优化 替换过期方法

2.X
疯狂的狮子Li 8 months ago
parent c9a1e67e5d
commit 572be0a836

@ -55,5 +55,5 @@ public interface TestDemoMapper extends BaseMapperPlus<TestDemo, TestDemoVo> {
@DataColumn(key = "deptName", value = "dept_id"), @DataColumn(key = "deptName", value = "dept_id"),
@DataColumn(key = "userName", value = "user_id") @DataColumn(key = "userName", value = "user_id")
}) })
int deleteBatchIds(@Param(Constants.COLL) Collection<?> idList); int deleteByIds(@Param(Constants.COLL) Collection<?> idList);
} }

@ -101,7 +101,7 @@ public class TestDemoServiceImpl implements ITestDemoService {
if (isValid) { if (isValid) {
//TODO 做一些业务上的校验,判断是否需要校验 //TODO 做一些业务上的校验,判断是否需要校验
} }
return baseMapper.deleteBatchIds(ids) > 0; return baseMapper.deleteByIds(ids) > 0;
} }
@Override @Override

@ -83,6 +83,6 @@ public class TestTreeServiceImpl implements ITestTreeService {
if (isValid) { if (isValid) {
//TODO 做一些业务上的校验,判断是否需要校验 //TODO 做一些业务上的校验,判断是否需要校验
} }
return baseMapper.deleteBatchIds(ids) > 0; return baseMapper.deleteByIds(ids) > 0;
} }
} }

@ -161,7 +161,7 @@ public class GenTableServiceImpl implements IGenTableService {
@Override @Override
public void deleteGenTableByIds(Long[] tableIds) { public void deleteGenTableByIds(Long[] tableIds) {
List<Long> ids = Arrays.asList(tableIds); List<Long> ids = Arrays.asList(tableIds);
baseMapper.deleteBatchIds(ids); baseMapper.deleteByIds(ids);
genTableColumnMapper.delete(new LambdaQueryWrapper<GenTableColumn>().in(GenTableColumn::getTableId, ids)); genTableColumnMapper.delete(new LambdaQueryWrapper<GenTableColumn>().in(GenTableColumn::getTableId, ids));
} }
@ -328,7 +328,7 @@ public class GenTableServiceImpl implements IGenTableService {
if (CollUtil.isNotEmpty(delColumns)) { if (CollUtil.isNotEmpty(delColumns)) {
List<Long> ids = StreamUtils.toList(delColumns, GenTableColumn::getColumnId); List<Long> ids = StreamUtils.toList(delColumns, GenTableColumn::getColumnId);
if (CollUtil.isNotEmpty(ids)) { if (CollUtil.isNotEmpty(ids)) {
genTableColumnMapper.deleteBatchIds(ids); genTableColumnMapper.deleteByIds(ids);
} }
} }
} }

@ -129,6 +129,6 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service {
if(isValid){ if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验 //TODO 做一些业务上的校验,判断是否需要校验
} }
return baseMapper.deleteBatchIds(ids) > 0; return baseMapper.deleteByIds(ids) > 0;
} }
} }

@ -134,7 +134,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
SysOssConfig config = baseMapper.selectById(configId); SysOssConfig config = baseMapper.selectById(configId);
list.add(config); list.add(config);
} }
boolean flag = baseMapper.deleteBatchIds(ids) > 0; boolean flag = baseMapper.deleteByIds(ids) > 0;
if (flag) { if (flag) {
list.forEach(sysOssConfig -> list.forEach(sysOssConfig ->
CacheUtils.evict(CacheNames.SYS_OSS_CONFIG, sysOssConfig.getConfigKey())); CacheUtils.evict(CacheNames.SYS_OSS_CONFIG, sysOssConfig.getConfigKey()));

@ -240,7 +240,7 @@ public class SysOssServiceImpl implements ISysOssService {
OssClient storage = OssFactory.instance(sysOss.getService()); OssClient storage = OssFactory.instance(sysOss.getService());
storage.delete(sysOss.getUrl()); storage.delete(sysOss.getUrl());
} }
return baseMapper.deleteBatchIds(ids) > 0; return baseMapper.deleteByIds(ids) > 0;
} }
/** /**

@ -145,6 +145,6 @@ public class SysClientServiceImpl implements ISysClientService {
if (isValid) { if (isValid) {
//TODO 做一些业务上的校验,判断是否需要校验 //TODO 做一些业务上的校验,判断是否需要校验
} }
return baseMapper.deleteBatchIds(ids) > 0; return baseMapper.deleteByIds(ids) > 0;
} }
} }

@ -176,7 +176,7 @@ public class SysConfigServiceImpl implements ISysConfigService {
} }
CacheUtils.evict(CacheNames.SYS_CONFIG, config.getConfigKey()); CacheUtils.evict(CacheNames.SYS_CONFIG, config.getConfigKey());
} }
baseMapper.deleteBatchIds(Arrays.asList(configIds)); baseMapper.deleteByIds(Arrays.asList(configIds));
} }
/** /**

@ -137,7 +137,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
} }
CacheUtils.evict(CacheNames.SYS_DICT, dictType.getDictType()); CacheUtils.evict(CacheNames.SYS_DICT, dictType.getDictType());
} }
baseMapper.deleteBatchIds(Arrays.asList(dictIds)); baseMapper.deleteByIds(Arrays.asList(dictIds));
} }
/** /**

@ -87,7 +87,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService {
*/ */
@Override @Override
public int deleteLogininforByIds(Long[] infoIds) { public int deleteLogininforByIds(Long[] infoIds) {
return baseMapper.deleteBatchIds(Arrays.asList(infoIds)); return baseMapper.deleteByIds(Arrays.asList(infoIds));
} }
/** /**

@ -119,6 +119,6 @@ public class SysNoticeServiceImpl implements ISysNoticeService {
*/ */
@Override @Override
public int deleteNoticeByIds(Long[] noticeIds) { public int deleteNoticeByIds(Long[] noticeIds) {
return baseMapper.deleteBatchIds(Arrays.asList(noticeIds)); return baseMapper.deleteByIds(Arrays.asList(noticeIds));
} }
} }

@ -105,7 +105,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService {
*/ */
@Override @Override
public int deleteOperLogByIds(Long[] operIds) { public int deleteOperLogByIds(Long[] operIds) {
return baseMapper.deleteBatchIds(Arrays.asList(operIds)); return baseMapper.deleteByIds(Arrays.asList(operIds));
} }
/** /**

@ -202,7 +202,7 @@ public class SysPostServiceImpl implements ISysPostService {
throw new ServiceException(String.format("%1$s已分配不能删除!", post.getPostName())); throw new ServiceException(String.format("%1$s已分配不能删除!", post.getPostName()));
} }
} }
return baseMapper.deleteBatchIds(Arrays.asList(postIds)); return baseMapper.deleteByIds(Arrays.asList(postIds));
} }
/** /**

@ -417,7 +417,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
roleMenuMapper.delete(new LambdaQueryWrapper<SysRoleMenu>().in(SysRoleMenu::getRoleId, ids)); roleMenuMapper.delete(new LambdaQueryWrapper<SysRoleMenu>().in(SysRoleMenu::getRoleId, ids));
// 删除角色与部门关联 // 删除角色与部门关联
roleDeptMapper.delete(new LambdaQueryWrapper<SysRoleDept>().in(SysRoleDept::getRoleId, ids)); roleDeptMapper.delete(new LambdaQueryWrapper<SysRoleDept>().in(SysRoleDept::getRoleId, ids));
return baseMapper.deleteBatchIds(ids); return baseMapper.deleteByIds(ids);
} }
/** /**

@ -140,6 +140,6 @@ public class SysTenantPackageServiceImpl implements ISysTenantPackageService {
throw new ServiceException("租户套餐已被使用"); throw new ServiceException("租户套餐已被使用");
} }
} }
return baseMapper.deleteBatchIds(ids) > 0; return baseMapper.deleteByIds(ids) > 0;
} }
} }

@ -294,7 +294,7 @@ public class SysTenantServiceImpl implements ISysTenantService {
throw new ServiceException("超管租户不能删除"); throw new ServiceException("超管租户不能删除");
} }
} }
return baseMapper.deleteBatchIds(ids) > 0; return baseMapper.deleteByIds(ids) > 0;
} }
/** /**

@ -535,7 +535,7 @@ public class SysUserServiceImpl implements ISysUserService {
// 删除用户与岗位表 // 删除用户与岗位表
userPostMapper.delete(new LambdaQueryWrapper<SysUserPost>().in(SysUserPost::getUserId, ids)); userPostMapper.delete(new LambdaQueryWrapper<SysUserPost>().in(SysUserPost::getUserId, ids));
// 防止更新失败导致的数据删除 // 防止更新失败导致的数据删除
int flag = baseMapper.deleteBatchIds(ids); int flag = baseMapper.deleteByIds(ids);
if (flag < 1) { if (flag < 1) {
throw new ServiceException("删除用户失败!"); throw new ServiceException("删除用户失败!");
} }

@ -699,7 +699,7 @@ public class ActTaskServiceImpl implements IActTaskService {
if (multiInstance == null && taskList.size() > 1) { if (multiInstance == null && taskList.size() > 1) {
List<Task> tasks = StreamUtils.filter(taskList, e -> !e.getTaskDefinitionKey().equals(task.getTaskDefinitionKey())); List<Task> tasks = StreamUtils.filter(taskList, e -> !e.getTaskDefinitionKey().equals(task.getTaskDefinitionKey()));
if (CollUtil.isNotEmpty(tasks)) { if (CollUtil.isNotEmpty(tasks)) {
actHiTaskinstMapper.deleteBatchIds(StreamUtils.toList(tasks, Task::getId)); actHiTaskinstMapper.deleteByIds(StreamUtils.toList(tasks, Task::getId));
} }
} }

@ -113,7 +113,7 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
public Boolean deleteWithValidByIds(Collection<Long> ids) { public Boolean deleteWithValidByIds(Collection<Long> ids) {
List<String> idList = StreamUtils.toList(ids, String::valueOf); List<String> idList = StreamUtils.toList(ids, String::valueOf);
workflowService.deleteRunAndHisInstance(idList); workflowService.deleteRunAndHisInstance(idList);
return baseMapper.deleteBatchIds(ids) > 0; return baseMapper.deleteByIds(ids) > 0;
} }
/** /**

@ -114,7 +114,7 @@ public class WfCategoryServiceImpl implements IWfCategoryService {
if (isValid) { if (isValid) {
//TODO 做一些业务上的校验,判断是否需要校验 //TODO 做一些业务上的校验,判断是否需要校验
} }
return baseMapper.deleteBatchIds(ids) > 0; return baseMapper.deleteByIds(ids) > 0;
} }
/** /**

@ -107,7 +107,7 @@ public class WfDefinitionConfigServiceImpl implements IWfDefinitionConfigService
*/ */
@Override @Override
public Boolean deleteByIds(Collection<Long> ids) { public Boolean deleteByIds(Collection<Long> ids) {
return baseMapper.deleteBatchIds(ids) > 0; return baseMapper.deleteByIds(ids) > 0;
} }
@Override @Override

@ -106,6 +106,6 @@ public class WfFormManageServiceImpl implements IWfFormManageService {
*/ */
@Override @Override
public Boolean deleteByIds(Collection<Long> ids) { public Boolean deleteByIds(Collection<Long> ids) {
return baseMapper.deleteBatchIds(ids) > 0; return baseMapper.deleteByIds(ids) > 0;
} }
} }

@ -50,7 +50,7 @@ public class WfNodeConfigServiceImpl implements IWfNodeConfigService {
*/ */
@Override @Override
public Boolean deleteByIds(Collection<Long> ids) { public Boolean deleteByIds(Collection<Long> ids) {
return baseMapper.deleteBatchIds(ids) > 0; return baseMapper.deleteByIds(ids) > 0;
} }

@ -106,7 +106,7 @@ public class WfTaskBackNodeServiceImpl implements IWfTaskBackNodeService {
} }
} }
if (CollUtil.isNotEmpty(ids)) { if (CollUtil.isNotEmpty(ids)) {
wfTaskBackNodeMapper.deleteBatchIds(ids); wfTaskBackNodeMapper.deleteByIds(ids);
} }
} }
return true; return true;

Loading…
Cancel
Save