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