<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hand  
    $Date: 2016-6-22 上午10:56:55  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="CON_COLLECTION_PERSONS" defaultOrderBy="staff_name asc" needAccessControl="false">
    <!--   insertExpression="${/parameter/@group_id}" -->
    <bm:fields>
        <bm:field name="staff_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="STAFF_ID" prompt="CON_COLLECTION_PERSONS.STAFF_ID"/>
        <bm:field name="user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="USER_ID" prompt="CON_COLLECTION_PERSONS.USER_ID"/>
        <bm:field name="group_id" databaseType="NUMBER" datatype="java.lang.Long" forUpdate="false" insertExpression="${../../@group_id}" physicalName="GROUP_ID" prompt="CON_COLLECTION_PERSONS.GROUP_ID"/>
        <bm:field name="staff_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STAFF_NAME" prompt="CON_COLLECTION_PERSONS.STAFF_NAME"/>
        <bm:field name="district" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DISTRICT" prompt="CON_COLLECTION_PERSONS.DISTRICT"/>
        <bm:field name="note" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NOTE" prompt="CON_COLLECTION_PERSONS.NOTE"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="staff_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="group_id" queryOperator="="/>
    </bm:query-fields>
    <!--  <bm:operations >
    <bm:operation >
     <bm:update-sql><![CDATA[
        DECLARE
        BEGIN
            INSERT
            INTO
                con_collection_group
                (
                    group_id,
                    type_id,
                    group_code,
                    group_name,
                    district,
                    note,
                    CREATED_BY,
                    CREATION_DATE,
                    LAST_UPDATED_BY,
                    LAST_UPDATE_DATE
                )
                VALUES
                (
                    CON_COLLECTION_GROUP_S.NEXTVAL,
                    ${/parameter/@type_id},
                    ${@group_code},
                    ${@group_name},
                    ${@district},
                    ${@note},
                    ${/session/@user_id},
                    sysdate,
                    ${/session/@user_id},
                    sysdate
                )
                RETURNING group_id
                    INTO
                        ${@group_id};
        END;
        
       ]]></bm:update-sql>
    </bm:operation>
    </bm:operations> -->
</bm:model>