Method of calling stored procedure in SpringBoot

Posted May 27, 20201 min read

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);