<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: lgc5900  
    $Date: 2015年11月25日 下午4:39:58  
    $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
                    rownum AS num,
                    pm.full_name,
                    pm.lease_item_code,
                    --土地证号
                    pm.land_certificate_num,
                    --房产证
                    pm.property_certificate_num,
                    --占地面积
                    pm.site_area,
                    --建筑面积
                    pm.building_area,
                    --评估价值（万元）
                    --评估公司
                    pm.evaluator_id_n,
                    --建造单位
                    pm.builder,
                    pm.quantity,
                    --原值(元)
                    TO_CHAR( pm.original_asset_value/10000, 'FM999,999,999,990.00') original_asset_value,
                    --净值(元)
                    TO_CHAR( pm.lease_transfer_price/10000, 'FM999,999,999,990.00') lease_transfer_price,
                    --评估价值（万元）
                    TO_CHAR( pm.net_asset_value/10000, 'FM999,999,999,990.00') net_asset_value,
                    pm.vender_name
                    || '/'
                    || pm.guarantee_period_year AS vender_name,
                    pm.reasonable_deprecition_years,
                    (CASE
                            WHEN pm.vender_id IS NULL
                            THEN pm.vender_name
                            ELSE pm.vender_id_n
                        END)agency_name ,
                    pm.using_place,
                    TO_CHAR(pm.acquisition_date,'YYYY/MM/DD')acquisition_date,
                    --其他
                    pm.description,
                    pm.unique_code,
                    to_char(pm.last_delivery_date,'YYYY/MM/DD') last_delivery_date,
                    pm.builder,
                    pm.pattern
                FROM
                    prj_project_lease_item_lv pm
                WHERE
                    pm.project_id =${@project_id}
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="num" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NUM"/>
        <bm:field name="full_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FULL_NAME"/>
        <bm:field name="lease_item_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_ITEM_CODE"/>
        <bm:field name="quantity" databaseType="NUMBER" datatype="java.lang.Long" physicalName="QUANTITY"/>
        <bm:field name="original_asset_value"/>
        <bm:field name="net_asset_value"/>
        <bm:field name="vender_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VENDER_NAME"/>
        <bm:field name="reasonable_deprecition_years" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REASONABLE_DEPRECITION_YEARS"/>
        <bm:field name="agency_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="AGENCY_NAME"/>
        <bm:field name="using_place" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="USING_PLACE"/>
        <bm:field name="land_certificate_num"/>
        <bm:field name="property_certificate_num"/>
        <bm:field name="site_area"/>
        <bm:field name="building_area"/>
        <bm:field name="evaluator_id_n"/>
        <bm:field name="lease_transfer_price"/>
        <bm:field name="acquisition_date"/>
        <bm:field name="description"/>
        <bm:field name="unique_code"/>
        <bm:field name="last_delivery_date"/>
        <bm:field name="builder"/>
        <bm:field name="pattern"/>
    </bm:fields>
</bm:model>
