<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:fields>
        <bm:field name="contract_id"/>
        <bm:field name="bp_name"/>
        <bm:field name="bp_class"/>
        <bm:field name="bp_category"/>
        <bm:field name="bp_category_n"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
select t1.contract_id,
(select t2.bp_name from hls_bp_master t2 where t2.bp_id = t1.bp_id) as bp_name,
(select t2.bp_class from hls_bp_master t2 where t2.bp_id = t1.bp_id) as bp_class,
       t1.bp_category as bp_category,
       t1.bp_category_n
  from con_contract_bp_lv t1
 where t1.bp_category in ('TENANT', 'GUARANTOR')
   and t1.contract_id = ${@contract_id}]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
