invalid comparison: java.util.Date and java.lang.String异常原因
背景:
实体里的字段定义为日期格式 private Date updateTime;
myBatis的mapper里if条件(做了字符串的非空判断):
<if test="updateTime != null and updateTime != ''">
UPDATE_TIME = #{updateTime},
</if>
解决方案(仅做常态null的非空判断):
<if test="updateTime != null">
UPDATE_TIME = #{updateTime},
</if>