<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Think  
    $Date: 2016-9-20 上午11:15:12  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="CON_COLLECTION_TOOL_LN">
    <bm:fields>
        <bm:field name="rejest_id"/>
        <bm:field name="collection_id"/>
        <bm:field name="contract_id"/>
        <bm:field name="project_id"/>
        <bm:field name="rejest_note"/>
        <bm:field name="wfl_instance"/>
        <bm:field name="wfl_state"/>
        <bm:field name="enabled_flag"/>
        <bm:field name="user_name" forInsert="false" forUpdate="false"/>
        <bm:field name="time" forInsert="false" forUpdate="false"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="rejest_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="rejest_id" queryOperator="="/>
    </bm:query-fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
    		  select tt.rejest_id,tt.collection_id,tt.contract_id,tt.project_id,tt.wfl_instance,tt.wfl_state,tt.enabled_flag, (select s.description from sys_user s where s.user_id = tt.CREATED_BY) user_name,tt.CREATION_DATE time,tt.rejest_note from CON_COLLECTION_TOOL_LN tt #WHERE_CLAUSE#
    		]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
        	begin
  -- Call the procedure
  con_collecton_wfl_pkg.con_collection_tool_submit(p_rejest_id => ${@rejest_id},
                                                   p_collection_id => ${@collection_id},
                                                   p_user_id => ${/session/@user_id},
                                                   p_company_id => ${/session/@company_id});
end;
        
        ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
