数据库定义datetime类型,前端之间传string类型的date,在mapper中写法如下:
<if test="startTime!=null and startTime!=''">
<![CDATA[
and mu.create_time >= #{startTime}
]]>
</if>
因为是date类型,使用startTime ! = ‘’,将date类型当成string类型了,所以报错,改成:
<if test="startTime!=null">