<?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,
                    con_contract con
                WHERE
                    t1.cdd_list_id    = con.cdd_list_id AND
                    t1.cdd_item_id    = t2.cdd_item_id AND
                    t2.check_id       = t3.check_id AND
                    t3.document_table = 'CON_CONTRACT' AND
                    t3.document_id    = con.contract_id AND
                    lgt.TAB_GROUP_ID  = tg.TAB_GROUP_ID AND
                    lgt.TAB_GROUP_ID  = 84 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 con.contract_id = ${@contract_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>
