mybatis传单个参数报错
在使用mybatis传参数的时候,如果仅传入一个参数,那么在 xml文件中应该使用_parameter来代替参数名。
否则会报错。
示例如下:
<select id="selectByTypeIsactive" resultMap="BaseResultMap">
select * from t_numbering_rules
WHERE is_effective=1
<if test="_parameter != null">
and type = #{_parameter,jdbcType=INTEGER}
</if>
</select>