<?xml version="1.0" encoding="UTF-8"?>
<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
                WHERE
                    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    = ${@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

            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="cdd_item_desc"/>
        <bm:field name="check_id"/>
        <bm:field name="cdd_item_id"/>
    </bm:fields>
</bm:model>
