环境
SpringBoot 1.5 + JDK1.8 + Mybatis3.4
现象
使用Mybatis动态SQL查询数据后发现,时间字段显示为null,这不仅仅是时间格式问题。
解决与总结
跟踪代码之后发现xml文件中
映射关系
<resultMap id="PcmArticleListDTO" type="com.xxx.xxx.model.PcmArticleListDTO">
<!--
WARNING - @mbg.generated
-->
<id column="CT_ID" jdbcType="VARCHAR" property="ctId" />
<result column="TITLE" jdbcType="VARCHAR" property="title" />
<result column="SUBTITLE" jdbcType="VARCHAR" property="subtitle" />
<result column="CON" jdbcType="VARCHAR" property="con" />
<result column="CON_H5" jdbcType="VARCHAR" property="conH5" />