
com.ning.billing.account.dao.AccountSqlDao.sql.stg Maven / Gradle / Ivy
The newest version!
group AccountSqlDao: EntitySqlDao;
tableName() ::= "accounts"
historyTableName() ::= "account_history"
tableFields(prefix) ::= <<
external_key
, email
, name
, first_name_length
, currency
, billing_cycle_day_local
, payment_method_id
, time_zone
, locale
, address1
, address2
, company_name
, city
, state_or_province
, country
, postal_code
, phone
, migrated
, is_notified_for_invoices
, created_by
, created_date
, updated_by
, updated_date
>>
tableValues() ::= <<
:externalKey
, :email
, :name
, :firstNameLength
, :currency
, :billingCycleDayLocal
, :paymentMethodId
, :timeZone
, :locale
, :address1
, :address2
, :companyName
, :city
, :stateOrProvince
, :country
, :postalCode
, :phone
, :migrated
, :isNotifiedForInvoices
, :createdBy
, :createdDate
, :updatedBy
, :updatedDate
>>
/** The accounts table doesn't have an account_record_id column (it's the record_id) **/
accountRecordIdFieldWithComma(prefix) ::= ""
accountRecordIdValueWithComma(prefix) ::= ""
update() ::= <<
UPDATE accounts
SET email = :email, name = :name, first_name_length = :firstNameLength,
currency = :currency, billing_cycle_day_local = :billingCycleDayLocal,
payment_method_id = :paymentMethodId, time_zone = :timeZone, locale = :locale,
address1 = :address1, address2 = :address2, company_name = :companyName, city = :city, state_or_province = :stateOrProvince,
country = :country, postal_code = :postalCode, phone = :phone,
is_notified_for_invoices = :isNotifiedForInvoices, updated_date = :updatedDate, updated_by = :updatedBy
WHERE id = :id ;
>>
updatePaymentMethod() ::= <<
UPDATE accounts
SET payment_method_id = :paymentMethodId
, updated_date = :updatedDate
, updated_by = :updatedBy
WHERE id = :id ;
>>
getAccountByKey() ::= <<
select
from accounts
where external_key = :externalKey ;
>>
searchAccounts() ::= <<
select SQL_CALC_FOUND_ROWS
from t
where 1 = 1
and (
= :searchKey
or t.name like :likeSearchKey
or t.email like :likeSearchKey
or t.external_key like :likeSearchKey
or t.company_name like :likeSearchKey
)
order by ASC
limit :offset, :rowCount
;
>>
getIdFromKey() ::= <<
SELECT id
FROM accounts
WHERE external_key = :externalKey ;
>>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy