springMvc+mybatis 存储过程中有mysql inout属性参数,用mybatis 注解如何调用,注意是注解不是xml,
我自己已经试过 N 多方法了 无论是指定固定参数 ,还是类参数 或者 map 都不行,直接上图
这是我存储过程运行的参数,其中有一项是 inout
这是我在 mysql调用时的结果

查过资料 @a 是在mysql中 定义 变量的 , inout 属性 相当于有 返回值 ,所以 不能是具体的 int 数值 或 char 字符,只能定义一个变量。

除了第一个可以正常调用外其它的 指定了 myCount 也就是 mysql @ 位置 都会报错。
报错如下:
------------------------------------------------------------------------------------------------------------------------------------------------------------------
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: OUT or INOUT argument 1 for routine test.pagination is not a variable or NEW pseudo-variable in BEFORE trigger
### The error may exist in com/bky/dao/UserMapper.java (best guess)
### The error may involve com.bky.dao.UserMapper.getPage_json2-Inline
### The error occurred while setting parameters
### SQL: CALL pagination (?,'user','id','*',?,?,'','')
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: OUT or INOUT argument 1 for routine test.pagination is not a variable or NEW pseudo-variable in BEFORE trigger
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: OUT or INOUT argument 1 for routine test.pagination is not a variable or NEW pseudo-variable in BEFORE trigger
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:927)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:811)
javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------