mybatis报错信息提示是:
Error querying database. Cause: java.lang.IllegalArgumentException: invalid comparison: java.util.Date and java.lang.String
Cause: java.lang.IllegalArgumentException: invalid comparison: java.util.Date and java.lang.String
是由于Data和String不匹配,看了一下自己的xml配置:
<if test="startDate != null and startDate != ''">
AND start_date <![CDATA[ >= ]]> #{startDate}
</if>
是因为将Date当中String类型去比较了,所以报错,修改后
<if test="startDate != null">
AND start_date <![CDATA[ >= ]]> #{startDate}
</if>