SpringBoot 中调用存储过程的方法

Posted wangmj518

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SpringBoot 中调用存储过程的方法相关的知识,希望对你有一定的参考价值。

1 在 XXXmapper.xml 文件中

<select id="callProOutStock" parameterType="map" statementType="CALLABLE" resultType="int">
    {
        call pro_out_stock(
            #{deptId, mode=IN, jdbcType=VARCHAR},
            #{goodsNo, mode=IN, jdbcType=VARCHAR},
            #{storageNo, mode=IN, jdbcType=VARCHAR},
            #{amount, mode=IN, jdbcType=NUMERIC},
            #{result, mode=OUT, jdbcType=NUMERIC}
        )
    }
    </select>

2 在 XXXmapper.java中

int callProOutStock(@Param("deptId") String deptId, @Param("goodsNo") String goodsNo, @Param("storageNo") String storageNo, @Param("amount") int amount, @Param("result") int result);

以上是关于SpringBoot 中调用存储过程的方法的主要内容,如果未能解决你的问题,请参考以下文章