<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hand  
    $Date: 2016-6-27 下午6:34:29  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" defaultOrderBy="type_name">
    <bm:fields>
        <bm:field name="type_name"/>
        <bm:field name="group_name"/>
        <bm:field name="staff_name"/>
        <bm:field name="staff_id"/>
        <bm:field name="district"/>
        <bm:field name="note"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    type_name,
                    group_name,
                    staff_name,
                    staff_id,
                    district,
                    note
                FROM
                    (SELECT
                        cct.type_name,
                        ccg.group_name,
                        ccp.staff_name,
                        ccp.staff_id,
                        ccp.district,
                        ccp.note
                    FROM
                        con_collection_type cct,
                        con_collection_group ccg,
                        con_collection_persons ccp
                    WHERE
                        cct.type_id  = ccg.type_id AND
                        ccg.group_id = ccp.group_id
                    ) t1 #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field field="staff_name" queryOperator="like"/>
        <bm:query-field field="group_name" queryOperator="like"/>
        <bm:query-field field="type_name" queryOperator="like"/>
        <!--<bm:query-field name="staff_name" queryExpression="t1.staff_name = ${@staff_name}"/> 
           <bm:query-field name="group_name" queryExpression="t1.group_name = ${@group_name}"/>
           <bm:query-field name="type_name" queryExpression="t1.type_name = ${@type_name}"/> -->
    </bm:query-fields>
</bm:model>
