报错:invalid comparison: cn.hutool.core.date.DateTime and java.lang.String

错误代码:

<if test="startTime!=null and startTime!='' and endTime!=null and endTime !=''">
            AND t1.update_time BETWEEN #{startTime} AND #{endTime}
        </if>

原因分析:

mybatis在3.30版本及以上判定时间时,不能将DateTime类型与字符串进行比较

修改代码

<if test="startTime!=null and endTime!=null">
            AND t1.update_time BETWEEN #{startTime} AND #{endTime}
        </if>
原文地址:https://www.cnblogs.com/zwh0910/p/15525313.html