<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-6-3 下午5:52:41  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="LCH_LEASE_CHANCE_HDS">
    <bm:fields>
        <bm:field name="lease_chance_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_CHANCE_ID"/>
        <bm:field name="lease_chance_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANCE_CODE" prompt="HLS.LEASE_CHANCE_CODE"/>
        <bm:field name="check_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CHECK_FLAG" prompt="HLS.CHECK_FLAG"/>
        <bm:field name="check_flag_desc" forInsert="false" forUpdate="false" prompt="HLS.CHECK_FLAG"/>
        <bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE"/>
        <bm:field name="document_type_desc" forInsert="false" forUpdate="false" prompt="HLS.BUSINESS_TYPE"/>
        <bm:field name="document_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_CATEGORY"/>
        <bm:field name="document_category_desc" forInsert="false" forUpdate="false" prompt="HLS.DOCUMENT_CATEGORY"/>
        <bm:field name="business_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE"/>
        <bm:field name="business_type_desc" forInsert="false" forUpdate="false" prompt="HLS.BUSINESS_TYPE"/>
        <bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STATUS"/>
        <bm:field name="status_desc" forInsert="false" forUpdate="false" prompt="LCH501.LCH_LEASE_CHANCE_HDS.STATUS"/>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID"/>
        <bm:field name="chance_source" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CHANCE_SOURCE"/>
        <bm:field name="chance_source_desc" forInsert="false" forUpdate="false" prompt="LCH501.LCH_LEASE_CHANCE_HDS.CHANCE_SOURCE"/>
        <bm:field name="first_contact_date" databaseType="DATE" datatype="java.util.Date" physicalName="FIRST_CONTACT_DATE" prompt="LCH501.LCH_LEASE_CHANCE_HDS.FIRST_CONTACT_DATE"/>
        <bm:field name="lease_organization" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_ORGANIZATION" prompt="HLS.LEASE_ORGANIZATION_CODE"/>
        <bm:field name="lease_organization_desc" forInsert="false" forUpdate="false" prompt="HLS.LEASE_ORGANIZATION_NAME"/>
        <bm:field name="lease_channel" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANNEL" prompt="HLS.LEASE_CHANNEL_CODE"/>
        <bm:field name="lease_channel_desc" forInsert="false" forUpdate="false" prompt="HLS.LEASE_CHANNEL_NAME"/>
        <bm:field name="division" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DIVISION" prompt="HLS.DIVISION"/>
        <bm:field name="division_desc" forInsert="false" forUpdate="false" prompt="HLS.DIVISION_NAME"/>
        <bm:field name="employee_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EMPLOYEE_ID"/>
        <bm:field name="employee_name" forInsert="false" forUpdate="false" prompt="PRJ501.PRJ_PROJECT.EMPLOYEE_NAME"/>
        <bm:field name="employee_id_of_manager" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EMPLOYEE_ID_OF_MANAGER"/>
        <bm:field name="employee_name_of_manager" forInsert="false" forUpdate="false" prompt="HLS.UNIT_MANAGER"/>
        <bm:field name="unit_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="UNIT_ID"/>
        <bm:field name="unit_name" forInsert="false" forUpdate="false" prompt="HLS.UNIT_NAME"/>
        <bm:field name="possibility" databaseType="NUMBER" datatype="java.lang.Double" physicalName="POSSIBILITY" prompt="LCH501.LCH_LEASE_CHANCE_HDS.POSSIBILITY"/>
        <bm:field name="competitor" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMPETITOR" prompt="LCH501.LCH_LEASE_CHANCE_HDS.COMPETITOR"/>
        <bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_NAME" prompt="LCH501.LCH_LEASE_CHANCE_HDS.BP_NAME"/>
        <bm:field name="bp_class" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CLASS"/>
        <bm:field name="bp_class_desc" forInsert="false" forUpdate="false" prompt="LCH501.LCH_LEASE_CHANCE_HDS.BP_CLASS"/>
        <bm:field name="industry" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INDUSTRY" prompt="LCH501.LCH_LEASE_CHANCE_HDS.INDUSTRY"/>
        <bm:field name="primary_business" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRIMARY_BUSINESS" prompt="LCH501.LCH_LEASE_CHANCE_HDS.PRIMARY_BUSINESS"/>
        <bm:field name="listed_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LISTED_FLAG"/>
        <bm:field name="listed_flag_desc" forInsert="false" forUpdate="false" prompt="LCH501.LCH_LEASE_CHANCE_HDS.LISTED_FLAG"/>
        <bm:field name="staff_num" databaseType="NUMBER" datatype="java.lang.Long" physicalName="STAFF_NUM" prompt="LCH501.LCH_LEASE_CHANCE_HDS.STAFF_NUM"/>
        <bm:field name="prime_operating_revenue" databaseType="NUMBER" datatype="java.lang.Double" physicalName="PRIME_OPERATING_REVENUE" prompt="LCH501.LCH_LEASE_CHANCE_HDS.PRIME_OPERATING_REVENUE"/>
        <bm:field name="net_profit" databaseType="NUMBER" datatype="java.lang.Double" physicalName="NET_PROFIT" prompt="LCH501.LCH_LEASE_CHANCE_HDS.NET_PROFIT"/>
        <bm:field name="currency" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY"/>
        <bm:field name="currency_name" forInsert="false" forUpdate="false" prompt="HLS.CURRENCY"/>
        <bm:field name="fin_statement_currency" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FIN_STATEMENT_CURRENCY"/>
        <bm:field name="fin_statement_currency_name" forInsert="false" forUpdate="false" prompt="LCH501.LCH_LEASE_CHANCE_HDS.FIN_STATEMENT_CURRENCY"/>
        <bm:field name="country" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COUNTRY"/>
        <bm:field name="country_name" forInsert="false" forUpdate="false" prompt="HLS.COUNTRY"/>
        <bm:field name="province" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROVINCE"/>
        <bm:field name="province_name" forInsert="false" forUpdate="false" prompt="HLS.PROVINCE"/>
        <bm:field name="city" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CITY"/>
        <bm:field name="city_name" forInsert="false" forUpdate="false" prompt="HLS.CITY"/>
        <bm:field name="district" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DISTRICT"/>
        <bm:field name="district_name" forInsert="false" forUpdate="false" prompt="HLS.DISTRICT"/>
        <bm:field name="street" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STREET" prompt="HLS.STREET"/>
        <bm:field name="address" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ADDRESS" prompt="HLS.ADDRESS"/>
        <bm:field name="contact_person" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTACT_PERSON" prompt="LCH501.LCH_LEASE_CHANCE_HDS.CONTACT_PERSON"/>
        <bm:field name="position" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="POSITION" prompt="LCH501.LCH_LEASE_CHANCE_HDS.POSITION"/>
        <bm:field name="cell_phone" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CELL_PHONE" prompt="LCH501.LCH_LEASE_CHANCE_HDS.CELL_PHONE"/>
        <bm:field name="phone" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PHONE" prompt="LCH501.LCH_LEASE_CHANCE_HDS.PHONE"/>
        <bm:field name="lease_item_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_ITEM_ID"/>
        <bm:field name="short_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SHORT_NAME" prompt="LCH501.LCH_LEASE_CHANCE_HDS.SHORT_NAME"/>
        <bm:field name="vender_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VENDER_ID"/>
        <bm:field name="vender_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VENDER_NAME" prompt="HLS.VENDER_NAME"/>
        <bm:field name="assets_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="ASSETS_AMOUNT" prompt="LCH501.LCH_LEASE_CHANCE_HDS.ASSETS_AMOUNT"/>
        <bm:field name="expect_contract_date" databaseType="DATE" datatype="java.util.Date" physicalName="EXPECT_CONTRACT_DATE" prompt="LCH501.LCH_LEASE_CHANCE_HDS.EXPECT_CONTRACT_DATE"/>
        <bm:field name="expect_financing_date" databaseType="DATE" datatype="java.util.Date" physicalName="EXPECT_FINANCING_DATE" prompt="LCH501.LCH_LEASE_CHANCE_HDS.EXPECT_FINANCING_DATE"/>
        <bm:field name="expect_financed_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="EXPECT_FINANCED_AMOUNT" prompt="LCH501.LCH_LEASE_CHANCE_HDS.EXPECT_FINANCED_AMOUNT"/>
        <bm:field name="expect_down_payment" databaseType="NUMBER" datatype="java.lang.Double" physicalName="EXPECT_DOWN_PAYMENT" prompt="LCH501.LCH_LEASE_CHANCE_HDS.EXPECT_DOWN_PAYMENT"/>
        <bm:field name="expect_lease_period" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPECT_LEASE_PERIOD" prompt="LCH501.LCH_LEASE_CHANCE_HDS.EXPECT_LEASE_PERIOD"/>
        <bm:field name="expect_pay_times" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPECT_PAY_TIMES"/>
        <bm:field name="expect_pay_times_desc" forInsert="false" forUpdate="false" prompt="LCH501.LCH_LEASE_CHANCE_HDS.EXPECT_PAY_TIMES"/>
        <bm:field name="price_list" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRICE_LIST"/>
        <bm:field name="price_list_desc" forInsert="false" forUpdate="false" physicalName="PRICE_LIST_DESC" prompt="HLS.PRICE_LIST"/>
        <bm:field name="installation_site" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSTALLATION_SITE" prompt="LCH501.LCH_LEASE_CHANCE_HDS.INSTALLATION_SITE"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="LCH501.LCH_LEASE_CHANCE_HDS.REF_V01"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="LCH501.LCH_LEASE_CHANCE_HDS.REF_V02"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03" prompt="LCH501.LCH_LEASE_CHANCE_HDS.REF_V03"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04" prompt="LCH501.LCH_LEASE_CHANCE_HDS.REF_V04"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05" prompt="LCH501.LCH_LEASE_CHANCE_HDS.REF_V05"/>
        <bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N01" prompt="LCH501.LCH_LEASE_CHANCE_HDS.REF_N01"/>
        <bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N02" prompt="LCH501.LCH_LEASE_CHANCE_HDS.REF_N02"/>
        <bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N03" prompt="LCH501.LCH_LEASE_CHANCE_HDS.REF_N03"/>
        <bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N04" prompt="LCH501.LCH_LEASE_CHANCE_HDS.REF_N04"/>
        <bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N05" prompt="LCH501.LCH_LEASE_CHANCE_HDS.REF_N05"/>
        <bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01" prompt="LCH501.LCH_LEASE_CHANCE_HDS.REF_D01"/>
        <bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02" prompt="LCH501.LCH_LEASE_CHANCE_HDS.REF_D02"/>
        <bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03" prompt="LCH501.LCH_LEASE_CHANCE_HDS.REF_D03"/>
        <bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04" prompt="LCH501.LCH_LEASE_CHANCE_HDS.REF_D04"/>
        <bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05" prompt="LCH501.LCH_LEASE_CHANCE_HDS.REF_D05"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field name="lease_chance_code" queryExpression="t1.lease_chance_code like ${@lease_chance_code}"/>
        <bm:query-field name="employee_id" queryExpression="t1.employee_id = ${@employee_id}"/>
        <bm:query-field name="bp_name" queryExpression="t1.bp_name like ${@bp_name}"/>
        <bm:query-field name="lease_organization" queryExpression="t1.lease_organization = ${@lease_organization}"/>
        <bm:query-field name="lease_channel" queryExpression="t1.lease_channel = ${@lease_channel}"/>
        <bm:query-field name="division" queryExpression="t1.division = ${@division}"/>
        <bm:query-field name="creation_date_from" queryExpression="t1.creation_date &gt;= TO_DATE(${@creation_date_from},&apos;YYYY-MM-DD&apos;)"/>
        <bm:query-field name="creation_date_to" queryExpression="t1.creation_date &lt;= TO_DATE(${@creation_date_to},&apos;YYYY-MM-DD&apos;)"/>
        <bm:query-field name="status" queryExpression="t1.status = ${@status}"/>
        <bm:query-field name="short_name" queryExpression="t1.short_name like ${@short_name}"/>
    </bm:query-fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
    			select t1.lease_chance_id,
				       t1.lease_chance_code,
				       t1.check_flag,
				       t1.check_flag_desc,
				       t1.document_type,
				       t1.document_type_desc,
				       t1.document_category,
				       t1.document_category_desc,
				       t1.business_type,
				       t1.business_type_desc,
				       t1.status,
				       t1.status_desc,
				       t1.company_id,
				       t1.chance_source,
				       t1.chance_source_desc,
				       t1.first_contact_date,
				       t1.lease_organization,
				       t1.lease_organization_desc,
				       t1.lease_channel,
				       t1.lease_channel_desc,
				       t1.division,
				       t1.division_desc,
				       t1.employee_id,
				       t1.employee_name,
				       t1.employee_id_of_manager,
				       t1.employee_name_of_manager,
				       t1.unit_id,
				       t1.unit_name,
				       t1.possibility,
				       t1.competitor,
				       t1.bp_name,
				       t1.bp_class,
				       t1.bp_class_desc,
				       t1.industry,
				       t1.primary_business,
				       t1.listed_flag,
				       t1.listed_flag_desc,
				       t1.staff_num,
				       t1.prime_operating_revenue,
				       t1.net_profit,
				       t1.currency,
				       t1.currency_name,
				       t1.fin_statement_currency,
				       t1.fin_statement_currency_name,
				       t1.country,
				       t1.country_name,
				       t1.province,
				       t1.province_name,
				       t1.city,
				       t1.city_name,
				       t1.district,
				       t1.district_name,
				       t1.street,
				       t1.address,
				       t1.contact_person,
				       t1.position,
				       t1.cell_phone,
				       t1.phone,
				       t1.lease_item_id,
				       t1.short_name,
				       t1.vender_id,
				       t1.vender_name,
				       t1.assets_amount,
				       t1.expect_contract_date,
				       t1.expect_financing_date,
				       t1.expect_financed_amount,
				       t1.expect_down_payment,
				       t1.expect_lease_period,
				       t1.expect_pay_times,
				       t1.expect_pay_times_desc,
				       t1.installation_site,
				       t1.price_list,
				       t1.price_list_desc,
				       t1.creation_date,
				       t1.created_by,
				       t1.last_update_date,
				       t1.last_updated_by,
				       t1.ref_v01,
				       t1.ref_v02,
				       t1.ref_v03,
				       t1.ref_v04,
				       t1.ref_v05,
				       t1.ref_n01,
				       t1.ref_n02,
				       t1.ref_n03,
				       t1.ref_n04,
				       t1.ref_n05,
				       t1.ref_d01,
				       t1.ref_d02,
				       t1.ref_d03,
				       t1.ref_d04,
				       t1.ref_d05
				  from lch_lease_chance_hds_v t1
				#WHERE_CLAUSE#
				order by t1.creation_date desc
    		]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="insert">
            <bm:parameters>
                <bm:parameter name="lease_chance_id" input="false" output="true" outputPath="@lease_chance_id"/>
                <bm:parameter name="lease_chance_code" input="true" inputPath="@lease_chance_code" output="true" outputPath="@lease_chance_code"/>
            </bm:parameters>
            <bm:update-sql><![CDATA[
        		begin
		  			lch501_save_pkg.chance_manage(p_sql_type				=> 'INSERT',
									  			  p_lease_chance_id         => ${@lease_chance_id},
									              p_lease_chance_code       => ${@lease_chance_code},
									              p_business_type           => ${@business_type},
									              p_document_type           => ${@document_type},
									              p_document_category       => ${@document_category},
									              p_status                  => ${@status},
									              p_check_flag              => ${@check_flag},
									              p_company_id              => ${/session/@company_id},
									              p_chance_source           => ${@chance_source},
									              p_first_contact_date      => to_date(${@first_contact_date},'yyyy-mm-dd'),
									              p_lease_organization      => ${@lease_organization},
									              p_lease_channel           => ${@lease_channel},
									              p_division                => ${@division},
									              p_employee_id             => ${@employee_id},
									              p_employee_id_of_manager  => ${@employee_id_of_manager},
									              p_unit_id  			    => ${@unit_id},
									              p_possibility             => ${@possibility},
									              p_competitor              => ${@competitor},
									              p_bp_name                 => ${@bp_name},
									              p_bp_class                => ${@bp_class},
									              p_industry                => ${@industry},
									              p_primary_business        => ${@primary_business},
									              p_listed_flag             => ${@listed_flag},
									              p_staff_num               => ${@staff_num},
									              p_prime_operating_revenue => ${@prime_operating_revenue},
									              p_net_profit              => ${@net_profit},
									              p_currency                => ${@currency},
									              p_fin_statement_currency  => ${@fin_statement_currency},
									              p_country                 => ${@country},
									              p_province                => ${@province},
									              p_city                    => ${@city},
									              p_district                => ${@district},
									              p_street                  => ${@street},
									              p_address                 => ${@address},
									              p_contact_person          => ${@contact_person},
									              p_position                => ${@position},
									              p_cell_phone              => ${@cell_phone},
									              p_phone                   => ${@phone},
									              p_lease_item_id           => ${@lease_item_id},
									              p_short_name              => ${@short_name},
									              p_vender_id               => ${@vender_id},
									              p_vender_name             => ${@vender_name},
									              p_assets_amount           => ${@assets_amount},
									              p_expect_contract_date    => to_date(${@expect_contract_date},'yyyy-mm-dd'),
									              p_expect_financing_date   => to_date(${@expect_financing_date},'yyyy-mm-dd'),
									              p_expect_financed_amount  => ${@expect_financed_amount},
									              p_expect_down_payment     => ${@expect_down_payment},
									              p_expect_lease_period     => ${@expect_lease_period},
									              p_expect_pay_times        => ${@expect_pay_times},
									              p_price_list				=> ${@price_list},
									              p_installation_site       => ${@installation_site},
									              p_user_id                 => ${/session/@user_id},
									              p_ref_v01                 => ${@ref_v01},
									              p_ref_v02                 => ${@ref_v02},
									              p_ref_v03                 => ${@ref_v03},
									              p_ref_v04                 => ${@ref_v04},
									              p_ref_v05                 => ${@ref_v05},
									              p_ref_n01                 => ${@ref_n01},
									              p_ref_n02                 => ${@ref_n02},
									              p_ref_n03                 => ${@ref_n03},
									              p_ref_n04                 => ${@ref_n04},
									              p_ref_n05                 => ${@ref_n05},
									              p_ref_d01                 => to_date(${@ref_d01},'yyyy-mm-dd'),
									              p_ref_d02                 => to_date(${@ref_d02},'yyyy-mm-dd'),
									              p_ref_d03                 => to_date(${@ref_d03},'yyyy-mm-dd'),
									              p_ref_d04                 => to_date(${@ref_d04},'yyyy-mm-dd'),
									              p_ref_d05                 => to_date(${@ref_d05},'yyyy-mm-dd'));
				end;
        	]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
        		begin
		  			lch501_save_pkg.chance_manage(p_sql_type				=> 'UPDATE',
									  			  p_lease_chance_id         => ${@lease_chance_id},
									              p_lease_chance_code       => ${@lease_chance_code},
									              p_business_type           => ${@business_type},
									              p_document_type           => ${@document_type},
									              p_document_category       => ${@document_category},
									              p_status                  => ${@status},
									              p_check_flag              => ${@check_flag},
									              p_company_id              => ${/session/@company_id},
									              p_chance_source           => ${@chance_source},
									              p_first_contact_date      => to_date(${@first_contact_date},'yyyy-mm-dd'),
									              p_lease_organization      => ${@lease_organization},
									              p_lease_channel           => ${@lease_channel},
									              p_division                => ${@division},
									              p_employee_id             => ${@employee_id},
									              p_employee_id_of_manager  => ${@employee_id_of_manager},
									              p_unit_id  			    => ${@unit_id},
									              p_possibility             => ${@possibility},
									              p_competitor              => ${@competitor},
									              p_bp_name                 => ${@bp_name},
									              p_bp_class                => ${@bp_class},
									              p_industry                => ${@industry},
									              p_primary_business        => ${@primary_business},
									              p_listed_flag             => ${@listed_flag},
									              p_staff_num               => ${@staff_num},
									              p_prime_operating_revenue => ${@prime_operating_revenue},
									              p_net_profit              => ${@net_profit},
									              p_currency                => ${@currency},
									              p_fin_statement_currency  => ${@fin_statement_currency},
									              p_country                 => ${@country},
									              p_province                => ${@province},
									              p_city                    => ${@city},
									              p_district                => ${@district},
									              p_street                  => ${@street},
									              p_address                 => ${@address},
									              p_contact_person          => ${@contact_person},
									              p_position                => ${@position},
									              p_cell_phone              => ${@cell_phone},
									              p_phone                   => ${@phone},
									              p_lease_item_id           => ${@lease_item_id},
									              p_short_name              => ${@short_name},
									              p_vender_id               => ${@vender_id},
									              p_vender_name             => ${@vender_name},
									              p_assets_amount           => ${@assets_amount},
									              p_expect_contract_date    => to_date(${@expect_contract_date},'yyyy-mm-dd'),
									              p_expect_financing_date   => to_date(${@expect_financing_date},'yyyy-mm-dd'),
									              p_expect_financed_amount  => ${@expect_financed_amount},
									              p_expect_down_payment     => ${@expect_down_payment},
									              p_expect_lease_period     => ${@expect_lease_period},
									              p_expect_pay_times        => ${@expect_pay_times},
									              p_price_list				=> ${@price_list},
									              p_installation_site       => ${@installation_site},
									              p_user_id                 => ${/session/@user_id},
									              p_ref_v01                 => ${@ref_v01},
									              p_ref_v02                 => ${@ref_v02},
									              p_ref_v03                 => ${@ref_v03},
									              p_ref_v04                 => ${@ref_v04},
									              p_ref_v05                 => ${@ref_v05},
									              p_ref_n01                 => ${@ref_n01},
									              p_ref_n02                 => ${@ref_n02},
									              p_ref_n03                 => ${@ref_n03},
									              p_ref_n04                 => ${@ref_n04},
									              p_ref_n05                 => ${@ref_n05},
									              p_ref_d01                 => to_date(${@ref_d01},'yyyy-mm-dd'),
									              p_ref_d02                 => to_date(${@ref_d02},'yyyy-mm-dd'),
									              p_ref_d03                 => to_date(${@ref_d03},'yyyy-mm-dd'),
									              p_ref_d04                 => to_date(${@ref_d04},'yyyy-mm-dd'),
									              p_ref_d05                 => to_date(${@ref_d05},'yyyy-mm-dd'));
				end;
        	]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="delete">
            <bm:update-sql><![CDATA[
        		begin
		  			lch501_save_pkg.chance_manage(p_sql_type				=> 'DELETE',
									  			  p_lease_chance_id         => ${@lease_chance_id},
									              p_lease_chance_code       => ${@lease_chance_code},
									              p_business_type           => ${@business_type},
									              p_document_type           => ${@document_type},
									              p_document_category       => ${@document_category},
									              p_status                  => ${@status},
									              p_check_flag              => ${@check_flag},
									              p_company_id              => ${/session/@company_id},
									              p_chance_source           => ${@chance_source},
									              p_first_contact_date      => to_date(${@first_contact_date},'yyyy-mm-dd'),
									              p_lease_organization      => ${@lease_organization},
									              p_lease_channel           => ${@lease_channel},
									              p_division                => ${@division},
									              p_employee_id             => ${@employee_id},
									              p_employee_id_of_manager  => ${@employee_id_of_manager},
									              p_unit_id  			    => ${@unit_id},
									              p_possibility             => ${@possibility},
									              p_competitor              => ${@competitor},
									              p_bp_name                 => ${@bp_name},
									              p_bp_class                => ${@bp_class},
									              p_industry                => ${@industry},
									              p_primary_business        => ${@primary_business},
									              p_listed_flag             => ${@listed_flag},
									              p_staff_num               => ${@staff_num},
									              p_prime_operating_revenue => ${@prime_operating_revenue},
									              p_net_profit              => ${@net_profit},
									              p_currency                => ${@currency},
									              p_fin_statement_currency  => ${@fin_statement_currency},
									              p_country                 => ${@country},
									              p_province                => ${@province},
									              p_city                    => ${@city},
									              p_district                => ${@district},
									              p_street                  => ${@street},
									              p_address                 => ${@address},
									              p_contact_person          => ${@contact_person},
									              p_position                => ${@position},
									              p_cell_phone              => ${@cell_phone},
									              p_phone                   => ${@phone},
									              p_lease_item_id           => ${@lease_item_id},
									              p_short_name              => ${@short_name},
									              p_vender_id               => ${@vender_id},
									              p_vender_name             => ${@vender_name},
									              p_assets_amount           => ${@assets_amount},
									              p_expect_contract_date    => to_date(${@expect_contract_date},'yyyy-mm-dd'),
									              p_expect_financing_date   => to_date(${@expect_financing_date},'yyyy-mm-dd'),
									              p_expect_financed_amount  => ${@expect_financed_amount},
									              p_expect_down_payment     => ${@expect_down_payment},
									              p_expect_lease_period     => ${@expect_lease_period},
									              p_expect_pay_times        => ${@expect_pay_times},
									              p_price_list				=> ${@price_list},
									              p_installation_site       => ${@installation_site},
									              p_user_id                 => ${/session/@user_id},
									              p_ref_v01                 => ${@ref_v01},
									              p_ref_v02                 => ${@ref_v02},
									              p_ref_v03                 => ${@ref_v03},
									              p_ref_v04                 => ${@ref_v04},
									              p_ref_v05                 => ${@ref_v05},
									              p_ref_n01                 => ${@ref_n01},
									              p_ref_n02                 => ${@ref_n02},
									              p_ref_n03                 => ${@ref_n03},
									              p_ref_n04                 => ${@ref_n04},
									              p_ref_n05                 => ${@ref_n05},
									              p_ref_d01                 => to_date(${@ref_d01},'yyyy-mm-dd'),
									              p_ref_d02                 => to_date(${@ref_d02},'yyyy-mm-dd'),
									              p_ref_d03                 => to_date(${@ref_d03},'yyyy-mm-dd'),
									              p_ref_d04                 => to_date(${@ref_d04},'yyyy-mm-dd'),
									              p_ref_d05                 => to_date(${@ref_d05},'yyyy-mm-dd'));
				end;
        	]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
        		begin
		  			lch501_save_pkg.chanceStatus_manage(p_lease_chance_id	=> ${@lease_chance_id},
				  										p_status         	=> ${@status},
				  										p_user_id           => ${/session/@user_id});
				end;
        	]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:features>
        <f:standard-who forQuery="true"/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="lease_chance_id"/>
    </bm:primary-key>
</bm:model>
