<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Guoxuezhao
    $Date: 2013-7-3 上午11:24:23}  
    $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_MORTGAGE">
    <bm:fields>
        <bm:field name="mortgage_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="MORTGAGE_ID" prompt="HLS_MORTGAGE.MORTGAGE_ID"/>
        <bm:field name="mortgage_code" databaseType="VARCHAR2" datatype="java.lang.String" insertExpression="hls_mortgage_pkg.get_mortgage_code(${/session/@company_id},${/session/@user_id})" physicalName="MORTGAGE_CODE" prompt="HLS_MORTGAGE.MORTGAGE_CODE"/>
        <bm:field name="mortgage_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MORTGAGE_NAME" prompt="HLS_MORTGAGE.MORTGAGE_NAME"/>
        <bm:field name="mortgage_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MORTGAGE_TYPE" prompt="HLS_MORTGAGE.MORTGAGE_TYPE"/>
        <bm:field name="mortgage_ast_classfication" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MORTGAGE_AST_CLASSFICATION" prompt="HLS_MORTGAGE.MORTGAGE_AST_CLASSFICATION"/>
        <bm:field name="mortgage_asset_detail" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MORTGAGE_ASSET_DETAIL" prompt="HLS_MORTGAGE.MORTGAGE_ASSET_DETAIL"/>
        <bm:field name="mortgage_contract_no" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MORTGAGE_CONTRACT_NO" prompt="HLS_MORTGAGE.MORTGAGE_CONTRACT_NO"/>
        <bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROJECT_ID" prompt="HLS_MORTGAGE.PROJECT_ID"/>
        <bm:field name="mortgage_register_no" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MORTGAGE_REGISTER_NO" prompt="HLS_MORTGAGE.MORTGAGE_REGISTER_NO"/>
        <bm:field name="mortgage_registed_dept" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MORTGAGE_REGISTED_DEPT" prompt="HLS_MORTGAGE.MORTGAGE_REGISTED_DEPT"/>
        <bm:field name="bp_id_mortgagor" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID_MORTGAGOR" prompt="HLS_MORTGAGE.BP_ID_MORTGAGOR"/>
        <bm:field name="mortgagor_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MORTGAGOR_NAME" prompt="HLS_MORTGAGE.MORTGAGOR_NAME"/>
        <bm:field name="value" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VALUE" prompt="HLS_MORTGAGE.VALUE"/>
        <bm:field name="currency" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY" prompt="HLS_MORTGAGE.CURRENCY"/>
        <bm:field name="uom" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="UOM" prompt="HLS_MORTGAGE.UOM"/>
        <bm:field name="quantity" databaseType="NUMBER" datatype="java.lang.Long" physicalName="QUANTITY" prompt="HLS_MORTGAGE.QUANTITY"/>
        <bm:field name="mortgage_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MORTGAGE_STATUS" prompt="HLS_MORTGAGE.MORTGAGE_STATUS"/>
        <bm:field name="start_date" databaseType="DATE" datatype="java.util.Date" physicalName="START_DATE" prompt="HLS_MORTGAGE.START_DATE"/>
        <bm:field name="end_date" databaseType="DATE" datatype="java.util.Date" physicalName="END_DATE" prompt="HLS_MORTGAGE.END_DATE"/>
        <bm:field name="bp_id_evaluator" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID_EVALUATOR" prompt="HLS_MORTGAGE.BP_ID_EVALUATOR"/>
        <bm:field name="evaluator_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EVALUATOR_NAME" prompt="HLS_MORTGAGE.EVALUATOR_NAME"/>
        <bm:field name="ownership" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="OWNERSHIP" prompt="HLS_MORTGAGE.OWNERSHIP"/>
        <bm:field name="occupied" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="OCCUPIED" prompt="HLS_MORTGAGE.OCCUPIED"/>
        <bm:field name="location" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LOCATION" prompt="HLS_MORTGAGE.LOCATION"/>
        <bm:field name="estate_license_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ESTATE_LICENSE_CODE" prompt="HLS_MORTGAGE.ESTATE_LICENSE_CODE"/>
        <bm:field name="housing_area" databaseType="NUMBER" datatype="java.lang.Long" physicalName="HOUSING_AREA" prompt="HLS_MORTGAGE.HOUSING_AREA"/>
        <bm:field name="use" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="USE" prompt="HLS_MORTGAGE.USE"/>
        <bm:field name="construction_date" databaseType="DATE" datatype="java.util.Date" physicalName="CONSTRUCTION_DATE" prompt="HLS_MORTGAGE.CONSTRUCTION_DATE"/>
        <bm:field name="building_structure" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUILDING_STRUCTURE" prompt="HLS_MORTGAGE.BUILDING_STRUCTURE"/>
        <bm:field name="land_certificate_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LAND_CERTIFICATE_CODE" prompt="HLS_MORTGAGE.LAND_CERTIFICATE_CODE"/>
        <bm:field name="land_area" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LAND_AREA" prompt="HLS_MORTGAGE.LAND_AREA"/>
        <bm:field name="land_use_rights_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LAND_USE_RIGHTS_TYPE" prompt="HLS_MORTGAGE.LAND_USE_RIGHTS_TYPE"/>
        <bm:field name="land_use_rights_start_date" databaseType="DATE" datatype="java.util.Date" physicalName="LAND_USE_RIGHTS_START_DATE" prompt="HLS_MORTGAGE.LAND_USE_RIGHTS_START_DATE"/>
        <bm:field name="usable_period" databaseType="NUMBER" datatype="java.lang.Long" physicalName="USABLE_PERIOD" prompt="HLS_MORTGAGE.USABLE_PERIOD"/>
        <bm:field name="construction_area" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONSTRUCTION_AREA" prompt="HLS_MORTGAGE.CONSTRUCTION_AREA"/>
        <bm:field name="status_of_land_use" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STATUS_OF_LAND_USE" prompt="HLS_MORTGAGE.STATUS_OF_LAND_USE"/>
        <bm:field name="company_name_stock" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMPANY_NAME_STOCK" prompt="HLS_MORTGAGE.COMPANY_NAME_STOCK"/>
        <bm:field name="stock_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STOCK_NAME" prompt="HLS_MORTGAGE.STOCK_NAME"/>
        <bm:field name="stock_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STOCK_CODE" prompt="HLS_MORTGAGE.STOCK_CODE"/>
        <bm:field name="stock_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="STOCK_AMOUNT" prompt="HLS_MORTGAGE.STOCK_AMOUNT"/>
        <bm:field name="stock_ratio" databaseType="NUMBER" datatype="java.lang.Long" physicalName="STOCK_RATIO" prompt="HLS_MORTGAGE.STOCK_RATIO"/>
        <bm:field name="fair_value" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FAIR_VALUE" prompt="HLS_MORTGAGE.FAIR_VALUE"/>
        <bm:field name="appraise_date" databaseType="DATE" datatype="java.util.Date" physicalName="APPRAISE_DATE" prompt="HLS_MORTGAGE.APPRAISE_DATE"/>
        <bm:field name="total_value" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TOTAL_VALUE" prompt="HLS_MORTGAGE.TOTAL_VALUE"/>
        <bm:field name="bvps" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BVPS" prompt="HLS_MORTGAGE.BVPS"/>
        <bm:field name="equipment_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EQUIPMENT_TYPE" prompt="HLS_MORTGAGE.EQUIPMENT_TYPE"/>
        <bm:field name="pattern" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PATTERN" prompt="HLS_MORTGAGE.PATTERN"/>
        <bm:field name="specification" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SPECIFICATION" prompt="HLS_MORTGAGE.SPECIFICATION"/>
        <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="HLS_MORTGAGE.ENABLED_FLAG"/>
        <bm:field name="note" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NOTE" prompt="HLS_MORTGAGE.NOTE"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="HLS_MORTGAGE.REF_V01"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="HLS_MORTGAGE.REF_V02"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03" prompt="HLS_MORTGAGE.REF_V03"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04" prompt="HLS_MORTGAGE.REF_V04"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05" prompt="HLS_MORTGAGE.REF_V05"/>
        <bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N01" prompt="HLS_MORTGAGE.REF_N01"/>
        <bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N02" prompt="HLS_MORTGAGE.REF_N02"/>
        <bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N03" prompt="HLS_MORTGAGE.REF_N03"/>
        <bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N04" prompt="HLS_MORTGAGE.REF_N04"/>
        <bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N05" prompt="HLS_MORTGAGE.REF_N05"/>
        <bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01" prompt="HLS_MORTGAGE.REF_D01"/>
        <bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02" prompt="HLS_MORTGAGE.REF_D02"/>
        <bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03" prompt="HLS_MORTGAGE.REF_D03"/>
        <bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04" prompt="HLS_MORTGAGE.REF_D04"/>
        <bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05" prompt="HLS_MORTGAGE.REF_D05"/>
    </bm:fields>
    <bm:features>
        <o:sequence-pk/>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="mortgage_id"/>
    </bm:primary-key>
    <bm:relations>
        <bm:relation name="prj_project" joinType="left outer" refAlias="t2" refModel="prj.PRJ501.prj_project">
            <bm:reference foreignField="project_id" localField="project_id"/>
        </bm:relation>
    </bm:relations>
    <bm:ref-fields>
        <bm:ref-field name="project_number" relationName="prj_project" sourceField="project_number"/>
        <bm:ref-field name="project_name" relationName="prj_project" sourceField="project_name"/>
    </bm:ref-fields>
    <bm:query-fields>
        <bm:query-field field="mortgage_id" queryOperator="="/>
        <bm:query-field field="mortgage_code" queryOperator="like"/>
        <bm:query-field field="mortgage_name" queryOperator="like"/>
        <bm:query-field field="mortgage_type" queryOperator="like"/>
        <bm:query-field field="mortgage_ast_classfication" queryOperator="like"/>
        <bm:query-field field="mortgage_asset_detail" queryOperator="like"/>
        <bm:query-field field="mortgage_contract_no" queryOperator="like"/>
        <bm:query-field name="project_id" queryExpression="t1.project_id = ${@project_id}"/>
        <bm:query-field field="mortgage_register_no" queryOperator="like"/>
        <bm:query-field field="mortgagor_name" queryOperator="like"/>
        <bm:query-field field="evaluator_name" queryOperator="like"/>
    </bm:query-fields>
</bm:model>
