prj_chance_info.lwm 2.77 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: syj  
    $Date: 2015年7月16日10:47:10
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    *
                FROM
                    (SELECT 
                       p.chance_number,
                       p.project_name,
				       p.business_type_n,
				       p.project_type,
				       p.project_type_n,
				       p.chance_source_n,
				       (SELECT c.description
				          FROM hls_stat_class c
				         WHERE c.class_id = m.industry_big) industry_big_n,
				       (SELECT c.description
				          FROM hls_stat_class c
				         WHERE c.class_id = m.industry_medium) industry_medium_n,
				       (SELECT c.description
				          FROM hls_stat_class c
				         WHERE c.class_id = m.industry_small) industry_small_n,
				       p.lease_organization_n,
				       p.employee_id_n,
				       m.legal_person,
				       m.actual_controller,
				       m.business_license_num,
				       m.organization_code,
				       m.registered_capital,
				       m.paid_up_capital,
				       extract(year from m.founded_date)||'年'||extract(month from m.founded_date)||'月'||extract(day from m.founded_date)||'日' founded_date,
				       (SELECT v.code_value_name
				          FROM sys_code_values_v v
				         WHERE v.code = 'PRJ_NATURE_OF_BUSINESS'
				           AND v.code_enabled_flag = 'Y'
				           AND v.code_value_enabled_flag = 'Y'
				           AND v.code_value = m.company_nature) company_nature_n,
				       m.workers_number,
				       p.regular_customer,
				       decode(p.regular_customer,'N','否','Y','是') regular_customer_n,
				       TO_CHAR(ROUND(NVL(m.technical_person_rate, 0) * 100.0, 2)) technical_person_rate,
				       m.bussiness_scope,
				       m.primary_business,
				       (SELECT A.CITY_ID_N || A.DISTRICT_ID_N || A.ADDRESS
					  		FROM HLS_BP_MASTER_ADDRESS_LV A
					   WHERE A.ADDRESS_TYPE = 'COMPANY_ADDRESS'
					   and a.bp_id = m.bp_id
					   and rownum =1)registered_place,
				       m.bp_id,
				       p.chance_id,
				       p.tenant_industy_desc,
				       p.bp_tenant_desc,
				       p.build_info_desc,
				       p.payment_source,
				       p.risk_response_plan,
				       p.lease_programme_description
				       
				  FROM prj_chance_v p, hls_bp_master m
				 WHERE p.bp_id = m.bp_id(+)
                    ) t 
                    #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="chance_id" queryExpression="t.chance_id=${@chance_id}"/>
    </bm:query-fields>
</bm:model>