﻿<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>
  <entity name = 'llp_insurancepolicy'>
    <attribute name='llp_insurancepolicyid' />
    <attribute name='llp_name' />
    <attribute name='llp_productid' />
    <attribute name='llp_policynumber' />
    <attribute name='llp_customerid' />
    <attribute name='llp_policystatus_public' />
    <attribute name='llp_annualpremium' />
    <attribute name='llp_monthlypremium' />
    <attribute name='llp_duedate' />
    <attribute name='llp_pastdueposum' />
    <attribute name='llp_paymethod' />
    <attribute name='llp_policystatus_public' />
    <attribute name='llp_payperiod' />
    <attribute name='statuscode' />
    <attribute name='createdon' />
    <order attribute='llp_customerid' descending='false' />
    <filter type='and'>
      <condition attribute='llp_policynumber' operator='eq' value='${policyNr}' />
    </filter>
    <link-entity name='llp_insuredobjectanimal' from='llp_insurancepolicyid' to='llp_insurancepolicyid' visible='false' link-type='outer' alias='animal'>
      <attribute name='llp_name' />
    </link-entity>
    <link-entity name='contact' from='contactid' to='llp_customerid' visible='false' link-type='outer' alias='contact'>
      <attribute name='telephone1' />
    </link-entity>
    <link-entity name='product' from='productid' to='llp_productid' visible='false' link-type='outer' alias='product'>
      <attribute name='name' />
    </link-entity>
  </entity>
</fetch>