|
|
|
|
@ -31,6 +31,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -31,6 +31,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
|
import com.github.pagehelper.Page; |
|
|
|
|
import com.google.common.base.CaseFormat; |
|
|
|
|
import jodd.util.StringUtil; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.redisson.api.RedissonClient; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
@ -106,6 +107,28 @@ public class OnlineColumnServiceImpl extends BaseService<OnlineColumn, Long> imp
@@ -106,6 +107,28 @@ public class OnlineColumnServiceImpl extends BaseService<OnlineColumn, Long> imp
|
|
|
|
|
return onlineColumnList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public long saveBySqlTable(SqlTableColumn sqlTableColumn, Long tableId, String columnComment) { |
|
|
|
|
OnlineColumn onlineColumn = new OnlineColumn(); |
|
|
|
|
BeanUtil.copyProperties(sqlTableColumn, onlineColumn, false); |
|
|
|
|
onlineColumn.setColumnId(idGenerator.nextLongId()); |
|
|
|
|
onlineColumn.setTableId(tableId); |
|
|
|
|
// 传了描述,并且不等于原先的描述,并且原先的为空或者为"null",就赋值
|
|
|
|
|
if (StringUtil.isNotBlank(columnComment) && !StringUtil.equals(columnComment, onlineColumn.getColumnComment()) |
|
|
|
|
&& (StringUtil.isBlank(onlineColumn.getColumnComment()) || StringUtil.equals("null", onlineColumn.getColumnComment()))) { |
|
|
|
|
onlineColumn.setColumnComment(columnComment); |
|
|
|
|
} |
|
|
|
|
if (StringUtil.isBlank(onlineColumn.getColumnComment())) { |
|
|
|
|
onlineColumn.setColumnComment(onlineColumn.getColumnName()); |
|
|
|
|
} |
|
|
|
|
this.setDefault(sqlTableColumn, onlineColumn); |
|
|
|
|
if (super.save(onlineColumn)) { |
|
|
|
|
return onlineColumn.getColumnId(); |
|
|
|
|
} |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 更新数据对象。 |
|
|
|
|
* |
|
|
|
|
|