<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hand  
    $Date: 2016-7-2 下午3:53:21  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="CON_COLLECTION_WAY" needAccessControl="false">
    <!-- <bm:fields>
        <bm:field name="way_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WAY_ID" prompt="CON_COLLECTION_WAY.WAY_ID"/>
        <bm:field name="type_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TYPE_ID" prompt="CON_COLLECTION_WAY.TYPE_ID"/>
        <bm:field name="methods_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="METHODS_ID" prompt="CON_COLLECTION_WAY.METHODS_ID"/>
    </bm:fields>
    <bm:features>
        <f:standard-who xmlns:f="leaf.database.features"/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="way_id"/>
    </bm:primary-key> -->
    <bm:operations>
        <bm:operation name="query">
            <!--  <bm:query-sql><![CDATA[
                SELECT
                    ccm.methods_id methods_id,
                    ccm.description,
                    DECODE(
                    (SELECT
                        COUNT(*) FROM con_collection_way ccw WHERE ccw.methods_id=ccm.methods_id AND
                        ccw.type_id                                              = ${/parameter/@type_id}
                    ), 0, 'Y', 'N') checked
                FROM
                    CON_COLLECTION_METHODS ccm
                WHERE
                    ccm.enabled_flag = 'Y'
            ]]></bm:query-sql> -->
            <bm:query-sql><![CDATA[
                SELECT
                    ccm.description,
                    ccm.methods_id,
                    ccm.methods_name,
                    ccy.type_id,
                    ccy.way_id
                FROM
                    con_collection_methods ccm,
                    con_collection_way ccy
                WHERE
                    ccm.methods_id =ccy.methods_id AND
                    ccy.type_id    =${@type_id}
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
