在xml中如果将时间类型和空字符串""比较,会引发此错误,只保留null判断即可 <if test="null != startDate and startDate != '' "> start_date=#{startDate,jdbcType=DATE}, </if> <if test="null != startDate"> start_date=#{startDate,jdbcType=DATE}, </if>