gpt4 book ai didi

java - 如何在 MyBatis 中调用返回 Oracle 记录类型的 Oracle 函数

转载 作者:行者123 更新时间:2023-12-05 08:01:46 25 4
gpt4 key购买 nike

我在包规范中有记录类型:

 TYPE Payment_Capabilities IS RECORD(
pp_partial_payment NUMBER(1) DEFAULT 0,
co_advance_payment NUMBER(1) DEFAULT 0,
dp_deposit_payment NUMBER(1) DEFAULT 0,
dr_deposit_repay NUMBER(1) DEFAULT 0,
wp_wallet_payment NUMBER(1) DEFAULT 0,
wr_wallet_repay NUMBER(1) DEFAULT 0,
ss_prepaid_payment NUMBER(1) DEFAULT 0);

和返回此类型的函数。我正在使用 MyBatis 与 Spring 的集成。如何调用(使用 MyBatis XML Mapper)这个函数并将结果映射到 POJO 对象?

最佳答案

<select id="identifyPaymentCapabilities" parameterType="PaymentCapabilities" statementType="CALLABLE">
DECLARE
v_payment_capabilities APS.Payment_Capabilities;
BEGIN
v_payment_capabilities := APS.get_payment_capabilities(#{customerId, javaType=Integer, jdbcType=NUMERIC, mode=IN});

#{partialPaymentPP, javaType=Integer, jdbcType=NUMERIC, mode=OUT} := v_payment_capabilities.pp_partial_payment;
#{advancePaymentCO, javaType=Integer, jdbcType=NUMERIC, mode=OUT} := v_payment_capabilities.co_advance_payment;
#{depositPaymentDP, javaType=Integer, jdbcType=NUMERIC, mode=OUT} := v_payment_capabilities.dp_deposit_payment;
#{depositRepayDR, javaType=Integer, jdbcType=NUMERIC, mode=OUT} := v_payment_capabilities.dr_deposit_repay;
#{walletPaymentWP, javaType=Integer, jdbcType=NUMERIC, mode=OUT} := v_payment_capabilities.wp_wallet_payment;
#{walletRepayWR, javaType=Integer, jdbcType=NUMERIC, mode=OUT} := v_payment_capabilities.wr_wallet_repay;
#{prepaidPaymentSS, javaType=Integer, jdbcType=NUMERIC, mode=OUT} := v_payment_capabilities.ss_prepaid_payment;
END;
</select>

关于java - 如何在 MyBatis 中调用返回 Oracle 记录类型的 Oracle 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12281403/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com