<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qwm  
    $Date: 2013-12-21 下午4:09:36  
    $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 pci.description,pci.cdd_item,pck.paper_required,pck.attachment_required,pci.note,(select t.confirm_note from con_contract_payment_t_check t where t.contract_id = ${@contract_id} and pci.cdd_item_id = t.cdd_item_id) confirm_note
          from prj_cdd_item_doc_ref       pcf,
               prj_cdd_item_check         pck,
               con_contract_payment_terms t,
               prj_cdd_item               pci,
               con_contract_payment_t_check c
         where pcf.document_table = 'CON_CONTRACT'
           and pcf.document_id = ${@contract_id}
           and pck.check_id = pcf.check_id
           and nvl(pck.attachment_required,'N') <> 'Y'
           and pck.cdd_item_id = t.cdd_item_id
           and t.cdd_item_id=pci.cdd_item_id
           and t.cdd_item_id =c.cdd_item_id(+)
           and nvl(c.confirm_flag,'N') ='N' 
           and t.cashflow_id = ${@cashflow_id}]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION"/>
        <bm:field name="cdd_item" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CDD_ITEM" required="true"/>
        <bm:field name="paper_required" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAPER_REQUIRED"/>
        <bm:field name="attachment_required" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ATTACHMENT_REQUIRED"/>
        <bm:field name="note" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NOTE"/>
        <bm:field name="confirm_note" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONFIRM_NOTE"/>
    </bm:fields>
</bm:model>
