<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:fields>
        <bm:field name="contract_id" databaseType="number" datatype="java.lang.Long" physicalName="contract_id"/>
        <bm:field name="session_id" databaseType="number" datatype="java.lang.Long" physicalName="session_id"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="contract_number"/>
        <bm:field name="cdd_list_id"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                  t.contract_id,
                  t.contract_number,
                  (select cc.cdd_list_id from con_contract cc where cc.contract_id = t.contract_id) cdd_list_id, 
                  t.session_id
                FROM
                    con_batch_download_attch_temp t
                WHERE
                    t.session_id = ${@session_id}
            ]]></bm:query-sql>
            <bm:parameters>
                <bm:parameter name="session_id"/>
            </bm:parameters>
        </bm:operation>
    </bm:operations>
</bm:model>
