group DirectPaymentSqlDao: EntitySqlDao;
tableName() ::= "direct_payments"
historyTableName() ::= "direct_payment_history"
extraTableFieldsWithComma(prefix) ::= <<
, <prefix>record_id as payment_number
>>
defaultOrderBy(prefix) ::= <<
order by <prefix>created_date ASC, <recordIdField(prefix)> ASC
>>
tableFields(prefix) ::= <<
<prefix>account_id
, <prefix>payment_method_id
, <prefix>external_key
, <prefix>created_by
, <prefix>created_date
, <prefix>updated_by
, <prefix>updated_date
>>
tableValues() ::= <<
:accountId
, :paymentMethodId
, :externalKey
, :createdBy
, :createdDate
, :updatedBy
, :updatedDate
>>
updateDirectPaymentForNewTransaction() ::= <<
update <tableName()>
set updated_by = :updatedBy
, updated_date = :createdDate
where id = :id
<AND_CHECK_TENANT()>
;
>>
getByPluginName() ::= <<
select
<allTableFields("t.")>
from <tableName()> t
join payment_methods pm on pm.id = t.payment_method_id
where pm.plugin_name = :pluginName
order by record_id
limit :offset, :rowCount
;
>>
getCountByPluginName() ::= <<
select
count(1) as count
from <tableName()> t
join payment_methods pm on pm.id = t.payment_method_id
where pm.plugin_name = :pluginName
;
>>