<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-9-18 下午4:20:52  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="EXP_EMP_ASSIGN_E_V" defaultOrderBy="t1.employee_code" needAccessControl="false">
    <bm:fields>
        <bm:field name="employees_assign_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EMPLOYEES_ASSIGN_ID"/>
        <!-- <bm:field name="primary_position_flag" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PRIMARY_POSITION_FLAG"/> -->
        <bm:field name="employee_id" databaseType="NUMBER" datatype="java.lang.Long" forInsert="true" physicalName="EMPLOYEE_ID"/>
        <bm:field name="employee_code" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" physicalName="EMPLOYEE_CODE" prompt="HLS.EMPLOYEE_CODE"/>
        <bm:field name="employee_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="EMPLOYEE_NAME" prompt="HLS.EMPLOYEE_NAME"/>
        <bm:field name="user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="USER_ID"/>
        <bm:field name="user_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="USER_NAME" prompt="HLS.USER_NAME"/>
        <bm:field name="user_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="USER_DESC" prompt="HLS.USER_DESC"/>
        <bm:field name="unit_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="UNIT_ID"/>
        <bm:field name="unit_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="UNIT_CODE" prompt="HLS.UNIT_CODE"/>
        <bm:field name="unit_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="UNIT_NAME" prompt="HLS.UNIT_NAME"/>
        <bm:field name="position_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="POSITION_ID"/>
        <bm:field name="position_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="POSITION_CODE" prompt="HLS.POSITION_CODE"/>
        <bm:field name="position_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="POSITION_NAME" prompt="HLS.POSITION_NAME"/>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID"/>
        <bm:field name="company_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMPANY_CODE" prompt="HLS.COMPANY_CODE"/>
        <bm:field name="company_short_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMPANY_SHORT_NAME" prompt="HLS.COMPANY_SHORT_NAME"/>
        <bm:field name="company_full_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMPANY_FULL_NAME" prompt="HLS.COMPANY_FULL_NAME"/>
        <bm:field name="org_unit_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ORG_UNIT_TYPE" prompt="HLS.ORG_UNIT_TYPE"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="employee_name" queryOperator="="/>
        <bm:query-field name="approval_type" queryExpression="t1.user_id != ${/session/@user_id}"/>
    </bm:query-fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:operations>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
            begin
            	nanshan_prj_workflow_pkg.insert_review_employee(p_instance_id => ${@instance_id},
                                                  p_project_id => ${@project_id},
                                                  p_approval_type => ${@approval_type},
                                                  p_employee_id => ${@employee_id},
                                                  p_user_id => ${/session/@user_id});
                                                  end;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
