<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    cc.contract_id,
                    cc.contract_number,
                    cc.contract_name,
                    hbm.bp_name
                    ||
                    (SELECT
                        '、'
                        || ccb.bp_name
                    FROM
                        con_contract_bp ccb
                    WHERE
                        ccb.contract_id = cc.contract_id AND
                        ccb.bp_type     = 'TENANT_SEC'
                    ) bp_name,
                    pqv.quotation_id,
                    pqv.contract_seq,
                    pqv.version,
                    pqv.quotation_type,
                    pqv.quotation_type_name,
                    pqv.price_list,
                    pqv.price_list_name,
                    pqv.calc_session_id,
                    pqv.document_category
                FROM
                    con_contract cc,
                    prj_quotation_v pqv,
                    hls_bp_master hbm
                WHERE
                    cc.data_class   = 'NORMAL' AND
                    cc.quotation_id = pqv.quotation_id AND
                    cc.bp_id_tenant = hbm.bp_id AND
                    cc.contract_id  =${@contract_id}
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
