<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2013-11-6 下午02:26:55  
    $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 i.project_tab_group,
			       i.description,
			       r.check_id,
			       r.document_table,
			       r.document_id,
			       a.file_type_code,
			       a.file_path
			  from prj_cdd_item i,
			       prj_cdd_item_check c,
			       prj_cdd_item_doc_ref r,
			       hls_doc_layout_tab t ,
			       fnd_atm_attachment_multi m,
			       fnd_atm_attachment a  
			where i.cdd_item_id = c.cdd_item_id
			       and r.check_id=c.check_id 
			       and m.attachment_id=a.attachment_id
			       and t.attachment_tab_group=i.project_tab_group
			       and m.table_pk_value=to_char(c.check_id)
			       and t.layout_code = 'PROJECT_MODIFY' 
			       and r.document_table='PRJ_PROJECT'
			       and m.table_name='PRJ_CDD_ITEM_CHECK'
			       and a.file_type_code in ('jpg','jpeg','bmp','gif','png')
			       and r.document_id=${@project_id}
			order by r.check_id asc
       
              
              
              ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
