<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hp  
    $Date: 2015-4-1 下午12:00:57  
    $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 1 from dual]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="insert">
            <bm:parameters>
                <bm:parameter name="policy_id" output="true" outputPath="/parameter/@policy_id"/>
            </bm:parameters>
            <bm:update-sql><![CDATA[ 
       
                begin
                ins_insurance_policy_pkg.insert_insurance_policy(p_policy_id       =>${@policy_id},
							                                    p_valid_from       =>to_date(${@valid_from},'yyyy-mm-dd'),
							                                    p_valid_to         =>to_date(${@valid_to},'yyyy-mm-dd'),
							                                    p_policy_number    =>${@policy_number},
							                                    p_insure_class     =>${@insure_class},
							                                    p_endorsement_desc =>${@endorsement_desc},
							                                    p_surrender_account =>${@surrender_account},
							                                    p_surrender_value   =>${@surrender_value},
							                                    p_surrender_date    =>to_date(${@surrender_date},'yyyy-mm-dd'),
							                                    p_note              =>${@note},
							                                    p_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
                ins_insurance_policy_pkg.update_insurance_policy(p_policy_id       =>${@policy_id},
							                                    p_valid_from       =>to_date(${@valid_from},'yyyy-mm-dd'),
							                                    p_valid_to         =>to_date(${@valid_to},'yyyy-mm-dd'),
							                                    p_policy_number    =>${@policy_number},
							                                    p_insure_class     =>${@insure_class},
							                                    p_endorsement_desc =>${@endorsement_desc},
							                                    p_surrender_account =>${@surrender_account},
							                                    p_surrender_value   =>${@surrender_value},
							                                    p_surrender_date    =>to_date(${@surrender_date},'yyyy-mm-dd'),
							                                    p_note              =>${@note},
							                                    p_user_id           =>${/session/@user_id});
			end;  
               ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
