BundleSqlDao.sql.stg

69 lines | 1.1 kB Blame History Raw Download
group BundleSqlDao: EntitySqlDao;

tableName() ::= "bundles"


tableFields(prefix) ::= <<
  <prefix>external_key
, <prefix>account_id
, <prefix>last_sys_update_date
, <prefix>original_created_date
, <prefix>created_by
, <prefix>created_date
, <prefix>updated_by
, <prefix>updated_date
>>

tableValues() ::= <<
  :externalKey
, :accountId
, :lastSysUpdateDate
, :originalCreatedDate
, :createdBy
, :createdDate
, :updatedBy
, :updatedDate
>>

updateBundleLastSysTime()  ::= <<
update <tableName()>
set
last_sys_update_date = :lastSysUpdateDate
, updated_by = :createdBy
, updated_date = :createdDate
where id = :id
<AND_CHECK_TENANT()>
;
>>

getBundlesForKey() ::= <<
select <allTableFields()>
from bundles
where
external_key = :externalKey
<AND_CHECK_TENANT()>
order by record_id asc
;
>>

getBundlesFromAccountAndKey() ::= <<
select <allTableFields()>
from bundles
where
external_key = :externalKey
and account_id = :accountId
<AND_CHECK_TENANT()>
order by record_id asc
;
>>

getBundleFromAccount() ::= <<
select <allTableFields()>
from bundles
where
account_id = :accountId
<AND_CHECK_TENANT()>
order by record_id asc
;
>>