<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: lingfeng.chen  
    $Date: 2016-3-1 下午2:55:01  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="CON_CONTRACT_CONTENT_FILE">
    <bm:operations>
        <!-- <bm:operation name="delete">
            <bm:update-sql><![CDATA[
    	BEGIN
    	    con_contract_file_pck.delete_con_contract_file_line(p_contract_id => ${@contract_id});
    	END;
	]]></bm:update-sql>
        </bm:operation> -->
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
    	begin

 
  -- Call the procedure
  con_contract_file_pck.get_all_contract_file(p_contract_id => ${@contract_id},
                                              p_project_id => ${@project_id},
                                              p_proposal_id => ${@proposal_id},
                                              p_quotation_id => ${@quotation_id},
                                              p_cdd_list_id => ${@cdd_list_id},
                                              p_pps_cdd_list_id => ${@pps_cdd_list_id},
                                              p_user_id => ${/session/@user_id});
end;

                                                
	]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="file_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FILE_ID" prompt="CON_CONTRACT_CONTENT_FILE.FILE_ID"/>
        <bm:field name="file_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_CODE" prompt="CON_CONTRACT_CONTENT_FILE.FILE_CODE"/>
        <bm:field name="file_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_NAME" prompt="CON_CONTRACT_CONTENT_FILE.FILE_NAME"/>
        <bm:field name="file_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_FLAG" prompt="CON_CONTRACT_CONTENT_FILE.FILE_FLAG"/>
        <bm:field name="file_note" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_NOTE" prompt="CON_CONTRACT_CONTENT_FILE.FILE_NOTE"/>
        <bm:field name="file_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_TYPE" prompt="CON_CONTRACT_CONTENT_FILE.FILE_TYPE"/>
        <bm:field name="clause_usage" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CLAUSE_USAGE" prompt="CON_CONTRACT_CONTENT_FILE.CLAUSE_USAGE"/>
        <bm:field name="file_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FILE_BY" prompt="CON_CONTRACT_CONTENT_FILE.FILE_BY"/>
        <bm:field name="file_date" databaseType="DATE" datatype="java.util.Date" physicalName="FILE_DATE" prompt="CON_CONTRACT_CONTENT_FILE.FILE_DATE"/>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="CON_CONTRACT_CONTENT_FILE.CONTRACT_ID"/>
        <bm:field name="swift_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SWIFT_NUM" prompt="CON_CONTRACT_CONTENT_FILE.SWIFT_NUM"/>
        <bm:field name="save_table" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SAVE_TABLE" prompt="CON_CONTRACT_CONTENT_FILE.SAVE_TABLE"/>
        <bm:field name="save_table_pk" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SAVE_TABLE_PK" prompt="CON_CONTRACT_CONTENT_FILE.SAVE_TABLE_PK"/>
        <bm:field name="paper_required" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAPER_REQUIRED" prompt="CON_CONTRACT_CONTENT_FILE.PAPER_REQUIRED"/>
        <bm:field name="attachment_required" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ATTACHMENT_REQUIRED" prompt="CON_CONTRACT_CONTENT_FILE.ATTACHMENT_REQUIRED"/>
        <bm:field name="not_applicable" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NOT_APPLICABLE" prompt="CON_CONTRACT_CONTENT_FILE.NOT_APPLICABLE"/>
        <bm:field name="file_save_table" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_SAVE_TABLE" prompt="CON_CONTRACT_CONTENT_FILE.FILE_SAVE_TABLE"/>
        <bm:field name="sign_date" databaseType="DATE" datatype="java.util.Date" physicalName="SIGN_DATE" prompt="CON_CONTRACT_CONTENT_FILE.SIGN_DATE"/>
        <bm:field name="need_file_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NEED_FILE_FLAG" prompt="CON_CONTRACT_CONTENT_FILE.NEED_FILE_FLAG"/>
        <bm:field name="file_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_STATUS" prompt="CON_CONTRACT_CONTENT_FILE.FILE_STATUS"/>
        <bm:field name="file_by_n" expression="(SELECT name FROM exp_employees ee WHERE ee.employee_id = t1.file_by                             )" forInsert="false" forUpdate="false"/>
        <bm:field name="content_print_flag" databaseType="VARCHAR2" datatype="java.lang.String"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="file_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="contract_id" queryOperator="="/>
    </bm:query-fields>
</bm:model>
