<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Guoxuezhao  
    $Date: 2013-6-21 上午10:56:28  
    $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">
    <bm:fields>
        <bm:field name="loan_contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LOAN_CONTRACT_ID" prompt="TRE_LOAN_CONTRACT_V.LOAN_CONTRACT_ID"/>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID" prompt="TRE_LOAN_CONTRACT_V.COMPANY_ID"/>
        <bm:field name="loan_contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LOAN_CONTRACT_NUMBER" prompt="TRE_LOAN_CONTRACT_V.LOAN_CONTRACT_NUMBER"/>
        <bm:field name="document_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_CATEGORY" prompt="TRE_LOAN_CONTRACT_V.DOCUMENT_CATEGORY"/>
        <bm:field name="business_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE" prompt="TRE_LOAN_CONTRACT_V.BUSINESS_TYPE"/>
        <bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE" prompt="TRE_LOAN_CONTRACT_V.DOCUMENT_TYPE"/>
        <bm:field name="document_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" forInsert="false" forUpdate="false" prompt="TRE_LOAN_CONTRACT_V.DOCUMENT_TYPE"/>
        <bm:field name="loan_contract_book_date" databaseType="DATE" datatype="java.util.Date" physicalName="LOAN_CONTRACT_BOOK_DATE" prompt="TRE_LOAN_CONTRACT_V.LOAN_CONTRACT_BOOK_DATE"/>
        <bm:field name="bank_credit_contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BANK_CREDIT_CONTRACT_ID" prompt="TRE_LOAN_CONTRACT_V.BANK_CREDIT_CONTRACT_ID"/>
        <bm:field name="bank_credit_contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BANK_CREDIT_CONTRACT_NUMBER" prompt="TRE_LOAN_CONTRACT_V.BANK_CREDIT_CONTRACT_NUMBER"/>
        <bm:field name="bank_account_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BANK_ACCOUNT_ID" prompt="TRE_LOAN_CONTRACT_V.BANK_ACCOUNT_ID"/>
        <bm:field name="withdraw_account_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WITHDRAW_ACCOUNT_ID" prompt="TRE_LOAN_CONTRACT_V.WITHDRAW_ACCOUNT_ID"/>
        <bm:field name="withdraw_account_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="WITHDRAW_ACCOUNT_CODE" prompt="TRE_LOAN_CONTRACT_V.WITHDRAW_ACCOUNT_CODE"/>
        <bm:field name="withdraw_account_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="WITHDRAW_ACCOUNT_NUM" prompt="TRE_LOAN_CONTRACT_V.WITHDRAW_ACCOUNT_NUM"/>
        <bm:field name="bank_full_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BANK_FULL_NAME" prompt="TRE_LOAN_CONTRACT_V.BANK_FULL_NAME"/>
        <bm:field name="bank_branch_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BANK_BRANCH_NAME" prompt="TRE_LOAN_CONTRACT_V.BANK_BRANCH_NAME"/>
        <bm:field name="bank_branch_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BANK_BRANCH_ID" prompt="TRE_LOAN_CONTRACT_V.BANK_BRANCH_ID"/>
        <bm:field name="bank_branch_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BANK_BRANCH_CODE" prompt="TRE_LOAN_CONTRACT_V.BANK_BRANCH_CODE"/>
        <bm:field name="bank_account_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BANK_ACCOUNT_CODE" prompt="TRE_LOAN_CONTRACT_V.BANK_ACCOUNT_CODE"/>
        <bm:field name="bank_account_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BANK_ACCOUNT_NUM" prompt="TRE_LOAN_CONTRACT_V.BANK_ACCOUNT_NUM"/>
        <bm:field name="loan_certificate_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LOAN_CERTIFICATE_FLAG" prompt="TRE_LOAN_CONTRACT_V.LOAN_CERTIFICATE_FLAG"/>
        <bm:field name="related_party_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="RELATED_PARTY_FLAG" prompt="TRE_LOAN_CONTRACT_V.RELATED_PARTY_FLAG"/>
        <bm:field name="loan_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="LOAN_AMOUNT" prompt="TRE_LOAN_CONTRACT_V.LOAN_AMOUNT"/>
        <bm:field name="currency" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY" prompt="TRE_LOAN_CONTRACT_V.CURRENCY"/>
        <bm:field name="precision" databaseType="number" datatype="java.lang.Long" physicalName="PRECISION" prompt="TRE_LOAN_CONTRACT_V.PRECISION"/>
        <bm:field name="currency_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY_DESC" prompt="TRE_LOAN_CONTRACT_V.CURRENCY_DESC"/>
        <bm:field name="loan_amount_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LOAN_AMOUNT_TYPE" prompt="TRE_LOAN_CONTRACT_V.LOAN_AMOUNT_TYPE"/>
        <bm:field name="loan_contract_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LOAN_CONTRACT_STATUS" prompt="TRE_LOAN_CONTRACT_V.LOAN_CONTRACT_STATUS"/>
        <bm:field name="time_horizon" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TIME_HORIZON" prompt="TRE_LOAN_CONTRACT_V.TIME_HORIZON"/>
        <bm:field name="loan_date_from" databaseType="DATE" datatype="java.util.Date" physicalName="LOAN_DATE_FROM" prompt="TRE_LOAN_CONTRACT_V.LOAN_DATE_FROM"/>
        <bm:field name="loan_date_to" databaseType="DATE" datatype="java.util.Date" physicalName="LOAN_DATE_TO" prompt="TRE_LOAN_CONTRACT_V.LOAN_DATE_TO"/>
        <bm:field name="base_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="BASE_RATE" prompt="TRE_LOAN_CONTRACT_V.BASE_RATE"/>
        <bm:field name="int_rate_fixing_way" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INT_RATE_FIXING_WAY" prompt="TRE_LOAN_CONTRACT_V.INT_RATE_FIXING_WAY"/>
        <bm:field name="int_rate_fixing_range" databaseType="NUMBER" datatype="java.lang.Double" physicalName="INT_RATE_FIXING_RANGE" prompt="TRE_LOAN_CONTRACT_V.INT_RATE_FIXING_RANGE"/>
        <bm:field name="interest_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="INTEREST_RATE" prompt="TRE_LOAN_CONTRACT_V.INTEREST_RATE"/>
        <bm:field name="calc_method" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CALC_METHOD" prompt="TRE_LOAN_CONTRACT_V.CALC_METHOD"/>
        <bm:field name="interest_period" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INTEREST_PERIOD" prompt="TRE_LOAN_CONTRACT_V.INTEREST_PERIOD"/>
        <bm:field name="interest_calc_date" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INTEREST_CALC_DATE" prompt="TRE_LOAN_CONTRACT_V.INTEREST_CALC_DATE"/>
        <bm:field name="interest_payment_date" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INTEREST_PAYMENT_DATE" prompt="TRE_LOAN_CONTRACT_V.INTEREST_PAYMENT_DATE"/>
        <bm:field name="penalty_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="PENALTY_RATE" prompt="TRE_LOAN_CONTRACT_V.PENALTY_RATE"/>
        <bm:field name="misappropriate_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="MISAPPROPRIATE_RATE" prompt="TRE_LOAN_CONTRACT_V.MISAPPROPRIATE_RATE"/>
        <bm:field name="et_penalty_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="ET_PENALTY_RATE" prompt="TRE_LOAN_CONTRACT_V.ET_PENALTY_RATE"/>
        <bm:field name="annual_days" databaseType="NUMBER" datatype="java.lang.Double" physicalName="ANNUAL_DAYS" prompt="TRE_LOAN_CONTRACT_V.ANNUAL_DAYS"/>
        <bm:field name="rate_float_cycle" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="RATE_FLOAT_CYCLE" prompt="TRE_LOAN_CONTRACT_V.RATE_FLOAT_CYCLE"/>
        <bm:field name="flt_execute_times_day" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FLT_EXECUTE_TIMES_DAY" prompt="TRE_LOAN_CONTRACT_V.FLT_EXECUTE_TIMES_DAY"/>
        <bm:field name="adjust_day" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ADJUST_DAY" prompt="TRE_LOAN_CONTRACT_V.ADJUST_DAY"/>
        <bm:field name="withdrawal_method" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="WITHDRAWAL_METHOD" prompt="TRE_LOAN_CONTRACT_V.WITHDRAWAL_METHOD"/>
        <bm:field name="last_withdrawal_date" databaseType="DATE" datatype="java.util.Date" physicalName="LAST_WITHDRAWAL_DATE" prompt="TRE_LOAN_CONTRACT_V.LAST_WITHDRAWAL_DATE"/>
        <bm:field name="factoring_financing_method" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FACTORING_FINANCING_METHOD" prompt="TRE_LOAN_CONTRACT_V.FACTORING_FINANCING_METHOD"/>
        <bm:field name="factoring_financing_method_n"/>
        <bm:field name="payment_method" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAYMENT_METHOD" prompt="TRE_LOAN_CONTRACT_V.PAYMENT_METHOD"/>
        <bm:field name="payment_date" databaseType="DATE" datatype="java.util.Date" physicalName="PAYMENT_DATE" prompt="TRE_LOAN_CONTRACT_V.PAYMENT_DATE"/>
        <bm:field name="discount_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="DISCOUNT_RATE" prompt="TRE_LOAN_CONTRACT_V.DISCOUNT_RATE"/>
        <bm:field name="bank_financing_scale" databaseType="NUMBER" datatype="java.lang.Double" physicalName="BANK_FINANCING_SCALE" prompt="TRE_LOAN_CONTRACT_V.BANK_FINANCING_SCALE"/>
        <bm:field name="financing_scale" databaseType="NUMBER" datatype="java.lang.Double" physicalName="FINANCING_SCALE" prompt="TRE_LOAN_CONTRACT_V.FINANCING_SCALE"/>
        <bm:field name="repayment_method" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REPAYMENT_METHOD" prompt="TRE_LOAN_CONTRACT_V.REPAYMENT_METHOD"/>
        <bm:field name="last_repayment_date" databaseType="DATE" datatype="java.util.Date" physicalName="LAST_REPAYMENT_DATE" prompt="TRE_LOAN_CONTRACT_V.LAST_REPAYMENT_DATE"/>
        <bm:field name="total_repayment" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TOTAL_REPAYMENT" prompt="TRE_LOAN_CONTRACT_V.TOTAL_REPAYMENT"/>
        <bm:field name="total_interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TOTAL_INTEREST" prompt="TRE_LOAN_CONTRACT_V.TOTAL_INTEREST"/>
        <bm:field name="total_fee" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TOTAL_FEE" prompt="TRE_LOAN_CONTRACT_V.TOTAL_FEE"/>
        <bm:field name="total_fee_pv" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TOTAL_FEE_PV" prompt="TRE_LOAN_CONTRACT_V.TOTAL_FEE_PV"/>
        <bm:field name="net_finance_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="NET_FINANCE_AMOUNT" prompt="TRE_LOAN_CONTRACT_V.NET_FINANCE_AMOUNT"/>
        <bm:field name="interest_margin" databaseType="NUMBER" datatype="java.lang.Double" physicalName="INTEREST_MARGIN" prompt="TRE_LOAN_CONTRACT_V.INTEREST_MARGIN"/>
        <bm:field name="reviewed_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REVIEWED_BY" prompt="TRE_LOAN_CONTRACT_V.REVIEWED_BY"/>
        <bm:field name="reviewed_date" databaseType="DATE" datatype="java.util.Date" physicalName="REVIEWED_DATE" prompt="TRE_LOAN_CONTRACT_V.REVIEWED_DATE"/>
        <bm:field name="closed_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CLOSED_BY" prompt="TRE_LOAN_CONTRACT_V.CLOSED_BY"/>
        <bm:field name="closed_date" databaseType="DATE" datatype="java.util.Date" physicalName="CLOSED_DATE" prompt="TRE_LOAN_CONTRACT_V.CLOSED_DATE"/>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="TRE_LOAN_CONTRACT_V.CONTRACT_ID"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" prompt="TRE_LOAN_CONTRACT_V.CONTRACT_NUMBER"/>
        <bm:field name="contract_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NAME" prompt="TRE_LOAN_CONTRACT_V.CONTRACT_NAME"/>
        <bm:field name="vat_rate_of_interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="VAT_RATE_OF_INTEREST" prompt="TRE_LOAN_CONTRACT_V.VAT_RATE_OF_INTEREST"/>
        <bm:field name="note" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NOTE" prompt="TRE_LOAN_CONTRACT_V.NOTE"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="TRE_LOAN_CONTRACT_V.REF_V01"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="TRE_LOAN_CONTRACT_V.REF_V02"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03" prompt="TRE_LOAN_CONTRACT_V.REF_V03"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04" prompt="TRE_LOAN_CONTRACT_V.REF_V04"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05" prompt="TRE_LOAN_CONTRACT_V.REF_V05"/>
        <bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Double" physicalName="REF_N01" prompt="TRE_LOAN_CONTRACT_V.REF_N01"/>
        <bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Double" physicalName="REF_N02" prompt="TRE_LOAN_CONTRACT_V.REF_N02"/>
        <bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Double" physicalName="REF_N03" prompt="TRE_LOAN_CONTRACT_V.REF_N03"/>
        <bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Double" physicalName="REF_N04" prompt="TRE_LOAN_CONTRACT_V.REF_N04"/>
        <bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Double" physicalName="REF_N05" prompt="TRE_LOAN_CONTRACT_V.REF_N05"/>
        <bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01" prompt="TRE_LOAN_CONTRACT_V.REF_D01"/>
        <bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02" prompt="TRE_LOAN_CONTRACT_V.REF_D02"/>
        <bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03" prompt="TRE_LOAN_CONTRACT_V.REF_D03"/>
        <bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04" prompt="TRE_LOAN_CONTRACT_V.REF_D04"/>
        <bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05" prompt="TRE_LOAN_CONTRACT_V.REF_D05"/>
        <bm:field name="loan_charge" databaseType="NUMBER" datatype="java.lang.Double" physicalName="LOAN_CHARGE" prompt="TRE_LOAN_CONTRACT_V.LOAN_CHARGE"/>
        <bm:field name="consulting_fee" databaseType="NUMBER" datatype="java.lang.Double" physicalName="CONSULTING_FEE" prompt="TRE_LOAN_CONTRACT_V.CONSULTING_FEE"/>
        <bm:field name="other_fee" databaseType="NUMBER" datatype="java.lang.Double" physicalName="OTHER_FEE" prompt="TRE_LOAN_CONTRACT_V.OTHER_FEE"/>
        <bm:field name="loan_contract_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LOAN_CONTRACT_NAME" prompt="TRE_LOAN_CONTRACT_V.LOAN_CONTRACT_NAME"/>
        <bm:field name="signing_date" databaseType="DATE" datatype="java.util.Date" physicalName="SIGNING_DATE" prompt="TRE_LOAN_CONTRACT_V.SIGNING_DATE"/>
        <bm:field name="loan_contreat_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LOAN_CONTRACT_NUM" prompt="TRE_LOAN_CONTRACT_V.LOAN_CONTRACT_NUM"/>
        <bm:field name="transactor" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TRANSACTOR" prompt="TRE_LOAN_CONTRACT_V.TRANSACTOR"/>
        <bm:field name="transactor_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TRANSACTOR_CODE" prompt="TRE_LOAN_CONTRACT_V.TRANSACTOR_CODE"/>
        <bm:field name="transact_unit_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TRANSACT_UNIT_NAME" prompt="TRE_LOAN_CONTRACT_V.TRANSACT_UNIT_NAME"/>
        <bm:field name="transact_unit_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TRANSACT_UNIT_CODE" prompt="TRE_LOAN_CONTRACT_V.TRANSACT_UNIT_CODE"/>
        <bm:field name="transfer_from" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TRANSFER_FROM" prompt="TRE_LOAN_CONTRACT_V.TRANSFER_FROM"/>
        <bm:field name="transfer_to" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TRANSFER_TO" prompt="TRE_LOAN_CONTRACT_V.TRANSFER_TO"/>
        <bm:field name="loan_usage_description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LOAN_USAGE_DESCRIPTION" prompt="TRE_LOAN_CONTRACT_V.LOAN_USAGE_DESCRIPTION"/>
        <bm:field name="signing_breed" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SIGNING_BREED" prompt="TRE_LOAN_CONTRACT_V.SIGNING_BREED"/>
        <bm:field name="loan_amount_n" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="finance_amount_n" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="bank_account_name" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="withdraw_account_name" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="consulting_fee_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="CONSULTING_FEE_RATE"/>
        <bm:field name="interest_period_times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INTEREST_PERIOD_TIMES"/>
        <bm:field name="deposit_amount"/>
        <bm:field name="bank_branch_bp_id_n"/>
        <bm:field name="bank_branch_bp_id"/>
        <bm:field name="bank_branch_bp_id_name"/>
        <bm:field name="document_id"/>
        <bm:field name="employee_name"/>
        <bm:field name="bp_name"/>
        <bm:field name="credit_limit_type_desc"/>
        <bm:field name="loan_charge_share_way_n"/>
        <bm:field name="loan_charge_share_way"/>
        <bm:field name="external_debt_cir_flag"/>
        <bm:field name="external_debt_flag"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:update-sql><![CDATA[
                select t1.loan_contract_id,
				       t1.company_id,
				       t1.loan_contract_id document_id,
				       t1.loan_contract_number,
				       t1.document_category,
				       t1.business_type,
				       t1.document_type,
				       (select h.description from hls_document_type h where h.document_type =t1.document_type) document_type_desc,
				       t1.loan_contract_book_date,
				       t1.bank_credit_contract_id,
				       t1.credit_limit_type_desc,
				       t1.bank_credit_contract_number,
				       t1.bank_account_id,
				       t1.bank_full_name,
				       t1.bank_branch_id,
				       t1.bank_branch_name,
				       t1.bank_branch_code,
				       t1.bank_account_code,
				       (select bk.bank_account_name from csh_bank_account_v bk where bk.bank_account_code =t1.bank_account_code) bank_account_name,
				       t1.bank_account_num,
				       t1.withdraw_account_id,
				       t1.withdraw_account_code,
				       t1.withdraw_account_num,
				       (select bk.bank_account_name from csh_bank_account_v bk where bk.bank_account_code =t1.withdraw_account_code) withdraw_account_name,
				       t1.loan_certificate_flag,
				       t1.related_party_flag,
				       t1.loan_amount,
				       t1.loan_amount  as loan_amount_n,
				       t1.currency,
				       t1.precision,
				       t1.currency_desc,
				       t1.loan_amount_type,
				       t1.loan_contract_status,
				       t1.time_horizon,
				       t1.loan_date_from,
				       t1.loan_date_to,
				       t1.base_rate,
				       t1.int_rate_fixing_way,
				       t1.int_rate_fixing_range,
				       t1.interest_rate,
				       t1.calc_method,
				       t1.interest_period,
				       t1.interest_calc_date,
				       t1.interest_payment_date,
				       t1.penalty_rate,
				       t1.misappropriate_rate,
				       t1.et_penalty_rate,
				       t1.annual_days,
				       t1.rate_float_cycle,
				       t1.flt_execute_times_day,
				       t1.adjust_day,
				       t1.withdrawal_method,
				       t1.last_withdrawal_date,
				       t1.factoring_financing_method,
				       (select code_value_name from sys_code_values_v where code = 'TRE502_FACTORING_FINANCING_METHOD' and code_value = t1.factoring_financing_method)factoring_financing_method_n,
				       t1.payment_method,
				       t1.payment_date,
				       t1.discount_rate,
				       t1.bank_financing_scale,
				       t1.financing_scale,
				       t1.repayment_method,
				       t1.last_repayment_date,
				       t1.total_repayment,
				       t1.total_interest,
				       t1.total_fee,
				       t1.total_fee_pv,
				       t1.net_finance_amount,
				       t1.interest_margin,
				       t1.reviewed_by,
       				   t1.reviewed_date,
       				   t1.closed_by,
       				   t1.closed_date,
       				   t1.note,
       				   t1.contract_id,
       				   t1.contract_number,
       				   t1.contract_name, 
       				   t1.bp_name,
       				   t1.employee_name,
       				   t1.finance_amount,
       				   t1.finance_amount as finance_amount_n,
       				   t1.vat_rate_of_interest,
				       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,
				       t1.loan_charge,
				       t1.consulting_fee,
				       t1.other_fee,
				       t1.loan_contract_name,
				       t1.signing_date,
				       t1.loan_contreat_num,
				       t1.transactor,
				       t1.transactor_code,
				       t1.transact_unit_name,
				       t1.transact_unit_code,
				       t1.transfer_from,  
				       t1.transfer_to,
				       t1.loan_usage_description,
				       t1.signing_breed,
				       t1.interest_period_times,
				       t1.consulting_fee_rate,
				       t1.deposit_amount,
				       t1.bank_branch_bp_id,
				       (select bp_name from hls_bp_master where bp_id = t1.bank_branch_bp_id)bank_branch_bp_id_name,
				       t1.loan_charge_share_way_n,
				       t1.loan_charge_share_way,
				       t1.external_debt_flag,
				       t1.external_debt_cir_flag,
				       t1.bank_branch_bp_id_n
				  from tre_loan_contract_v t1 
				  #WHERE_CLAUSE#
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field field="loan_contract_id" queryOperator="="/>
    </bm:query-fields>
</bm:model>
