mybatis查询的时候出现了一以下错误:
nested exception is org.apache.ibatis.exceptions.PersistenceException: \r\n### Error updating database. Cause: java.lang.IllegalArgumentException: invalid comparison: java.util.Date and java.lang.String\r\n### The error may exist in file [Mapper.xml]\r\n### The error may involve com.***r\n### The error occurred while executing an update\r\n### Cause: java.lang.IllegalArgumentException: invalid comparison: java.util.Date and java.lang.String
很显热是说date格式的数据不能使用string的处理方式进行处理:
找到mapper文件发现以下错误:
<if test="createTime!=null and createTime!= ''">createTime</if>
很显然date类型的createTime只需要进行"createTime!=null"的判断就可以了,不需要 createTime!= '' 的判断。因此改为以下,解决问题
<if test="createTime!=null">createTime</if>