org.killbill.billing.payment.dao.PaymentSqlDao.sql.stg Maven / Gradle / Ivy
import "org/killbill/billing/util/entity/dao/EntitySqlDao.sql.stg"
tableName() ::= "payments"
historyTableName() ::= "payment_history"
extraTableFieldsWithComma(prefix) ::= <<
, record_id as payment_number
>>
defaultOrderBy(prefix) ::= <<
order by created_date ASC, ASC
>>
tableFields(prefix) ::= <<
account_id
, payment_method_id
, external_key
, state_name
, last_success_state_name
, created_by
, created_date
, updated_by
, updated_date
>>
tableValues() ::= <<
:accountId
, :paymentMethodId
, :externalKey
, :stateName
, :lastSuccessStateName
, :createdBy
, :createdDate
, :updatedBy
, :updatedDate
>>
updatePaymentForNewTransaction() ::= <<
update
set updated_by = :updatedBy
, updated_date = :updatedDate
where id = :id
;
>>
updatePaymentStateName() ::= <<
update
set state_name = :stateName
, updated_by = :updatedBy
, updated_date = :updatedDate
where id = :id
;
>>
updateLastSuccessPaymentStateName() ::= <<
update
set state_name = :stateName
, last_success_state_name = :lastSuccessStateName
, updated_by = :updatedBy
, updated_date = :updatedDate
where id = :id
;
>>
getPaymentByExternalKey() ::= <<
select
from
where external_key = :externalKey
;
>>
searchQuery(prefix) ::= <<
= :searchKey
or account_id = :searchKey
or payment_method_id = :searchKey
or external_key like :likeSearchKey
>>
searchByState(states, ordering) ::= <<
select
from t
join (
select
from
where state_name in ()
order by
limit :rowCount offset :offset
) optimization on =
order by
;
>>
getSearchByStateCount(states) ::= <<
select
count(1) as count
from t
where t.state_name in ()
;
>>
getByPluginName(ordering) ::= <<
select
from t
join payment_methods pm on pm.id = t.payment_method_id
where pm.plugin_name = :pluginName
order by t.record_id
limit :rowCount offset :offset
;
>>
getCountByPluginName() ::= <<
select
count(1) as count
from t
join payment_methods pm on pm.id = t.payment_method_id
where pm.plugin_name = :pluginName
;
>>
getPaymentsByStatesAcrossTenants(states) ::= <<
select
from t
where
created_date >= :createdAfterDate
and created_date \< :createdBeforeDate
and state_name in ()
limit :limit
;
>>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy