<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: weiwuzhen  
    $Date: 2016-5-9 下午1:33:53  
    $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 pbp.project_id,
            to_char(pbp.prj_bp_id) prj_bp_id,
       bt.s_customer_name,--客户名称
       trim(to_char(bt.sale_quantity,'999,999,999,990.99')) sale_quantity,--销售收入
       bt.sale_percentage,--占总销售收入比例
       bt.cooperation_period,--合作年限
       bt.s_payment_way,--结算方式和信用账期
       (select v.code_value_name as value_name
          from sys_code_values_v v
         where v.code = 'YES_NO'
           and v.code_enabled_flag = 'Y'
           and v.code_value_enabled_flag = 'Y'
           and v.code_value = bt.S_RELATION) s_relation_n--是否关联企业
  from prj_project_bp pbp, prj_bp_transactor bt
 where pbp.prj_bp_id = bt.prj_bp_id
   and pbp.bp_category = 'TENANT'
   and PBP.BP_TYPE = 'TENANT_SEC'
   and bt.siv_flag = 'SALE'
   and pbp.project_id=${/parameter/@project_id}
]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
