<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-4-15 下午12:41:33  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="HLS_FIN_CALC_CONFIG" defaultOrderBy="t1.enabled_flag desc,t1.display_order">
    <bm:fields>
        <bm:field name="config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONFIG_ID"/>
        <bm:field name="price_list" databaseType="VARCHAR2" datatype="java.lang.String" forUpdate="false" physicalName="PRICE_LIST" prompt="HLS050.HLS_FIN_CALC_CONFIG.PRICE_LIST"/>
        <bm:field name="layout_area_seq" databaseType="VARCHAR2" datatype="java.lang.String" forUpdate="false" physicalName="LAYOUT_AREA_SEQ" prompt="HLS050.HLS_FIN_CALC_CONFIG.LAYOUT_AREA_SEQ"/>
        <bm:field name="column_name" databaseType="VARCHAR2" datatype="java.lang.String" forUpdate="false" physicalName="COLUMN_NAME" prompt="HLS050.HLS_FIN_CALC_CONFIG.COLUMN_NAME"/>
        <bm:field name="column_code" databaseType="VARCHAR2" datatype="java.lang.String" forUpdate="false" physicalName="COLUMN_CODE" prompt="HLS050.HLS_FIN_CALC_CONFIG.COLUMN_CODE"/>
        <bm:field name="column_id" databaseType="NUMBER" datatype="java.lang.Long" forUpdate="false" physicalName="COLUMN_ID"/>
        <bm:field name="cf_item" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CF_ITEM" prompt="HLS.CF_ITEM"/>
        <bm:field name="data_type" databaseType="VARCHAR2" datatype="java.lang.String" forUpdate="false" lookupCode="HLS050_DATA_TYPE" lookupField="data_type_display" physicalName="DATA_TYPE"/>
        <bm:field name="data_type_display" forInsert="false" forUpdate="false" prompt="HLS050.HLS_FIN_CALC_CONFIG.DATA_TYPE"/>
        <bm:field name="system_flag" databaseType="VARCHAR2" datatype="java.lang.String" forUpdate="false" physicalName="SYSTEM_FLAG" prompt="HLS050.HLS_FIN_CALC_CONFIG.SYSTEM_FLAG"/>
        <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="HLS050.HLS_FIN_CALC_CONFIG.ENABLED_FLAG"/>
        <bm:field name="display_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DISPLAY_FLAG" prompt="HLS050.HLS_FIN_CALC_CONFIG.DISPLAY_FLAG"/>
        <bm:field name="display_order" databaseType="NUMBER" datatype="java.lang.Double" physicalName="DISPLAY_ORDER" prompt="HLS050.HLS_FIN_CALC_CONFIG.DISPLAY_ORDER"/>
        <bm:field name="prompt" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROMPT" prompt="HLS050.HLS_FIN_CALC_CONFIG.PROMPT"/>
        <bm:field name="input_mode" databaseType="VARCHAR2" datatype="java.lang.String" lookupCode="HLS050_INPUT_MODE" lookupField="input_mode_display" physicalName="INPUT_MODE"/>
        <bm:field name="input_mode_display" forInsert="false" forUpdate="false" prompt="HLS050.HLS_FIN_CALC_CONFIG.INPUT_MODE"/>
        <bm:field name="validation_type" databaseType="VARCHAR2" datatype="java.lang.String" lookupCode="HLS050_VALIDATION_TYPE" lookupField="validation_type_display" physicalName="VALIDATION_TYPE"/>
        <bm:field name="validation_type_display" forInsert="false" forUpdate="false" prompt="HLS050.HLS_FIN_CALC_CONFIG.VALIDATION_TYPE"/>
        <bm:field name="validation_sql" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VALIDATION_SQL" prompt="HLS050.HLS_FIN_CALC_CONFIG.VALIDATION_SQL"/>
        <bm:field name="precision" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PRECISION" prompt="HLS050.HLS_FIN_CALC_CONFIG.PRECISION"/>
        <bm:field name="zero_fill" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ZERO_FILL" prompt="HLS050.HLS_FIN_CALC_CONFIG.ZERO_FILL"/>
        <bm:field name="allow_format" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ALLOW_FORMAT" prompt="HLS050.HLS_FIN_CALC_CONFIG.ALLOW_FORMAT"/>
        <bm:field name="allow_decimal" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ALLOW_DECIMAL" prompt="HLS050.HLS_FIN_CALC_CONFIG.ALLOW_DECIMAL"/>
        <bm:field name="percent" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PERCENT" prompt="HLS050.HLS_FIN_CALC_CONFIG.PERCENT"/>
        <bm:field name="default_value" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DEFAULT_VALUE" prompt="HLS050.HLS_FIN_CALC_CONFIG.DEFAULT_VALUE"/>
        <bm:field name="upper_limit" databaseType="NUMBER" datatype="java.lang.Double" physicalName="UPPER_LIMIT" prompt="HLS050.HLS_FIN_CALC_CONFIG.UPPER_LIMIT"/>
        <bm:field name="lower_limit" databaseType="NUMBER" datatype="java.lang.Double" physicalName="LOWER_LIMIT" prompt="HLS050.HLS_FIN_CALC_CONFIG.LOWER_LIMIT"/>
        <bm:field name="width" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WIDTH" prompt="HLS050.HLS_FIN_CALC_CONFIG.WIDTH"/>
        <bm:field name="alignment" databaseType="VARCHAR2" datatype="java.lang.String" lookupCode="HLS050_ALIGNMENT" lookupField="alignment_display" physicalName="ALIGNMENT" prompt="HLS050.HLS_FIN_CALC_CONFIG.ALIGNMENT"/>
        <bm:field name="alignment_display" forInsert="false" forUpdate="false" prompt="HLS050.HLS_FIN_CALC_CONFIG.ALIGNMENT"/>
        <bm:field name="cf_item_display" expression="(select t.description from hls_cashflow_item t where t.cf_item=t1.cf_item)" forInsert="false" forUpdate="false" prompt="HLS.CF_ITEM_DESC"/>
        <bm:field name="key_field_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="KEY_FIELD_FLAG" prompt="HLS050.HLS_FIN_CALC_CONFIG.KEY_FIELD_FLAG"/>
        <bm:field name="lov_return_vcode" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LOV_RETURN_VCODE" prompt="HLS050.HLS_FIN_CALC_CONFIG.LOV_RETURN_VCODE"/>
        <bm:field name="lov_cascade_para1" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LOV_CASCADE_PARA1"/>
        <bm:field name="lov_cascade_para2" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LOV_CASCADE_PARA2"/>
        <bm:field name="lov_cascade_para3" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LOV_CASCADE_PARA3"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05"/>
        <bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Double" physicalName="REF_N01"/>
        <bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Double" physicalName="REF_N02"/>
        <bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Double" physicalName="REF_N03"/>
        <bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Double" physicalName="REF_N04"/>
        <bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Double" physicalName="REF_N05"/>
        <bm:field name="exits_formula" expression="(select count(*) from HLS_FIN_CALC_CONFIG_FORMULA cf where cf.config_id =t1.config_id and cf.enabled_flag=&apos;Y&apos;)" forInsert="false" forUpdate="false"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="delete">
            <bm:update-sql><![CDATA[
    			begin
				    delete from hls_fin_calc_config_formula cf where cf.config_id = ${@config_id};
					delete from hls_fin_calc_config cc where cc.config_id = ${@config_id};
				end;
    		]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="config_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="config_id" queryOperator="="/>
        <bm:query-field field="column_code" queryOperator="like"/>
        <bm:query-field field="column_name" queryOperator="like"/>
        <bm:query-field field="prompt" queryOperator="like"/>
        <bm:query-field field="data_type" queryOperator="="/>
        <bm:query-field field="input_mode" queryOperator="="/>
        <bm:query-field field="validation_type" queryOperator="="/>
        <bm:query-field field="alignment" queryOperator="="/>
        <bm:query-field name="enabled_flag" queryExpression="(${@enabled_flag} = &apos;ALL&apos; or t1.enabled_flag = ${@enabled_flag})"/>
        <bm:query-field name="display_flag" queryExpression="(${@display_flag} = &apos;ALL&apos; or t1.display_flag = ${@display_flag})"/>
        <bm:query-field name="allow_decimal" queryExpression="(${@allow_decimal} = &apos;ALL&apos; or t1.allow_decimal = ${@allow_decimal})"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter name="layout_area_seq" enforceOperations="query" expression="layout_area_seq=${@layout_area_seq}"/>
        <bm:data-filter name="price_list" enforceOperations="query" expression="price_list=${@price_list}"/>
    </bm:data-filters>
</bm:model>
