Mybatis 中的映射:DATE->DATE

今天获取数据库内的时间老是获取到2019-8-14  00:00:00而不是具体的时分秒,原来是mybatis的映射里Date类型无法转化为具体的时间。

<result column="eventtime4" jdbcType="Date" property="eventtime" />

换成

<result column="eventtime" jdbcType="TIMESTAMP" property="eventtime4" />

就可以了

实体类可以接着使用Date

发布了47 篇原创文章 · 获赞 14 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/qq_35097794/article/details/99566420