<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: lingfeng.chen  
    $Date: 2017-7-24 下午8:03:56  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="HN_OTHER_CON_CHANGE_REQ">
    <bm:operations>
        <bm:operation name="delete">
            <bm:update-sql><![CDATA[
         BEGIN
             -- Call the procedure
             sdic_other_contract_pkg.cancel_other_con_change_req(p_new_contract_id => ${@contract_id}, p_user_id => ${/session/@user_id});
         END;
     ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
    begin
     sdic_other_contract_pkg.submit_other_con_change_req(p_new_contract_id => ${@contract_id},
                                                      p_user_id => ${/session/@user_id});
                                                      end;
    ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
        BEGIN
            -- Call the procedure
            sdic_other_contract_pkg.create_other_con_change_req(
            p_contract_id => ${@contract_id}, 
            p_req_date => to_date(${@req_date},'yyyy-mm-dd'), 
            p_description => ${@description} , 
            p_user_id => ${/session/@user_id}, 
            p_change_req_id => ${@change_req_id},
            p_new_contract_id => ${@new_contract_id});
        END;
    ]]></bm:update-sql>
            <bm:parameters>
                <bm:parameter name="change_req_id" input="true" output="true"/>
                <bm:parameter name="new_contract_id" input="true" output="true"/>
            </bm:parameters>
        </bm:operation>
    </bm:operations>
</bm:model>
