将之前的
<if test="startInvokeTime != null" and startInvokeTime != ' ' ''>
and invoke_time >= #{startInvokeTime,jdbcType=TIMESTAMP}
</if>
<if test="endtInvokeTime != null" and endtInvokeTime != ' '>
<![CDATA[
and invoke_time <= #{endtInvokeTime,jdbcType=TIMESTAMP}
]]>
</if>
改成
<if test="startInvokeTime != null">
and invoke_time >= #{startInvokeTime,jdbcType=TIMESTAMP}
</if>
<if test="endtInvokeTime != null">
<![CDATA[
and invoke_time <= #{endtInvokeTime,jdbcType=TIMESTAMP}
]]>
</if>
说明:上文中红色标记部分为mybatis中sql的转义,如果不转义,比较的“<”就会被当做xml文件标签的做括号,以至于报错,所以这里需要进行转义