1、mysql数据库处理TIMESTAMP格式日期:
https://blog.csdn.net/weixin_38423249/article/details/80103373 或者
https://blog.csdn.net/u010039942/article/details/72547667
2、mysql表内不能同时出现两个TIMESTAMP 字段类型:
https://blog.csdn.net/qq_21508727/article/details/81699157
3、
3、1 数据库字段设置
`ctime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`mtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
3、2 mapper文件定义
<result property="ctime" column="ctime" jdbcType="TIMESTAMP"/>
<result property="mtime" column="mtime" jdbcType="TIMESTAMP"/>
3、3 java定义字段
/**
* 创建时间
*/
private Date ctime;
/**
* 更新时间
*/
private Date mtime;
这样在业务代码中就不用设置创建时间和更新时间了