TenantKVSqlDao.sql.stg

46 lines | 691 B Blame History Raw Download
group TenantKVSqlDao: EntitySqlDao;

tableName() ::= "tenant_kvs"

tableFields(prefix) ::= <<
  <prefix>t_key
, <prefix>t_value
, <prefix>is_active
, <prefix>created_date
, <prefix>created_by
, <prefix>updated_date
, <prefix>updated_by
>>

tableValues() ::= <<
  :key
, :value
, :isActive
, :createdDate
, :createdBy
, :updatedDate
, :updatedBy
>>

accountRecordIdFieldWithComma() ::= ""

accountRecordIdValueWithComma() ::= ""


getTenantValueForKey() ::= <<
select
  <allTableFields("t.")>
from <tableName()> t
where t.t_key = :key
<AND_CHECK_TENANT("t.")>
;
>>

markTenantKeyAsDeleted() ::= <<
update <tableName()> t
set t.is_active = 0
where t.t_key = :key
<AND_CHECK_TENANT("t.")>
;
>>