<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qm  
    $Date: 2014-4-21 上午10:00:36  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:e="leaf.service.exception" xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="AST_CON_INSURANCE">
    <bm:fields>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" insertExpression="${/parameter/@contract_id}" physicalName="CONTRACT_ID" prompt="AST_CON_INSURANCE.CONTRACT_ID"/>
        <bm:field name="ast_con_car_insurance_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AST_CON_CAR_INSURANCE_ID" prompt="AST_CON_INSURANCE.AST_CON_CAR_INSURANCE_ID"/>
        <bm:field name="item_detail_id" databaseType="NUMBER" datatype="java.lang.Long" insertExpression="${/parameter/@item_detail_id}" physicalName="ITEM_DETAIL_ID" prompt="AST_CON_INSURANCE.ITEM_DETAIL_ID"/>
        <bm:field name="bp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID" prompt="AST_CON_INSURANCE.BP_ID"/>
        <bm:field name="insurance_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_NUMBER" prompt="AST_CON_INSURANCE.INSURANCE_NUMBER"/>
        <bm:field name="insurance_description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_DESCRIPTION" prompt="AST_CON_INSURANCE.INSURANCE_DESCRIPTION"/>
        <bm:field name="insure_date" databaseType="DATE" datatype="java.util.Date" physicalName="INSURE_DATE" prompt="AST_CON_INSURANCE.INSURE_DATE"/>
        <bm:field name="insurance_date_from" databaseType="DATE" datatype="java.util.Date" physicalName="INSURANCE_DATE_FROM" prompt="AST_CON_INSURANCE.INSURANCE_DATE_FROM"/>
        <bm:field name="insurance_date_to" databaseType="DATE" datatype="java.util.Date" physicalName="INSURANCE_DATE_TO" prompt="AST_CON_INSURANCE.INSURANCE_DATE_TO"/>
        <bm:field name="insurance_year" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INSURANCE_YEAR" prompt="AST_CON_INSURANCE.INSURANCE_YEAR"/>
        <bm:field name="compulsory_insurance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPULSORY_INSURANCE_AMOUNT" prompt="AST_CON_INSURANCE.COMPULSORY_INSURANCE_AMOUNT"/>
        <bm:field name="commercial_insurance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMMERCIAL_INSURANCE_AMOUNT" prompt="AST_CON_INSURANCE.COMMERCIAL_INSURANCE_AMOUNT"/>
        <bm:field name="damage_insurance_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DAMAGE_INSURANCE_FLAG" prompt="AST_CON_INSURANCE.DAMAGE_INSURANCE_FLAG"/>
        <bm:field name="third_party_insurance_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="THIRD_PARTY_INSURANCE_FLAG" prompt="AST_CON_INSURANCE.THIRD_PARTY_INSURANCE_FLAG"/>
        <bm:field name="pilfer_insurance_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PILFER_INSURANCE_FLAG" prompt="AST_CON_INSURANCE.PILFER_INSURANCE_FLAG"/>
        <bm:field name="basic_non_deductible_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BASIC_NON_DEDUCTIBLE_FLAG" prompt="AST_CON_INSURANCE.BASIC_NON_DEDUCTIBLE_FLAG"/>
        <bm:field name="glass_insurance_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="GLASS_INSURANCE_FLAG" prompt="AST_CON_INSURANCE.GLASS_INSURANCE_FLAG"/>
        <bm:field name="seat_insurance_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SEAT_INSURANCE_FLAG" prompt="AST_CON_INSURANCE.SEAT_INSURANCE_FLAG"/>
        <bm:field name="combustion_insurance_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMBUSTION_INSURANCE_FLAG" prompt="AST_CON_INSURANCE.COMBUSTION_INSURANCE_FLAG"/>
        <bm:field name="add_non_deductible_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ADD_NON_DEDUCTIBLE_FLAG" prompt="AST_CON_INSURANCE.ADD_NON_DEDUCTIBLE_FLAG"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="AST_CON_INSURANCE.REF_V01"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="AST_CON_INSURANCE.REF_V02"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03" prompt="AST_CON_INSURANCE.REF_V03"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04" prompt="AST_CON_INSURANCE.REF_V04"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05" prompt="AST_CON_INSURANCE.REF_V05"/>
        <bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N01" prompt="AST_CON_INSURANCE.REF_N01"/>
        <bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N02" prompt="AST_CON_INSURANCE.REF_N02"/>
        <bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N03" prompt="AST_CON_INSURANCE.REF_N03"/>
        <bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N04" prompt="AST_CON_INSURANCE.REF_N04"/>
        <bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N05" prompt="AST_CON_INSURANCE.REF_N05"/>
        <bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01" prompt="AST_CON_INSURANCE.REF_D01"/>
        <bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02" prompt="AST_CON_INSURANCE.REF_D02"/>
        <bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03" prompt="AST_CON_INSURANCE.REF_D03"/>
        <bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04" prompt="AST_CON_INSURANCE.REF_D04"/>
        <bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05" prompt="AST_CON_INSURANCE.REF_D05"/>
        <bm:field name="compulsory_rebate_rate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPULSORY_REBATE_RATE" prompt="AST_CON_INSURANCE.COMPULSORY_REBATE_RATE"/>
        <bm:field name="combustion_rebate_rate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMBUSTION_REBATE_RATE" prompt="AST_CON_INSURANCE.COMBUSTION_REBATE_RATE"/>
        <bm:field name="compulsory_rebate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPULSORY_REBATE" prompt="AST_CON_INSURANCE.COMPULSORY_REBATE"/>
        <bm:field name="combustion_rebate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMBUSTION_REBATE" prompt="AST_CON_INSURANCE.COMBUSTION_REBATE"/>
        <bm:field name="insure_place" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURE_PLACE" prompt="AST_CON_INSURANCE.INSURE_PLACE"/>
        <bm:field name="insure_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURE_NAME" prompt="AST_CON_INSURANCE.INSURE_NAME"/>
        <bm:field name="first_beneficiary" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FIRST_BENEFICIARY" prompt="AST_CON_INSURANCE.FIRST_BENEFICIARY"/>
        <bm:field name="insurance_party" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_PARTY" prompt="AST_CON_INSURANCE.INSURANCE_PARTY"/>
        <bm:field name="damage_insurance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DAMAGE_INSURANCE_AMOUNT" prompt="AST_CON_INSURANCE.DAMAGE_INSURANCE_AMOUNT"/>
        <bm:field name="third_party_insurance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="THIRD_PARTY_INSURANCE_AMOUNT" prompt="AST_CON_INSURANCE.THIRD_PARTY_INSURANCE_AMOUNT"/>
        <bm:field name="basic_non_deductible_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BASIC_NON_DEDUCTIBLE_AMOUNT" prompt="AST_CON_INSURANCE.BASIC_NON_DEDUCTIBLE_AMOUNT"/>
        <bm:field name="pilfer_insurance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PILFER_INSURANCE_AMOUNT" prompt="AST_CON_INSURANCE.PILFER_INSURANCE_AMOUNT"/>
        <bm:field name="commercial_insurance_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMMERCIAL_INSURANCE_FLAG" prompt="AST_CON_INSURANCE.COMMERCIAL_INSURANCE_FLAG"/>
        <bm:field name="document_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_STATUS" prompt="AST_CON_INSURANCE.DOCUMENT_STATUS"/>
        <bm:field name="document_status_n" expression="(select v.code_value_name from sys_code_values_v v where v.code=&apos;AST_INSURANCE_DOCUMENT_STATUS&apos; and t1.document_status=v.code_value)" forInsert="false" forUpdate="false"/>
        <bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE" prompt="AST_CON_INSURANCE.DOCUMENT_TYPE"/>
        <bm:field name="document_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_CATEGORY" prompt="AST_CON_INSURANCE.DOCUMENT_CATEGORY"/>
        <bm:field name="wfl_instance_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WFL_INSTANCE_ID" prompt="AST_CON_INSURANCE.WFL_INSTANCE_ID"/>
        <bm:field name="payment_finish_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAYMENT_FINISH_FLAG" prompt="AST_CON_INSURANCE.PAYMENT_FINISH_FLAG"/>
        <bm:field name="glass_insurance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="GLASS_INSURANCE_AMOUNT" prompt="AST_CON_INSURANCE.GLASS_INSURANCE_AMOUNT"/>
        <bm:field name="seat_insurance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SEAT_INSURANCE_AMOUNT" prompt="AST_CON_INSURANCE.SEAT_INSURANCE_AMOUNT"/>
        <bm:field name="combustion_insurance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMBUSTION_INSURANCE_AMOUNT" prompt="AST_CON_INSURANCE.COMBUSTION_INSURANCE_AMOUNT"/>
        <bm:field name="insurance_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_TYPE" prompt="AST_CON_INSURANCE.INSURANCE_TYPE"/>
        <bm:field name="others_insurance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OTHERS_INSURANCE_AMOUNT" prompt="AST_CON_INSURANCE.OTHERS_INSURANCE_AMOUNT"/>
        <bm:field name="travel_tax" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TRAVEL_TAX" prompt="AST_CON_INSURANCE.TRAVEL_TAX"/>
        <bm:field name="protege_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROTEGE_NAME" prompt="AST_CON_INSURANCE.PROTEGE_NAME"/>
        <bm:field name="confirm_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONFIRM_FLAG" prompt="AST_CON_INSURANCE.CONFIRM_FLAG"/>
        <bm:field name="insurance_financing" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_FINANCING" prompt="AST_CON_INSURANCE.INSURANCE_FINANCING"/>
        <bm:field name="insurance_company" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_COMPANY" prompt="AST_CON_INSURANCE.INSURANCE_COMPANY"/>
        <bm:field name="tci_place" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TCI_PLACE" prompt="AST_CON_INSURANCE.TCI_PLACE"/>
        <bm:field name="vci_palce" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VCI_PALCE" prompt="AST_CON_INSURANCE.VCI_PALCE"/>
        <bm:field name="tci_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TCI_TYPE" prompt="AST_CON_INSURANCE.TCI_TYPE"/>
        <bm:field name="vci_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VCI_TYPE" prompt="AST_CON_INSURANCE.VCI_TYPE"/>
        <bm:field name="insurance_pay_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_PAY_TYPE" prompt="AST_CON_INSURANCE.INSURANCE_PAY_TYPE"/>
        <bm:field name="insurance_commission_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_COMMISSION_TYPE" prompt="AST_CON_INSURANCE.INSURANCE_COMMISSION_TYPE"/>
        <bm:field name="insurance_years" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_YEARS" prompt="AST_CON_INSURANCE.INSURANCE_YEARS"/>
        <bm:field name="compulsory_insurance_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMPULSORY_INSURANCE_FLAG" prompt="AST_CON_INSURANCE.COMPULSORY_INSURANCE_FLAG"/>
        <bm:field name="travel_tax_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TRAVEL_TAX_FLAG" prompt="AST_CON_INSURANCE.TRAVEL_TAX_FLAG"/>
        <bm:field name="rot_insurance" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ROT_INSURANCE" prompt="AST_CON_INSURANCE.ROT_INSURANCE"/>
        <bm:field name="wuyou_rot_insurance" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="WUYOU_ROT_INSURANCE" prompt="AST_CON_INSURANCE.WUYOU_ROT_INSURANCE"/>
        <bm:field name="vci_rot_insurance" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VCI_ROT_INSURANCE" prompt="AST_CON_INSURANCE.VCI_ROT_INSURANCE"/>
        <bm:field name="damage_insurance_limit" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DAMAGE_INSURANCE_LIMIT" prompt="AST_CON_INSURANCE.DAMAGE_INSURANCE_LIMIT"/>
        <bm:field name="third_party_insurance" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="THIRD_PARTY_INSURANCE" prompt="AST_CON_INSURANCE.THIRD_PARTY_INSURANCE"/>
        <bm:field name="vehicle_resp_ins_driver" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VEHICLE_RESP_INS_DRIVER" prompt="AST_CON_INSURANCE.VEHICLE_RESP_INS_DRIVER"/>
        <bm:field name="vehicle_resp_ins_passenger" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VEHICLE_RESP_INS_PASSENGER" prompt="AST_CON_INSURANCE.VEHICLE_RESP_INS_PASSENGER"/>
        <bm:field name="nick_insurance" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NICK_INSURANCE" prompt="AST_CON_INSURANCE.NICK_INSURANCE"/>
        <bm:field name="stop_walking_insurance" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STOP_WALKING_INSURANCE" prompt="AST_CON_INSURANCE.STOP_WALKING_INSURANCE"/>
        <bm:field name="glass_insurance" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="GLASS_INSURANCE" prompt="AST_CON_INSURANCE.GLASS_INSURANCE"/>
        <bm:field name="specify_insurance_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SPECIFY_INSURANCE_FLAG" prompt="AST_CON_INSURANCE.SPECIFY_INSURANCE_FLAG"/>
        <bm:field name="wading_drive_insurance" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="WADING_DRIVE_INSURANCE" prompt="AST_CON_INSURANCE.WADING_DRIVE_INSURANCE"/>
        <bm:field name="damage_nopay_insurance_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DAMAGE_NOPAY_INSURANCE_FLAG" prompt="AST_CON_INSURANCE.DAMAGE_NOPAY_INSURANCE_FLAG"/>
        <bm:field name="vehicle_resp_ins_d_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VEHICLE_RESP_INS_D_AMOUNT" prompt="AST_CON_INSURANCE.VEHICLE_RESP_INS_D_AMOUNT"/>
        <bm:field name="vehicle_resp_ins_p_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VEHICLE_RESP_INS_P_AMOUNT" prompt="AST_CON_INSURANCE.VEHICLE_RESP_INS_P_AMOUNT"/>
        <bm:field name="nick_insurance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NICK_INSURANCE_AMOUNT" prompt="AST_CON_INSURANCE.NICK_INSURANCE_AMOUNT"/>
        <bm:field name="stop_walk_insu_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="STOP_WALK_INSU_AMOUNT" prompt="AST_CON_INSURANCE.STOP_WALK_INSU_AMOUNT"/>
        <bm:field name="specify_insurance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SPECIFY_INSURANCE_AMOUNT" prompt="AST_CON_INSURANCE.SPECIFY_INSURANCE_AMOUNT"/>
        <bm:field name="wading_driving_insu_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WADING_DRIVING_INSU_AMOUNT" prompt="AST_CON_INSURANCE.WADING_DRIVING_INSU_AMOUNT"/>
        <bm:field name="damage_nopay_insu_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DAMAGE_NOPAY_INSU_AMOUNT" prompt="AST_CON_INSURANCE.DAMAGE_NOPAY_INSU_AMOUNT"/>
        <bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROJECT_ID" prompt="AST_CON_INSURANCE.PROJECT_ID"/>
        <bm:field name="wading_driving_insurance" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="WADING_DRIVING_INSURANCE" prompt="AST_CON_INSURANCE.WADING_DRIVING_INSURANCE"/>
        <bm:field name="vci_insurance_company" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VCI_INSURANCE_COMPANY" prompt="AST_CON_INSURANCE.VCI_INSURANCE_COMPANY"/>
        <bm:field name="vci_insurance_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VCI_INSURANCE_NUMBER" prompt="AST_CON_INSURANCE.VCI_INSURANCE_NUMBER"/>
        <bm:field name="vci_insurance_date_from" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VCI_INSURANCE_DATE_FROM" prompt="AST_CON_INSURANCE.VCI_INSURANCE_DATE_FROM"/>
        <bm:field name="vci_insurance_date_to" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VCI_INSURANCE_DATE_TO" prompt="AST_CON_INSURANCE.VCI_INSURANCE_DATE_TO"/>
        <bm:field name="vci_ins_under_co" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VCI_INS_UNDER_CO" prompt="AST_CON_INSURANCE.VCI_INS_UNDER_CO"/>
        <bm:field name="link1" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LINK1" prompt="AST_CON_INSURANCE.LINK1"/>
        <bm:field name="tci_insurance_company" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TCI_INSURANCE_COMPANY" prompt="AST_CON_INSURANCE.TCI_INSURANCE_COMPANY"/>
        <bm:field name="tci_insurance_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TCI_INSURANCE_NUMBER" prompt="AST_CON_INSURANCE.TCI_INSURANCE_NUMBER"/>
        <bm:field name="tci_insurance_date_from" databaseType="DATE" datatype="java.util.Date" physicalName="TCI_INSURANCE_DATE_FROM" prompt="AST_CON_INSURANCE.TCI_INSURANCE_DATE_FROM"/>
        <bm:field name="tci_insurance_date_to" databaseType="DATE" datatype="java.util.Date" physicalName="TCI_INSURANCE_DATE_TO" prompt="AST_CON_INSURANCE.TCI_INSURANCE_DATE_TO"/>
        <bm:field name="link2" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LINK2" prompt="AST_CON_INSURANCE.LINK2"/>
        <bm:field name="vci_place" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VCI_PLACE" prompt="AST_CON_INSURANCE.VCI_PLACE"/>
        <bm:field name="vci_place_n" databaseType="VARCHAR2" datatype="java.lang.String" expression="(select p.description   FROM fnd_province p where to_char(p.province_id)=t1.vci_place)" forInsert="false" forUpdate="false"/>
        <bm:field name="tci_place_n" databaseType="VARCHAR2" datatype="java.lang.String" expression="(select p.description   FROM fnd_province p where to_char(p.province_id)=t1.tci_place)" forInsert="false" forUpdate="false"/>
    </bm:fields>
    <bm:primary-key>
        <bm:pk-field name="ast_con_car_insurance_id"/>
    </bm:primary-key>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk sequenceName="AST_CON_INSURANCE_S"/>
    </bm:features>
    <e:exception-descriptor-config>
        <e:exception-descriptor exception="java.sql.SQLException" handleClass="leaf.database.SQLExceptionDescriptor">
            <e:error-message code="1" message="该保单号已经存在,请查证后输入"/>
        </e:exception-descriptor>
    </e:exception-descriptor-config>
    <bm:query-fields>
        <bm:query-field field="contract_id" queryOperator="="/>
    </bm:query-fields>
    <bm:operations>
        <bm:operation name="insert">
            <bm:update-sql><![CDATA[
                DECLARE
                BEGIN
                    INSERT
                    INTO
                        AST_CON_INSURANCE
                        (
                            contract_id,
                            ast_con_car_insurance_id,
                            item_detail_id,
                            vci_insurance_company,
                            commercial_insurance_amount,
                            vci_insurance_number,
                            vci_insurance_date_from,
                            vci_insurance_date_to,
                            vci_place,
                            tci_insurance_company,
                            compulsory_insurance_amount,
                            damage_insurance_amount,
                            third_party_insurance_amount,
                            damage_nopay_insurance_flag,
                            ref_v02,
                            tci_insurance_number,
                            tci_insurance_date_from,
                            tci_insurance_date_to,
                            tci_place,
                            travel_tax,
                            pilfer_insurance_amount,
                            document_status,
                            document_type,
                            document_category,
                            wfl_instance_id,
                            CREATED_BY,
                            CREATION_DATE,
                            LAST_UPDATED_BY,
                            LAST_UPDATE_DATE
                        )
                        VALUES
                        (
                            ${/parameter/@contract_id},
                            AST_CON_INSURANCE_S.NEXTVAL,
                            ${/parameter/@item_detail_id},
                            ${@vci_insurance_company},
                            ${@commercial_insurance_amount},
                            ${@vci_insurance_number},
                            to_date(${@vci_insurance_date_from},'yyyy-mm-dd'),
                            to_date(${@vci_insurance_date_to},'yyyy-mm-dd'),
                            ${@vci_place},
                            ${@tci_insurance_company},
                            ${@compulsory_insurance_amount},
                            ${@damage_insurance_amount},
                            ${@third_party_insurance_amount},
                            ${@damage_nopay_insurance_flag},
                            ${@ref_v02},
                            ${@tci_insurance_number},
                            to_date(${@tci_insurance_date_from},'yyyy-mm-dd'),
                            to_date(${@vci_insurance_date_to},'yyyy-mm-dd'),
                            ${@tci_place},
                            ${@travel_tax},
                            ${@pilfer_insurance_amount},
                            ${@document_status},
                            ${@document_type},
                            ${@document_category},
                            ${@wfl_instance_id},
                            ${/session/@user_id},
                            sysdate,
                            ${/session/@user_id},
                            sysdate
                        )
                        RETURNING ast_con_car_insurance_id
                    INTO
                        ${@ast_con_car_insurance_id};
                END;
            ]]></bm:update-sql>
            <bm:parameters>
                <bm:parameter name="ast_con_car_insurance_id" dataType="java.lang.Long" input="false" output="true" outputPath="@ast_con_car_insurance_id"/>
            </bm:parameters>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
                BEGIN
                    UPDATE
                        ast_con_insurance t1
                    SET
                        t1.item_detail_id               = ${/parameter/@item_detail_id},
                        t1.vci_insurance_company        =${@vci_insurance_company},
                        t1.commercial_insurance_amount  =${@commercial_insurance_amount},
                        t1.vci_insurance_number         =${@vci_insurance_number},
                        t1.vci_insurance_date_from      =to_date(${@vci_insurance_date_from},'yyyy-mm-dd'),
                        t1.vci_insurance_date_to        =to_date(${@vci_insurance_date_to},'yyyy-mm-dd'),
                        t1.vci_place                    =${@vci_place},
                        t1.tci_insurance_company        =${@tci_insurance_company},
                        t1.compulsory_insurance_amount  =${@compulsory_insurance_amount},
                        t1.damage_insurance_amount      =${@damage_insurance_amount},
                        t1.third_party_insurance_amount =${@third_party_insurance_amount},
                        t1.damage_nopay_insurance_flag  =${@damage_nopay_insurance_flag},
                        t1.ref_v02                      =${@ref_v02},
                        t1.tci_insurance_number         =${@tci_insurance_number},
                        t1.tci_insurance_date_from      =to_date(${@tci_insurance_date_from},'yyyy-mm-dd'),
                        t1.tci_insurance_date_to        =to_date(${@tci_insurance_date_to},'yyyy-mm-dd'),
                        t1.tci_place                    =${@tci_place},
                        t1.travel_tax                   =${@travel_tax},
                        t1.pilfer_insurance_amount      =${@pilfer_insurance_amount},
                        t1.LAST_UPDATED_BY              =${/session/@user_id},
                        t1.LAST_UPDATE_DATE             =sysdate
                    WHERE
                        t1.ast_con_car_insurance_id=${@ast_con_car_insurance_id} AND
                        t1.document_status        IN('NEW','CANCEL','REJECTED');
                END;
            ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
            begin
                ast_insurance_wfl_pkg.check_status(
                	p_ast_con_car_insurance_id =>${@ast_con_car_insurance_id},
                    p_user_id                  =>${/session/@user_id});
		    end;
        	]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="delete">
            <bm:update-sql><![CDATA[
            begin
                ast_insurance_wfl_pkg.delete_ast_con(
                	p_ast_con_car_insurance_id =>${@ast_con_car_insurance_id},
                    p_user_id                  =>${/session/@user_id});
		    end;
        	]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
