{{#eq system.codeName "1"}}
    

<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
{
    "systemid":"${sys.codeName}",
    "systemname":"${sys.getLogicName()}",
    "entities":[
    <#if sys.getAllPSDataEntities()??>
        <#list sys.getAllPSDataEntities() as de>
    {
    "entity_name":"${de.name}",
    "logic_name":"${de.logicName}",
    "code_name":"${de.codeName}",
    "table_name":"${de.getTableName()}",
    "system_id":"${sys.codeName}",
    "system_name":"${sys.logicName}",
    "module_id":"${de.getPSSystemModule().codeName}",
    "module_name":"${de.getPSSystemModule().name}",
    <#--"ds_id":null,-->
    <#--"ds_name":"",-->
    "fields":[
    <#if de.getPSDEFields()??>
    <#list de.getPSDEFields() as defield>
    {
    "fieldname":"${defield.name}" ,
    "codename":"${defield.codeName}",
    "field_logic_name":"${defield.logicName}",
    "entity_name":"${de.name}",
    <#if defield.getRelatedPSDEField?? && defield.getRelatedPSDEField()??>
    "ref_de":"${defield.getRelatedPSDEField().getPSDataEntity().name}",
    "ref_field_name":"${defield.getRelatedPSDEField().name}",
    </#if>
    <#if (((defield.getDataType())!'')=='PICKUP' || ((defield.getDataType())!'')=='PICKUPDATA' || ((defield.getDataType())!'')=='PICKUPTEXT' ) && defield.getPSDER1N()?? >
    "relation_name":"${defield.getPSDER1N().getName()}",
    "relation_codename":"${defield.getPSDER1N().getCodeName()}",
    </#if>
    "field_type":"${defield.getDataType()}",
    <#if defield.getPSCodeList()??>
    "dict":"${defield.getPSCodeList().codeName}",
    </#if>
    "nullable":<#if defield.isAllowEmpty()>1<#else>0</#if>,
    "physical_field":<#if defield.isPhisicalDEField()>1<#else>0</#if>,
    "data_type":"${srfdatatype(defield.getStdDataType())}",
    <#if defield.getLength()?c!='-1'>
    "data_length":${defield.getLength()?c},
    </#if>
    <#if defield.getPrecision()?c!='0'>
    "data_preci":${defield.getPrecision()?c},
    </#if>
    <#if defield.getDefaultPSDEFDTColumn?? && defield.getDefaultPSDEFDTColumn()?? && defield.getDefaultPSDEFDTColumn().isFormula()==true>
    "expression":"${defield.getDefaultPSDEFDTColumn().getFormulaFormat()}",
    </#if>
    <#if defield.getPredefinedType()?? && defield.getPredefinedType()!=''>
    "predefined":"${defield.getPredefinedType()}",
    </#if>
    "key_field":<#if defield.isKeyDEField()==true>1<#else>0</#if>,
    <#if defield.getUnionKeyValue()?? && defield.getUnionKeyValue()!=''>
    "union_key":"${defield.getUnionKeyValue()}",
    </#if>
    <#if defield.getOrderValue?? && defield.getOrderValue()??>
    "show_order":${defield.getOrderValue()?c},
    </#if>
    "major_field":<#if defield.isMajorDEField()==true>1<#else>0</#if>
    }<#if defield_has_next>,</#if>
    </#list>
    </#if>
    ],
    "subEntitys":[
    <#if de.getMinorPSDERs()??>
    <#list de.getMajorPSDERs() as majorPSDER>
    {"name":"${majorPSDER.name}",
     "relation_type":"${majorPSDER.getDERType()}",
     "code_name":"${majorPSDER.getCodeName()}",
     "entity_name":"${majorPSDER.getMinorPSDataEntity().name}",
     "ref_entity_name":"${majorPSDER.getMajorPSDataEntity().name}"
     <#--"nested_name":"",-->
     <#--"lookup":""-->
    }<#if majorPSDER_has_next>,</#if>
    </#list>
    </#if>
    ],
    "parentEntitys":[
    <#if de.getMinorPSDERs()??>
        <#list de.getMinorPSDERs() as minorPSDER>
    {"name":"${minorPSDER.name}",
     "relation_type":"${minorPSDER.getDERType()}",
     "code_name":"${minorPSDER.getCodeName()}",
     "entity_name":"${minorPSDER.getMinorPSDataEntity().name}",
     "ref_entity_name":"${minorPSDER.getMajorPSDataEntity().name}"
     <#--"nested_name":"",-->
     <#--"lookup":""-->
    }<#if minorPSDER_has_next>,</#if>
        </#list>
    </#if>
    ]
 }
    <#if de_has_next>,</#if>
        </#list>
    </#if>
    ]
}
{{/eq}}