img_document_num_query.lwm 2.43 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Mouse Chow  
    $Date: 2012-9-10 下午05:27:56  
    $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 'EXP_REPORT' document_category,h.exp_report_number document_number,'1' as img_type,'GENERAL' as img_name,'1' as current_img_type,'GENERAL' as current_img_name
  from exp_report_headers  h
  where h.exp_report_header_id = ${@header_id}
  and ${@table_name} = 'EXP_REPORT_HEADERS'
union all
select 'EXP_REQUISITION' document_category,erh.exp_requisition_number,'1' as img_type,'GENERAL' as img_name,'1' as current_img_type,'GENERAL' as current_img_name
  from exp_requisition_headers  erh
  where erh.exp_requisition_header_id = ${@header_id}
  and ${@table_name} = 'EXP_REQUISITION_HEADERS'
union all
select 'PAYMENT_REQUISITION' document_category,h.requisition_number,'1' as img_type,'GENERAL' as img_name,'1' as current_img_type,'GENERAL' as current_img_name
  from csh_payment_requisition_hds h
  where h.PAYMENT_REQUISITION_HEADER_ID = ${header_id}
  and ${@table_name} = 'CSH_PAYMENT_REQUISITION_HDS'
union all
select 'PUR_REQUISITION' document_category,h.pur_requisition_number,'1' as img_type,'GENERAL' as img_name,'1' as current_img_type,'GENERAL' as current_img_name
  from pur_requisition_headers  h
  where h.PUR_REQUISITION_HEADER_ID = ${@header_id}
  and ${@table_name} = 'PUR_REQUISITION_HEADERS'
union all
select 'PUR_ORDER' document_category,h.pur_order_number,'1' as img_type,'GENERAL' as img_name,'1' as current_img_type,'GENERAL' as current_img_name
  from pur_order_headers h     
  where h.PUR_ORDER_HEADER_ID = ${@header_id}
  and ${@table_name} = 'PUR_ORDER_HEADERS'
union  all
select 'CON_CONTRACT' document_category,h.contract_number,'1' as img_type,'GENERAL' as img_name,'1' as current_img_type,'GENERAL' as current_img_name
  from con_contract_headers  h
  where h.CONTRACT_HEADER_ID =  ${@header_id}
  and ${@table_name} = 'CON_CONTRACT_HEADERS'
union all
select 'WFL_APPROVE_RECORD' document_category,'wfl_approve_record.'||w.record_id,'0' as img_type,'PROCESS' as img_name,'0' as current_img_type,'PROCESS' as current_img_name
         from wfl_approve_record w
         where w.record_id = ${@header_id}
  and ${@table_name} = 'WFL_APPROVE_RECORD'
			]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>