<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: jack  
    $Date: 2014-6-17 下午5:08:01  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[select t1.* from(     SELECT 
              hd.prj_wfl_calculator_hd_id,
               hd.finance_amount,
               hd.lease_term || '年(' || hd.lease_times || '期)' lease_term,
               hd.int_rate_display orginal_int_rate_display,
               hd.lease_charge,
               '按' || (SELECT s.code_value_name
                         FROM sys_code_values_v s
                        WHERE s.code_value = hd.annual_pay_times
                              AND s.code = 'HLS500_ANNUAL_PAY_TIMES') || p_list.description ||
               (SELECT s.code_value_name
                  FROM sys_code_values_v s
                 WHERE s.code = 'HLS500_PAY_TYPE'
                       AND s.code_value = hd.pay_type) pay_type,
                            hd.deposit,
               hd.residual_value,
               p_list.description price_list_name,
               decode(hd.irr,
                      '',
                      '',
                      round(hd.irr,
                            4) * 100 || '%') irr,
               hd.irr orginal_irr,
               decode( hd.roe,'','',round(hd.roe*100,2)||'%') roe_c,
               hd.roe,
               hd.project_income,
               hd.porject_cost,
               hd.project_tax,
               hd.project_profit_net,
               hd.down_payment,
               hd.down_payment_ratio,
               hd.lease_charge_ratio,
               hd.deposit_ratio,
               hd.btb_finance_ratio,
               hd.btb_finance_amount,
               hd.btb_int_rate
          FROM 
    
               prj_wfl_calculator_hd hd,
               hls_price_list        p_list
         WHERE 
                hd.price_list = p_list.price_list) t1 #WHERE_CLAUSE#
 
  ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="prj_wfl_calc_hd_id" queryExpression="t1.prj_wfl_calculator_hd_id=${@prj_wfl_calc_hd_id}"/>
    </bm:query-fields>
</bm:model>
