<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2013-10-28 上午10:04:31  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="PRJ_PROJECT_LEASE_ITEM_LIST">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
			 select rank() over(partition by project_lease_item_id order by l.seq) row_num,
			 		l.seq,
			        l.project_lease_item_id,
			        l.asset_num,
			        l.asset_name,
			        l.specification,
			        l.vender,
			        l.manufacturer,
			        l.quantity,
			        l.uom,
			        l.currency,
              		(select vl.currency_symbol t from gld_currency_vl vl where vl.currency_code=l.currency)currency_symbol,
			        l.installation_site,
			        l.posted_date,
			        to_char(l.net_asset_value,'FM99,999,999,990.00')net_asset_value,
			        to_char(l.invoice_amt,'FM99,999,999,990.00')invoice_amt,
			        l.invoice_num,
			        l.invoice_date,
			        to_char(l.price,'FM99,999,999,990.00')price,
			        to_char(l.total_amount,'FM99,999,999,990.00')total_amount,
			        (select li.li_list_type from prj_project_lease_item li where li.project_lease_item_id=l.project_lease_item_id) li_list_type
			   from prj_project_lease_item_list l
			  where l.project_lease_item_id in
			        (select i.project_lease_item_id
			           from prj_project_lease_item i
			          where i.project_id =${@project_id})
			    order by l.project_lease_item_id,l.seq  asc
			    
			
			]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
