新增MySQL和pg数据库的同步

This commit is contained in:
2025-08-27 12:53:41 +08:00
parent 1442f08a86
commit 416924f80e
4 changed files with 5 additions and 25 deletions

View File

@@ -66,24 +66,6 @@ public class SyncTask implements Serializable {
@TableField("target_table")
private String targetTable;
/**
* 同步类型(如全量同步、增量同步等)
*/
@TableField("sync_type")
private String syncType;
/**
* 增量同步字段(用于增量同步时的判断依据)
*/
@TableField("increment_column")
private String incrementColumn;
/**
* 定时任务表达式( cron表达式
*/
@TableField("cron_expression")
private String cronExpression;
/**
* 是否激活(任务启用状态标识)
*/

View File

@@ -160,7 +160,7 @@ public class taskDbSync {
}
/**
* 获取PostgreSQL兼容的字段定义
* 获取PostgresSQL兼容的字段定义
*/
private List<String> getColumnDefinitions(JdbcTemplate sourceJdbc, String tableName) throws SQLException {
List<String> definitions = new ArrayList<>();

View File

@@ -29,7 +29,7 @@ public class demo {
.pathInfo(Collections.singletonMap(OutputFile.xml, System.getProperty("user.dir") + "/src/main/resources/mapper"));
})
.strategyConfig(builder -> {
builder.addInclude("biz_sync_task,biz_db_config")
builder.addInclude("biz_sync_task")
.addTablePrefix("biz_")
.entityBuilder()
.enableLombok()
@@ -45,7 +45,8 @@ public class demo {
.formatServiceImplFileName("%sServiceImpl")
.mapperBuilder()
.enableBaseResultMap()
.enableBaseColumnList();
.enableBaseColumnList()
.enableFileOverride(); // 开启mapper接口和xml文件覆盖
})
.templateEngine(new FreemarkerTemplateEngine())
.execute();