fix:更改数据表结构,在测试的同时异步添加表结构 bug修改,不会重复添加,可区分添加和修改

master
Saisai Liu 2024-04-22 18:49:00 +08:00
parent 29b4db789c
commit 8839f7fe20
1 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
package com.muyu.etl.service.impl; package com.muyu.etl.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.security.utils.SecurityUtils; import com.muyu.common.security.utils.SecurityUtils;
@ -138,7 +139,7 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMapp
.createBy(SecurityUtils.getUsername()) .createBy(SecurityUtils.getUsername())
.createTime(new Date()) .createTime(new Date())
.build(); .build();
tableInfoService.saveOrUpdate(tableInfo,new LambdaUpdateChainWrapper<TableInfo>(TableInfo.class){{ tableInfoService.saveOrUpdate(tableInfo,new LambdaUpdateWrapper<TableInfo>(TableInfo.class){{
eq(TableInfo::getTableName,tableInfo.getTableName()); eq(TableInfo::getTableName,tableInfo.getTableName());
eq(TableInfo::getBasicId,basicConfigInfo.getId()); eq(TableInfo::getBasicId,basicConfigInfo.getId());
}}); }});
@ -167,7 +168,7 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMapp
.dataNum(rowCount) .dataNum(rowCount)
.updateTime(new Date()) .updateTime(new Date())
.build(); .build();
tableInfoService.saveOrUpdate(build,new LambdaUpdateChainWrapper<TableInfo>(TableInfo.class){{ tableInfoService.saveOrUpdate(build,new LambdaUpdateWrapper<TableInfo>(TableInfo.class){{
eq(TableInfo::getTableName,build.getTableName()); eq(TableInfo::getTableName,build.getTableName());
eq(TableInfo::getBasicId,basicConfigInfo.getId()); eq(TableInfo::getBasicId,basicConfigInfo.getId());
}}); }});