From da1b18792b9ee43b0cc790ab31bbc25b925bb6cd Mon Sep 17 00:00:00 2001 From: zlyx <1242874891@qq.com> Date: 星期五, 30 十二月 2022 16:50:44 +0800 Subject: [PATCH] refactor 重构 BaseMapperPlus, 引入 MP V3.5.3 工具类 Db 进行批量增删改操作 ; --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java index 31f4c1d..c39ec74 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java @@ -136,12 +136,12 @@ @CachePut(cacheNames = CacheNames.SYS_CONFIG, key = "#config.configKey") @Override public String updateConfig(SysConfig config) { - SysConfig temp = baseMapper.selectById(config.getConfigId()); - if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) { - CacheUtils.evict(CacheNames.SYS_CONFIG, temp.getConfigKey()); - } int row = 0; if (config.getConfigId() != null) { + SysConfig temp = baseMapper.selectById(config.getConfigId()); + if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) { + CacheUtils.evict(CacheNames.SYS_CONFIG, temp.getConfigKey()); + } row = baseMapper.updateById(config); } else { row = baseMapper.update(config, new LambdaQueryWrapper<SysConfig>() -- Gitblit v1.9.3