<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: xuls 
    $Date: 2017-4-13 下午04:24:11  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                select 
             faa.file_name,faa.file_path,(cc.contract_number||'-'||cc.dd_bank_account_name||'-'||faa.file_name) file_name2
           from prj_cdd_item pc,prj_cdd_item_doc_ref dr,prj_cdd_item_check pic,
           fnd_atm_attachment faa,fnd_atm_attachment_multi fam,con_contract cc
           where dr.document_table = 'CON_CONTRACT'          
           and dr.check_id = pic.check_id
           and cc.contract_id = dr.document_id
           and pc.cdd_item_id = pic.cdd_item_id
           and pc.cdd_item = 'BANK_AGR'
           and fam.table_name = 'PRJ_CDD_ITEM_CHECK'
           and fam.table_pk_value = pic.check_id
           and fam.attachment_id=faa.attachment_id
           and cc.data_class = 'NORMAL'
           and cc.contract_number  in (select l.contract_number from hls_ebank_boc_entrusts_tmp l where l.batch_id = ${/session/@session_id})
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="file_name" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="file_path" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="file_name2" databaseType="VARCHAR2" datatype="java.lang.String"/>
    </bm:fields>
</bm:model>
