All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ning.billing.payment.dao.PaymentSqlDao.sql.stg Maven / Gradle / Ivy

group PaymentSqlDao: EntitySqlDao;


extraTableFieldsWithComma(prefix) ::= <<
, record_id as payment_number
>>

tableFields(prefix) ::= <<
  account_id
, invoice_id
, payment_method_id
, amount
, effective_date
, currency
, payment_status
, created_by
, created_date
, updated_by
, updated_date
>>

tableValues() ::= <<
  :accountId
, :invoiceId
, :paymentMethodId
, :amount
, :effectiveDate
, :currency
, :paymentStatus
, :createdBy
, :createdDate
, :updatedBy
, :updatedDate
>>

tableName() ::= "payments"

historyTableName() ::= "payment_history"


getPaymentsForAccount() ::= <<
select 
, record_id as payment_number
from payments
where account_id = :accountId

;
>>

getPaymentsForInvoice() ::= <<
select 
, record_id as payment_number
from payments
where invoice_id = :invoiceId

;
>>


getLastPaymentForAccountAndPaymentMethod() ::= <<
select 
, record_id as payment_number
from payments
where account_id = :accountId
and payment_method_id = :paymentMethodId

order by effective_date desc limit 1
;
>>


updatePaymentStatus() ::= <<
update payments
set payment_status = :paymentStatus,
effective_date = :effectiveDate
where id = :id

;
>>

updatePaymentAmount() ::= <<
update 
set amount = :amount
where id = :id

;
>>






© 2015 - 2025 Weber Informatics LLC | Privacy Policy