近日在一個sprinboot+mybatis項目中出現(xiàn)日期解析錯誤:
QQ截圖20180802163254.png
后來網(wǎng)上百度误续,說是mybatis新版本的一個bug
<select id="getList" resultType="com.cw.entity.news.NewsEntity">
select
id,
title,
content,
create_tm as createTm
from
cw_zh_news
<where>
<if test="createTm !=null and createTm !='' ">
create_tm<![CDATA[<]]>#{createTm}
</if>
</where>
order by
create_tm DESC
limit #{rows}
</select>
把時間為空字符判斷去掉