更新数据同步
This commit is contained in:
@@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -29,7 +32,7 @@ public class DataTableInfo implements Serializable {
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_time")
|
||||
private LocalDateTime createTime;
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 数据表唯一标识(主键)
|
||||
@@ -77,7 +80,7 @@ public class DataTableInfo implements Serializable {
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("update_time")
|
||||
private LocalDateTime updateTime;
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
|
||||
@@ -122,13 +122,9 @@ public class MysqlUtils {
|
||||
tableInfo.setDataSource(dbName);
|
||||
tableInfo.setDataRows(tableRs.getLong("TABLE_ROWS"));
|
||||
Date createDate = tableRs.getTimestamp("CREATE_TIME");
|
||||
if (createDate != null) {
|
||||
tableInfo.setCreateTime(createDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
|
||||
}
|
||||
tableInfo.setCreateTime(createDate != null ? createDate : new Date());
|
||||
Date updateDate = tableRs.getTimestamp("UPDATE_TIME");
|
||||
if (updateDate != null) {
|
||||
tableInfo.setUpdateTime(updateDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
|
||||
}
|
||||
tableInfo.setUpdateTime(updateDate != null ? updateDate : new Date());
|
||||
tableInfo.setDs(DateUtils.dsValue());
|
||||
return tableInfo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user