数据库中是datetime时间字段,当使用mybatis转换时候,如果使用date类型,分钟和秒都变成0
应该在mybatis中使用 TIMESTAMP
<result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/>
jdbcType="DATE"会造成数据时间精度丢失。
由于jdbcType=“DATE”,insert,
update这个字段的时候,时分秒(HH:mm:ss) 丢失,应该将DATE改为TIMESTAMP
只需要日期: jdbcType=“DATE”
只需要时间:jdbcType=“TIME”
日期+时间:TIMESTAMP