<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-9-16 上午11:10:48  
    $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_CONTRACT_APPROVER">
    <bm:fields>
        <bm:field name="approver_record_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="APPROVER_RECORD_ID"/>
        <bm:field name="approval_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="APPROVAL_ID" prompt="CON_CONTRACT_APPROVER.APPROVAL_ID"/>
        <bm:field name="approver_user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="APPROVER_USER_ID" prompt="CON_CONTRACT_APPROVER.APPROVER_USER_ID"/>
        <bm:field name="approve_status" physicalName="APPROVE_STATUS" prompt="CON_CONTRACT_APPROVER.APPROVE_STATUS"/>
        <bm:field name="approve_status_desc" forInsert="false" forUpdate="false"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="CON_CONTRACT_APPROVER.REF_V01"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="CON_CONTRACT_APPROVER.REF_V02"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03" prompt="CON_CONTRACT_APPROVER.REF_V03"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04" prompt="CON_CONTRACT_APPROVER.REF_V04"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05" prompt="CON_CONTRACT_APPROVER.REF_V05"/>
        <bm:field name="ref_v06" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V06" prompt="CON_CONTRACT_APPROVER.REF_V06"/>
        <bm:field name="ref_v07" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V07" prompt="CON_CONTRACT_APPROVER.REF_V07"/>
        <bm:field name="ref_v08" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V08" prompt="CON_CONTRACT_APPROVER.REF_V08"/>
        <bm:field name="ref_v09" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V09" prompt="CON_CONTRACT_APPROVER.REF_V09"/>
        <bm:field name="ref_v10" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V10" prompt="CON_CONTRACT_APPROVER.REF_V10"/>
        <bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N01" prompt="CON_CONTRACT_APPROVER.REF_N01"/>
        <bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N02" prompt="CON_CONTRACT_APPROVER.REF_N02"/>
        <bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N03" prompt="CON_CONTRACT_APPROVER.REF_N03"/>
        <bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N04" prompt="CON_CONTRACT_APPROVER.REF_N04"/>
        <bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N05" prompt="CON_CONTRACT_APPROVER.REF_N05"/>
        <bm:field name="ref_n06" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N06" prompt="CON_CONTRACT_APPROVER.REF_N06"/>
        <bm:field name="ref_n07" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N07" prompt="CON_CONTRACT_APPROVER.REF_N07"/>
        <bm:field name="ref_n08" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N08" prompt="CON_CONTRACT_APPROVER.REF_N08"/>
        <bm:field name="ref_n09" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N09" prompt="CON_CONTRACT_APPROVER.REF_N09"/>
        <bm:field name="ref_n10" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N10" prompt="CON_CONTRACT_APPROVER.REF_N10"/>
        <bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01" prompt="CON_CONTRACT_APPROVER.REF_D01"/>
        <bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02" prompt="CON_CONTRACT_APPROVER.REF_D02"/>
        <bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03" prompt="CON_CONTRACT_APPROVER.REF_D03"/>
        <bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04" prompt="CON_CONTRACT_APPROVER.REF_D04"/>
        <bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05" prompt="CON_CONTRACT_APPROVER.REF_D05"/>
        <bm:field name="ref_d06" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D06" prompt="CON_CONTRACT_APPROVER.REF_D06"/>
        <bm:field name="ref_d07" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D07" prompt="CON_CONTRACT_APPROVER.REF_D07"/>
        <bm:field name="ref_d08" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D08" prompt="CON_CONTRACT_APPROVER.REF_D08"/>
        <bm:field name="ref_d09" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D09" prompt="CON_CONTRACT_APPROVER.REF_D09"/>
        <bm:field name="ref_d10" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D10" prompt="CON_CONTRACT_APPROVER.REF_D10"/>
        <bm:field name="employee_code" forInsert="false" forUpdate="false" prompt="HLS.EMPLOYEE_CODE"/>
        <bm:field name="employee_name" forInsert="false" forUpdate="false" prompt="HLS.EMPLOYEE_NAME"/>
        <bm:field name="comment_quotation" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMMENT_QUOTATION" prompt="CON_CONTRACT_APPROVER.COMMENT_QUOTATION"/>
        <bm:field name="comment_tenant_basic" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMMENT_TENANT_BASIC" prompt="CON_CONTRACT_APPROVER.COMMENT_TENANT_BASIC"/>
        <bm:field name="comment_fin_info_tenant" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMMENT_FIN_INFO_TENANT" prompt="CON_CONTRACT_APPROVER.COMMENT_FIN_INFO_TENANT"/>
        <bm:field name="comment_management_tenant" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMMENT_MANAGEMENT_TENANT" prompt="CON_CONTRACT_APPROVER.COMMENT_MANAGEMENT_TENANT"/>
        <bm:field name="comment_guarantor_basic" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMMENT_GUARANTOR_BASIC" prompt="CON_CONTRACT_APPROVER.COMMENT_GUARANTOR_BASIC"/>
        <bm:field name="comment_lease_item_info" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMMENT_LEASE_ITEM_INFO" prompt="CON_CONTRACT_APPROVER.COMMENT_LEASE_ITEM_INFO"/>
        <bm:field name="comment_fesibility_info" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMMENT_FESIBILITY_INFO" prompt="CON_CONTRACT_APPROVER.COMMENT_FESIBILITY_INFO"/>
        <bm:field name="comment_others_info" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMMENT_OTHERS_INFO" prompt="CON_CONTRACT_APPROVER.COMMENT_OTHERS_INFO"/>
        <bm:field name="comment_1" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMMENT_1" prompt="CON_CONTRACT_APPROVER.COMMENT_1"/>
        <bm:field name="comment_2" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMMENT_2" prompt="CON_CONTRACT_APPROVER.COMMENT_2"/>
        <bm:field name="comment_3" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMMENT_3" prompt="CON_CONTRACT_APPROVER.COMMENT_3"/>
        <bm:field name="comment_4" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMMENT_4" prompt="CON_CONTRACT_APPROVER.COMMENT_4"/>
        <bm:field name="comment_5" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMMENT_5" prompt="CON_CONTRACT_APPROVER.COMMENT_5"/>
        <bm:field name="approve_comment" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="APPROVE_COMMENT" prompt="CON_CONTRACT_APPROVER.APPROVE_COMMENT"/>
        <bm:field name="exists_comment_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXISTS_COMMENT_FLAG" prompt="CON_CONTRACT_APPROVER.EXISTS_COMMENT_FLAG"/>
        <bm:field name="unit_id" forInsert="false" forUpdate="false"/>
        <bm:field name="unit_code" forInsert="false" forUpdate="false"/>
        <bm:field name="unit_name" forInsert="false" forUpdate="false"/>
        <bm:field name="position_name" forInsert="false" forUpdate="false"/>
        <bm:field name="company_short_name" forInsert="false" forUpdate="false"/>
        <bm:field name="suggestion"/>
        <bm:field name="approve_with_content"/>
        <bm:field name="discuss_with_content"/>
        <bm:field name="reject_reason"/>
        <bm:field name="other_content"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    t1.approver_record_id,
                    t1.approval_id,
                    t1.approver_user_id,
                    t1.approve_status,
                    (SELECT
                        v.code_value_name
                    FROM
                        sys_code_values_v v
                    WHERE
                        v.code       = 'WFL_PROJECT_APPROVE_STATUS' AND
                        v.code_value = t1.approve_status
                    ) AS approve_status_desc,
                    e.employee_code,
                    e.employee_name,
                    e.unit_id,
                    e.unit_code,
                    e.unit_name,
                    t1.created_by,
                    t1.creation_date,
                    t1.last_updated_by,
                    t1.last_update_date,
                    t1.ref_v01,
                    t1.ref_v02,
                    t1.ref_v03,
                    t1.ref_v04,
                    t1.ref_v05,
                    t1.ref_v06,
                    t1.ref_v07,
                    t1.ref_v08,
                    t1.ref_v09,
                    t1.ref_v10,
                    t1.ref_n01,
                    t1.ref_n02,
                    t1.ref_n03,
                    t1.ref_n04,
                    t1.ref_n05,
                    t1.ref_n06,
                    t1.ref_n07,
                    t1.ref_n08,
                    t1.ref_n09,
                    t1.ref_n10,
                    t1.ref_d01,
                    t1.ref_d02,
                    t1.ref_d03,
                    t1.ref_d04,
                    t1.ref_d05,
                    t1.ref_d06,
                    t1.ref_d07,
                    t1.ref_d08,
                    t1.ref_d09,
                    t1.ref_d10,
                    t1.comment_quotation,
                    t1.comment_tenant_basic,
                    t1.comment_fin_info_tenant,
                    t1.comment_management_tenant,
                    t1.comment_guarantor_basic,
                    t1.comment_lease_item_info,
                    t1.comment_fesibility_info,
                    t1.comment_others_info,
                    t1.comment_1,
                    t1.comment_2,
                    t1.comment_3,
                    t1.comment_4,
                    t1.comment_5,
                    t1.approve_comment,
                    t1.exists_comment_flag,
                    t1.suggestion,
                    t1.approve_with_content,
                    t1.discuss_with_content,
                    t1.reject_reason,
                    t1.other_content,
                    e.position_name,
                    e.company_short_name
                FROM
                    CON_CONTRACT_APPROVER t1,
                    exp_emp_assign_e_v e
                WHERE
                    e.primary_position_flag = 'Y' AND
                    t1.approver_user_id     = e.user_id AND
                    t1.approval_id          = ${@approval_id} AND
                    e.user_id               = NVL(${@user_id},e.user_id)
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:features>
        <o:sequence-pk/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="approver_record_id"/>
    </bm:primary-key>
    <bm:features>
        <f:standard-who/>
    </bm:features>
</bm:model>
