<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hc  
    $Date: 2015-8-27 上午11:10:27  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="HN_DOC_APPROVAL">
    <bm:fields>
        <bm:field name="approval_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="APPROVAL_ID"/>
        <bm:field name="document_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DOCUMENT_ID"/>
        <bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE" prompt="HN_DOC_APPROVAL.DOCUMENT_TYPE"/>
        <bm:field name="meeting_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="MEETING_ID"/>
        <bm:field name="meeting_name" forInsert="false" forUpdate="false" prompt="HN_DOC_APPROVAL.MEETING_TIME"/>
        <bm:field name="meeting_location" forInsert="false" forUpdate="false" prompt="HN_DOC_APPROVAL.MEETING_LOCATION"/>
        <bm:field name="meeting_date" datatype="java.util.Date" forInsert="false" forUpdate="false" prompt="HN_DOC_APPROVAL.MEETING_DATE"/>
        <bm:field name="meeting_time" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MEETING_TIME" prompt="HN_DOC_APPROVAL.MEETING_TIME"/>
        <bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STATUS" prompt="HN_DOC_APPROVAL.STATUS"/>
        <bm:field name="approval_result" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="APPROVAL_RESULT" prompt="HN_DOC_APPROVAL.APPROVAL_RESULT"/>
        <bm:field name="approval_result_desc" forInsert="false" forUpdate="false"/>
        <bm:field name="approval_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="APPROVAL_COUNT" prompt="HN_DOC_APPROVAL.APPROVAL_COUNT"/>
        <bm:field name="exists_comment_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXISTS_COMMENT_FLAG" prompt="HN_DOC_APPROVAL.EXISTS_COMMENT_FLAG"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="HN_DOC_APPROVAL.REF_V01"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="HN_DOC_APPROVAL.REF_V02"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03" prompt="HN_DOC_APPROVAL.REF_V03"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04" prompt="HN_DOC_APPROVAL.REF_V04"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05" prompt="HN_DOC_APPROVAL.REF_V05"/>
        <bm:field name="ref_v06" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V06" prompt="HN_DOC_APPROVAL.REF_V06"/>
        <bm:field name="ref_v07" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V07" prompt="HN_DOC_APPROVAL.REF_V07"/>
        <bm:field name="ref_v08" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V08" prompt="HN_DOC_APPROVAL.REF_V08"/>
        <bm:field name="ref_v09" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V09" prompt="HN_DOC_APPROVAL.REF_V09"/>
        <bm:field name="ref_v10" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V10" prompt="HN_DOC_APPROVAL.REF_V10"/>
        <bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N01" prompt="HN_DOC_APPROVAL.REF_N01"/>
        <bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N02" prompt="HN_DOC_APPROVAL.REF_N02"/>
        <bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N03" prompt="HN_DOC_APPROVAL.REF_N03"/>
        <bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N04" prompt="HN_DOC_APPROVAL.REF_N04"/>
        <bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N05" prompt="HN_DOC_APPROVAL.REF_N05"/>
        <bm:field name="ref_n06" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N06" prompt="HN_DOC_APPROVAL.REF_N06"/>
        <bm:field name="ref_n07" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N07" prompt="HN_DOC_APPROVAL.REF_N07"/>
        <bm:field name="ref_n08" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N08" prompt="HN_DOC_APPROVAL.REF_N08"/>
        <bm:field name="ref_n09" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N09" prompt="HN_DOC_APPROVAL.REF_N09"/>
        <bm:field name="ref_n10" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N10" prompt="HN_DOC_APPROVAL.REF_N10"/>
        <bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01" prompt="HN_DOC_APPROVAL.REF_D01"/>
        <bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02" prompt="HN_DOC_APPROVAL.REF_D02"/>
        <bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03" prompt="HN_DOC_APPROVAL.REF_D03"/>
        <bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04" prompt="HN_DOC_APPROVAL.REF_D04"/>
        <bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05" prompt="HN_DOC_APPROVAL.REF_D05"/>
        <bm:field name="ref_d06" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D06" prompt="HN_DOC_APPROVAL.REF_D06"/>
        <bm:field name="ref_d07" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D07" prompt="HN_DOC_APPROVAL.REF_D07"/>
        <bm:field name="ref_d08" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D08" prompt="HN_DOC_APPROVAL.REF_D08"/>
        <bm:field name="ref_d09" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D09" prompt="HN_DOC_APPROVAL.REF_D09"/>
        <bm:field name="ref_d10" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D10" prompt="HN_DOC_APPROVAL.REF_D10"/>
        <bm:field name="project_manager_replay" databaseType="CLOB" datatype="java.sql.Clob" physicalName="PROJECT_MANAGER_REPLAY" prompt="HN_DOC_APPROVAL.PROJECT_MANAGER_REPLAY"/>
        <bm:field name="approver_comment_summary" databaseType="CLOB" datatype="java.sql.Clob" physicalName="APPROVER_COMMENT_SUMMARY" prompt="HN_DOC_APPROVAL.APPROVER_COMMENT_SUMMARY"/>
        <bm:field name="approval_seq" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="APPROVAL_SEQ" prompt="HN_DOC_APPROVAL.APPROVAL_SEQ"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    t1.approval_id,
                    t1.document_id,
                    t1.document_type,
                    t1.meeting_id,
                    m.meeting_name,
                    m.meeting_location,
                    m.meeting_date,
                    t1.status,
                    t1.meeting_time,
                    t1.approval_result,
                    (SELECT
                        v.code_value_name
                    FROM
                        sys_code_values_v v
                    WHERE
                        v.code       = 'WFL_PROJECT_APPROVE_STATUS' AND
                        v.code_value = t1.approval_result
                    ) AS approval_result_desc,
                    t1.approval_count,
                    t1.exists_comment_flag,
                    t1.project_manager_replay,
                    t1.approver_comment_summary,
                    t1.approval_seq,
                    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
                FROM
                    hn_doc_approval t1
                LEFT OUTER JOIN hn_doc_meeting m
                ON
                    t1.meeting_id = m.meeting_id 
                #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="t1.approval_id = ${@approval_id}"/>
    </bm:data-filters>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="approval_id"/>
    </bm:primary-key>
</bm:model>
