mybatis 调用存储过程
<!-- 定义存储过程尾单停止-->
<select id="stopOutStoutCallProc" parameterType="com.work.entity.stockout.OutStockout" statementType="CALLABLE" >
<![CDATA[
call job_exit(
#{stockout_guid,mode=IN,jdbcType=VARCHAR},
#{result,mode=OUT,jdbcType=VARCHAR}
)
]]>
</select>
注意:statementType=”CALLABLE” 必须为CALLABLE,告诉MyBatis去执行存储过程, 否则会报错
Exception in thread “main” org.apache.ibatis.exceptions.PersistenceException
mode=IN 输入参数 mode=OUT输出参数 jdbcType为数据库定义的字段类型。
这样写 Mybatis会帮助我们自动回填输出的deviceCount的值。