mybatis传入参数为string时,如果这样写
<update id="exec" parameterType="string">
${sql}
</update>会报错
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'sql' in 'class java.lang.String'
正确写法为
<update id="exec" parameterType="string">
${_parameter}
</update>即无论参数名是啥,都要改成"_parameter"