<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author:lxb
    $Date: 2017-1-16 上午10:53:16  
    $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
                    t1.description cdd_item_desc,
                    t2.check_id,
                    t1.cdd_item_id
                FROM
                    prj_cdd_item t1,
                    prj_cdd_item_check t2,
                    prj_cdd_item_doc_ref t3,
                    prj_cdd_item_list_grp_tab lgt,
                    prj_cdd_item_tab_group tg,
                    prj_project prj
                WHERE
                    t1.cdd_list_id    = prj.cdd_list_id AND
                    t1.cdd_item_id    = t2.cdd_item_id AND
                    t2.check_id       = t3.check_id AND
                    t3.document_table = 'PRJ_PROJECT' AND
                    t3.document_id    = prj.project_id AND
                    lgt.TAB_GROUP_ID  = tg.TAB_GROUP_ID AND
                    tg.tab_group  = 'PROJECT' AND
                    lgt.enabled_flag  = 'Y' AND
                    tg.enabled_flag   = 'Y' AND
                    t1.cdd_item_id    = lgt.cdd_item_id AND
                    lgt.cdd_list_id   = t1.cdd_list_id
                    and prj.project_id = ${@project_id}
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="cdd_item_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CDD_ITEM_DESC"/>
        <bm:field name="check_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CHECK_ID"/>
        <bm:field name="cdd_item_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CDD_ITEM_ID"/>
    </bm:fields>
</bm:model>
