<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hp  
    $Date: 2015-2-4 下午6:29:21  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <!--测试-->
        <bm:operation name="update">
            <bm:parameters>
                <bm:parameter name="xml" databaseType="VARCHAR2" datatype="java.lang.String" output="true" outputPath="/parameter/@xml"/>
            </bm:parameters>
            <bm:update-sql><![CDATA[
                declare
                 v_xml varchar2(32767);
                begin
                  v_xml := ds_doodream_pkg.approveline_1(
                    p_user_id => ${@dd_user_id},
                    p_org_id  => ${@dd_org_id}
                   );
                  ${@xml} := v_xml;
                end;
                ]]>
            </bm:update-sql>
        </bm:operation>

        <bm:operation name="execute">
            <bm:parameters>
                <bm:parameter name="xml" databaseType="VARCHAR2" datatype="java.lang.String" output="true" outputPath="/parameter/@xml"/>
            </bm:parameters>
            <bm:update-sql><![CDATA[
                declare
                v_xml varchar2(32767);
                begin
                v_xml := ds_doodream_pkg.submit_approveline(
                    p_contract_id           =>${@contract_id},
                    p_record_id             =>${@record_id},
                    p_key_value             =>${@interface_name},
                    p_user_id               =>${/session/@user_id}
                );
                ${@xml} := v_xml;
                end;
                ]]>
            </bm:update-sql>
        </bm:operation>


        <bm:operation name="insert">
            <bm:update-sql><![CDATA[
             BEGIN
                 UPDATE HLS_FIN_CALCULATOR_HD h
                   SET h.price_list = (select c.price_list from con_contract c where c.contract_id = ${@contract_id})
                 WHERE H.CALC_SESSION_ID = ${@calc_session_id};
                UPDATE HLS_FIN_CALCULATOR_HD_FORMULA h
                   SET h.price_list = (select c.price_list from con_contract c where c.contract_id = ${@contract_id})
                 WHERE H.CALC_SESSION_ID = ${@calc_session_id};
             END;
            ]]>
            </bm:update-sql>
        </bm:operation>


    </bm:operations>
</bm:model>
