<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hp  
    $Date: 2014-12-5 下午12:06:40  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[  
               begin
                leg_legal_pkg.create_letter_ln(p_letter_hd_id  =>${../../@letter_hd_id},
                             p_contract_id   =>${@contract_id},
                             p_batch_id   =>${/session/@session_id},
                             p_user_id     =>${/session/@user_id}) ; 
               end;
          ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="execute">
            <bm:parameters>
                <bm:parameter name="letter_hd_id" output="true" outputPath="/parameter/@letter_hd_id"/>
            </bm:parameters>
            <bm:update-sql><![CDATA[
               begin
                leg_legal_pkg.create_letter_hd(p_user_id     =>${/session/@user_id},
                							 p_batch_id   =>${/session/@session_id},
				                             p_desc         =>null,
				                             p_letter_hd_id   =>${@letter_hd_id});
               end;
          ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="delete">
            <bm:update-sql><![CDATA[  
               begin
                leg_legal_pkg.delete_letter_tmp(p_batch_id  =>${/session/@session_id}); 
               end;
          ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
