service业务层调用dao层
注意:返回值直接从对象里获取 不需要拿对象接收再获取
dao.uspGetUser(userPO);//对象封装了存储过程的入参和出参 count = userPO.getCount(); //count 是存储过程的返回值:从对象在获取返回值dao层接口
public interface userDao { Integer uspGetUser(UserPO userPO); }mapper配置文件:配置中的count对应UserPO中参数字段
<select id="uspGetUser" statementType="CALLABLE" parameterType="com.entity.UserPO" resultType="integer"> call usp_get_user( #{id,mode=IN,jdbcType=VARCHAR}, #{name,mode=IN,jdbcType=VARCHAR}, #{count,mode=OUT,jdbcType=VARCHAR}); </select>
参考::https://blog.csdn.net/qq_38187437/article/details/84872758