mybatis调用存储过程,获取返回值(单参数返回值)

service业务层调用dao层

注意:返回值直接从对象里获取 不需要拿对象接收再获取

    dao.uspGetUser(userPO);//对象封装了存储过程的入参和出参
    count = userPO.getCount();    //count 是存储过程的返回值:从对象在获取返回值

dao层接口

    public interface userDao {
        Integer uspGetUser(UserPO userPO);
    }

mapper配置文件:配置中的count对应UserPO中参数字段

  


参考::https://blog.csdn.net/qq_38187437/article/details/84872758

你可能感兴趣的:(Mybatis)