【记录】spring boot 整合mybatis 实体类返回日期格式化

 

1:首先将返回的实体类的时间由Date类型 换成String类型

 

 

2:将mapper.xml里的created_time 不设置类型,并将查询字段时间格式化,注意此次查询需要使用别名 不然返回查不到此列

date_format(
	        created_time,
	        '%Y-%c-%d %h:%i:%s'
	    ) created_time,

 

 

本文参考自:https://blog.csdn.net/qq_41032705/article/details/82700702

 

posted @ 2019-11-01 15:53  -天道酬勤-  阅读(2949)  评论(0编辑  收藏  举报