错误代码:

<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>

 

posted on 2021-11-08 17:50  周文豪  阅读(1187)  评论(0)    收藏  举报