<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Mr.Li  
    $Date: 2016-1-26 上午10:16:36  
    $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="SDIC_CON_VISIT_REPORT_BATCH" defaultOrderBy="batch_number desc">
    <bm:fields>
        <bm:field name="batch_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BATCH_ID" prompt="SDIC_CON_VISIT_REPORT_BATCH.BATCH_ID"/>
        <bm:field name="batch_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BATCH_NUMBER" prompt="SDIC_CON_VISIT_REPORT_BATCH.BATCH_NUMBER"/>
        <bm:field name="batch_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BATCH_NAME" prompt="SDIC_CON_VISIT_REPORT_BATCH.BATCH_NAME"/>
        <bm:field name="batch_description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BATCH_DESCRIPTION" prompt="SDIC_CON_VISIT_REPORT_BATCH.BATCH_DESCRIPTION"/>
        <bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STATUS" prompt="SDIC_CON_VISIT_REPORT_BATCH.STATUS"/>
        <bm:field name="visit_date" databaseType="DATE" datatype="java.util.Date" physicalName="VISIT_DATE" prompt="SDIC_CON_VISIT_REPORT_BATCH.VISIT_DATE"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
    </bm:features>
    <bm:operations>
        <bm:operation name="insert">
            <bm:update-sql><![CDATA[
                BEGIN
                    con_visit_report_pkg.CON_VISIT_REPORT_BATCH_INSERT(P_BATCH_NAME => ${@batch_name}, 
                    P_BATCH_DESCRIPTION => ${@batch_description}, 
                    P_VISIT_DATE => ${@visit_date}, 
                    P_STATUS => ${@status}, 
                    p_user_id =>${/session/@user_id},
                    p_company_id =>${/session/@company_id}
                    );
                END;
            ]]></bm:update-sql>
            <bm:parameters>
                <!--        <bm:parameter name="cdd_list_id" output="true" outputPath="@cdd_list_id"/> --><![CDATA[
                
                
                
                
                
                
         
            ]]></bm:parameters>
        </bm:operation>
    </bm:operations>
    <bm:primary-key>
        <bm:pk-field name="batch_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="batch_id" queryOperator="="/>
        <bm:query-field field="batch_number" queryOperator="like"/>
        <bm:query-field field="status" queryOperator="="/>
    </bm:query-fields>
</bm:model>
