org.killbill.billing.payment.dao.RefundSqlDao.sql.stg Maven / Gradle / Ivy
group RefundSqlDao: EntitySqlDao;
tableName() ::= "refunds"
historyTableName() ::= "refund_history"
tableFields(prefix) ::= <<
account_id
, payment_id
, amount
, currency
, processed_amount
, processed_currency
, is_adjusted
, refund_status
, created_by
, created_date
, updated_by
, updated_date
>>
tableValues() ::= <<
:accountId
, :paymentExternalKey
, :amount
, :currency
, :processedAmount
, :processedCurrency
, :isAdjusted
, :refundStatus
, :createdBy
, :createdDate
, :updatedBy
, :updatedDate
>>
updateStatus(refundStatus) ::= <<
update
set refund_status = :refundStatus
, processed_amount = :processedAmount
, processed_currency = :processedCurrency
, updated_by = :updatedBy
, updated_date = :createdDate
where id = :id
;
>>
getRefundsForPayment(paymentExternalKey) ::= <<
select
from
where payment_id = :paymentExternalKey
;
>>
getRefundsForAccount(accountId) ::= <<
select
from
where account_id = :accountId
;
>>
getByPluginName() ::= <<
select
from t
join payments p on p.id = t.payment_id
join payment_methods pm on pm.id = p.payment_method_id
where pm.plugin_name = :pluginName
order by record_id
limit :offset, :rowCount
;
>>
getCountByPluginName() ::= <<
select
count(1) as count
from t
join payments p on p.id = t.payment_id
join payment_methods pm on pm.id = p.payment_method_id
where pm.plugin_name = :pluginName
;
>>