<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wangwei  
    $Date: 2015-11-26 下午6:31:30  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
            select t1.* from (
                select a.* 
            from tre_loan_con_quotaion_lv a 
            where a.DOCUMENT_ID=${@loan_contract_id}
             and a.DOCUMENT_CATEGORY in ('LOAN_CONTRACT')) t1 #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
          begin
            sdic_tre_loan_contract_pkg.tre_loan_con_quote_submit(
            p_loan_contract_id =>${@loan_contract_id} ,
            p_widthdrawal_plan_id =>${@widthdrawal_plan_id},
            p_user_id =>${/session/@user_id} );
          end;
          ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
         BEGIN
           SDIC_TRE_LOAN_CONTRACT_PKG.loan_con_withdraw_review(
           p_loan_contract_id =>${@loan_contract_id} ,
            p_quotation_id =>${@quotation_id} ,
             p_user_id =>${/session/@user_id} );
        END;
        ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="delete">
            <bm:update-sql><![CDATA[
         BEGIN
           SDIC_TRE_LOAN_CONTRACT_PKG.delete_loan_con_withdraw(
           p_loan_contract_id =>${@loan_contract_id} ,
            p_quotation_id =>${@quotation_id} ,
             p_user_id =>${/session/@user_id} );
        END;
        ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="main_contract_flag" queryExpression="nvl(t1.main_contract_flag,&apos;N&apos;)=${@main_contract_flag}"/>
    </bm:query-fields>
</bm:model>
