<select id="selectByy" parameterType="HashMap" statementType="CALLABLE">
<!--mode=OUT/IN 必须大写-->
{CALL getCountByy(
#{addName,jdbcType=VARCHAR,mode=IN},
#{stuCount,jdbcType=INTEGER,mode=OUT})}
</select>
<!--数据表创建存储过程
delimiter $$
CREATE PROCEDURE getCountByy(in addName VARCHAR(255),out stuCount int)
BEGIN
SELECT count(*) into stuCount from students WHERE stuAddress=addName;
END $$
delimiter ;
CALL getCountByy('北京',@s);
SELECT @s;-->
Mybatis如何调用数据库中的存储过程
最新推荐文章于 2023-02-14 12:36:14 发布