<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: LR  
    $Date: 2013-8-14 下午07:32:53  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="insert">
            <bm:update-sql><![CDATA[ 
            	begin
            		${@change_req_number} := con_contract_reschedule_pkg.get_change_req_number(p_document_type => ${@document_type},
            										p_document_category => ${@document_category},
                                                    p_company_id    => ${/session/@company_id},
                                                    p_user_id       =>${/session/@user_id});
                    con_contract_reschedule_pkg.get_reschedule_balance(p_contract_id           => ${@contract_id},
				                                                     p_reschedule_start_times => ${@reschedule_start_times},
				                                                     p_int_rate_display      => ${@calculate_rate},
				                                                     p_calculate_object      =>${@calculate_object},
				                                                     p_reschedule_start_date =>to_date(${@reschedule_start_date},'yyyy-mm-dd'),
				                                                     p_reschedule_new_date   =>to_date(${@reschedule_new_date},'yyyy-mm-dd'),
				                                                     p_reschedule_last_time  =>${@reschedule_last_time},
				                                                     p_reschedule_balance    =>${@reschedule_balance},
				                                                     p_reschedule_fee        =>${@reschedule_fee},
				                                                     p_reschedule_total_times => ${@reschedule_total_times},
				                                                     p_reschedule_direction  => ${@reschedule_direction},
				                                                     p_reschedule_days	=>	${@reschedule_days},
				                                                     p_user_id               =>${/session/@user_id});
            	end;
            ]]></bm:update-sql>
            <bm:parameters>
                <bm:parameter name="change_req_number" output="true" outputPath="@change_req_number"/>
                <bm:parameter name="reschedule_direction" output="true" outputPath="@reschedule_direction"/>
                <bm:parameter name="reschedule_fee" dataType="java.lang.Double" output="true" outputPath="@reschedule_fee"/>
                <bm:parameter name="reschedule_balance" dataType="java.lang.Double" output="true" outputPath="@reschedule_balance"/>
                <bm:parameter name="reschedule_total_times" dataType="java.lang.Long" output="true" outputPath="@reschedule_total_times"/>
                <bm:parameter name="reschedule_days" dataType="java.lang.Long" output="true" outputPath="@reschedule_days"/>
            </bm:parameters>
        </bm:operation>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
                BEGIN
                    ${@batch_id} := con_change_req_batch_s.nextval;
                END;
            ]]></bm:update-sql>
            <bm:parameters>
                <bm:parameter name="batch_id" output="true" outputPath="@batch_id"/>
            </bm:parameters>
        </bm:operation>
    </bm:operations>
</bm:model>
