<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-9-24 下午04:28:37  
    $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
			  con_contract_change_req_pkg.insert_con_change_req(
			              p_change_req_id=>${@change_req_id},
			              p_batch_id=>${@batch_id},
			              p_change_req_number=>${@change_req_number},
			              p_document_type=>${@document_type},
			              p_document_category=>${@document_category},
			              p_business_type=>${@business_type},
			              p_company_id=>${/session/@company_id},
			              p_contract_id=>${@contract_id},
			              p_req_status=>${@req_status},
			              p_req_date=>to_date(${@req_date},'yyyy-mm-dd hh24:mi:ss'),
			              p_change_req_profile=>${@change_req_profile},
			              p_reschedule_start_date=>to_date(${@reschedule_start_date},'yyyy-mm-dd hh24:mi:ss'),
			              p_reschedule_start_times=>${@reschedule_start_times},
			              p_reschedule_new_date=>to_date(${@reschedule_new_date},'yyyy-mm-dd hh24:mi:ss'),
			              p_reschedule_total_times=>${@reschedule_total_times},
			              p_reschedule_last_time=>${@reschedule_last_time},
			              p_reschedule_balance=>${@reschedule_balance},
			              p_reschedule_direction=>${@reschedule_direction},
			              p_reschedule_days=>${@reschedule_days},
			              p_reschedule_fee=>${@reschedule_fee},
			              p_calculate_rate=>${@calculate_rate},
			              p_termination_date=>to_date(${@termination_date},'yyyy-mm-dd hh24:mi:ss'),
			              p_overdue_amount=>${@overdue_amount},
			              p_penalty=>${@penalty},
			              p_rentals_payable=>${@rentals_payable},
			              p_discount_total_amount=>${@discount_total_amount},
			              p_undue_principal=>${@undue_principal},
			              p_et_interest=>${@et_interest},
			              p_mgt_fee_after_discount=>${@mgt_fee_after_discount},
			              p_et_fee=>${@et_fee},
			              p_residual_value=>${@residual_value},
			              p_et_total_amount=>${@et_total_amount},
			              p_last_paydue_date=>to_date(${@last_paydue_date},'yyyy-mm-dd hh24:mi:ss'),
			              p_last_paydue_times=>${@last_paydue_times},
			              p_discount_days=>${@discount_days},
			              p_submit_date=>to_date(${@submit_date},'yyyy-mm-dd hh24:mi:ss'),
			              p_approved_date=>to_date(${@approved_date},'yyyy-mm-dd hh24:mi:ss'),
			              p_description=>${@description},
			              p_calc_session_id=>${@calc_session_id},
                          p_wfl_instance_id=>${@wfl_instance_id},
			              p_user_id=>${/session/@user_id},
			              p_ref_v01=>${@ref_v01},
			              p_ref_v02=>${@ref_v02},
			              p_ref_v03=>${@ref_v03},
			              p_ref_v04=>${@ref_v04},
			              p_ref_v05=>${@ref_v05},
			              p_ref_v06=>${@ref_v06},
			              p_ref_v07=>${@ref_v07},
			              p_ref_v08=>${@ref_v08},
			              p_ref_v09=>${@ref_v09},
			              p_ref_v10=>${@ref_v10},
			              p_ref_n01=>${@ref_n01},
			              p_ref_n02=>${@ref_n02},
			              p_ref_n03=>${@ref_n03},
			              p_ref_n04=>${@ref_n04},
			              p_ref_n05=>${@ref_n05},
			              p_ref_n06=>${@ref_n06},
			              p_ref_n07=>${@ref_n07},
			              p_ref_n08=>${@ref_n08},
			              p_ref_n09=>${@ref_n09},
			              p_ref_n10=>${@ref_n10},
			              p_ref_d01=>to_date(${@ref_d01},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d02=>to_date(${@ref_d02},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d03=>to_date(${@ref_d03},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d04=>to_date(${@ref_d04},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d05=>to_date(${@ref_d05},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d06=>to_date(${@ref_d06},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d07=>to_date(${@ref_d07},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d08=>to_date(${@ref_d08},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d09=>to_date(${@ref_d09},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d10=>to_date(${@ref_d10},'yyyy-mm-dd hh24:mi:ss'));
			end;
            ]]></bm:update-sql>
            <bm:parameters>
                <bm:parameter name="change_req_id" dataType="java.lang.Long" output="true" outputPath="@change_req_id"/>
            </bm:parameters>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
            begin
			  con_contract_change_req_pkg.update_con_change_req(
			              p_change_req_id=>${@change_req_id},
			              p_batch_id=>${@batch_id},
			              p_change_req_number=>${@change_req_number},
			              p_document_type=>${@document_type},
			              p_document_category=>${@document_category},
			              p_business_type=>${@business_type},
			              p_company_id=>${/session/@company_id},
			              p_contract_id=>${@contract_id},
			              p_req_status=>${@req_status},
			              p_req_date=>to_date(${@req_date},'yyyy-mm-dd hh24:mi:ss'),
			              p_change_req_profile=>${@change_req_profile},
			              p_reschedule_start_date=>to_date(${@reschedule_start_date},'yyyy-mm-dd hh24:mi:ss'),
			              p_reschedule_start_times=>${@reschedule_start_times},
			              p_reschedule_new_date=>to_date(${@reschedule_new_date},'yyyy-mm-dd hh24:mi:ss'),
			              p_reschedule_total_times=>${@reschedule_total_times},
			              p_reschedule_last_time=>${@reschedule_last_time},
			              p_reschedule_balance=>${@reschedule_balance},
			              p_reschedule_direction=>${@reschedule_direction},
			              p_reschedule_days=>${@reschedule_days},
			              p_reschedule_fee=>${@reschedule_fee},
			              p_calculate_rate=>${@calculate_rate},
			              p_termination_date=>to_date(${@termination_date},'yyyy-mm-dd hh24:mi:ss'),
			              p_overdue_amount=>${@overdue_amount},
			              p_penalty=>${@penalty},
			              p_rentals_payable=>${@rentals_payable},
			              p_discount_total_amount=>${@discount_total_amount},
			              p_undue_principal=>${@undue_principal},
			              p_et_interest=>${@et_interest},
			              p_mgt_fee_after_discount=>${@mgt_fee_after_discount},
			              p_et_fee=>${@et_fee},
			              p_residual_value=>${@residual_value},
			              p_et_total_amount=>${@et_total_amount},
			              p_last_paydue_date=>to_date(${@last_paydue_date},'yyyy-mm-dd hh24:mi:ss'),
			              p_last_paydue_times=>${@last_paydue_times},
			              p_discount_days=>${@discount_days},
			              p_submit_date=>to_date(${@submit_date},'yyyy-mm-dd hh24:mi:ss'),
			              p_approved_date=>to_date(${@approved_date},'yyyy-mm-dd hh24:mi:ss'),
			              p_description=>${@description},
			              p_calc_session_id=>${@calc_session_id},
                          p_wfl_instance_id=>${@wfl_instance_id},
			              p_user_id=>${/session/@user_id},
			              p_ref_v01=>${@ref_v01},
			              p_ref_v02=>${@ref_v02},
			              p_ref_v03=>${@ref_v03},
			              p_ref_v04=>${@ref_v04},
			              p_ref_v05=>${@ref_v05},
			              p_ref_v06=>${@ref_v06},
			              p_ref_v07=>${@ref_v07},
			              p_ref_v08=>${@ref_v08},
			              p_ref_v09=>${@ref_v09},
			              p_ref_v10=>${@ref_v10},
			              p_ref_n01=>${@ref_n01},
			              p_ref_n02=>${@ref_n02},
			              p_ref_n03=>${@ref_n03},
			              p_ref_n04=>${@ref_n04},
			              p_ref_n05=>${@ref_n05},
			              p_ref_n06=>${@ref_n06},
			              p_ref_n07=>${@ref_n07},
			              p_ref_n08=>${@ref_n08},
			              p_ref_n09=>${@ref_n09},
			              p_ref_n10=>${@ref_n10},
			              p_ref_d01=>to_date(${@ref_d01},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d02=>to_date(${@ref_d02},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d03=>to_date(${@ref_d03},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d04=>to_date(${@ref_d04},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d05=>to_date(${@ref_d05},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d06=>to_date(${@ref_d06},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d07=>to_date(${@ref_d07},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d08=>to_date(${@ref_d08},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d09=>to_date(${@ref_d09},'yyyy-mm-dd hh24:mi:ss'),
			              p_ref_d10=>to_date(${@ref_d10},'yyyy-mm-dd hh24:mi:ss'));
			end;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
