原因:![](https://img-blog.csdnimg.cn/c5a7e03aa6714d4e9bc45ba3f350d00b.png)
而在SQL语句中进行了空字符的比较 (Date与varchar)
<if test="beginTime != null and beginTime != '' "><!-- 活动开始时间 -->
and date_format(begin_time,'%y%m%d') <= date_format(#{beginTime},'%y%m%d')
</if>
解决:去掉空字符串的比较
<if test="beginTime != null "><!-- 活动开始时间 -->
and date_format(begin_time,'%y%m%d') <= date_format(#{beginTime},'%y%m%d') </if>
总结:
在SQL的逻辑判断时还需注意数据类型之间的可比性。