service業務層調用dao層
注意:返回值直接從對象裏獲取 不需要拿對象接收再獲取
dao.uspGetUser(userPO);//對象封裝了存儲過程的入參和出參
count = userPO.getCount(); //count 是存儲過程的返回值
dao層接口
public interface userDao {
Integer uspGetUser(UserPO userPO);
}
mapper配置文件
<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>