mapper接口
public Integer getOrderInfoNum(Map<String, Object> params);
orderNum是传入的String类型,以下两种mapper配置出错
<if test="orderNum != null and orderNum != ''"><![CDATA[AND o_num = #{orderNum} ]]></if>
<if test="orderNum != null and orderNum != ''"><![CDATA[AND o_num = "#{orderNum}" ]]></if>
正确配置
<if test="orderNum != null and orderNum != ''"><![CDATA[AND o_num = "${orderNum}" ]]></if>
<!--或者-->
<if test="orderNum != null and orderNum != ''"><![CDATA[AND o_num = #{orderNum,jdbcType=VARCHAR} ]]></if>