<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: luochenglong
    $Date: 2023-02-10 早上 11:03:31
    $Revision: 1.0
    $Purpose: 电子档案池bm
-->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" >
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    fam.table_name,
                    fam.table_pk_value,
                    fam.record_id,
                    faa.attachment_id,
                    faa.file_name,
                    faa.file_type_code,
                    faa.file_path
                FROM
                    fnd_atm_attachment_multi fam,
                    fnd_atm_attachment faa
                WHERE
                    fam.attachment_id  = ${@attachment_id} AND
                    faa.rowid   =${@rowid} AND
                    fam.attachment_id  = faa.attachment_id
            ]]></bm:query-sql>
            <bm:parameters>
                <bm:parameter name="attachment_id"/>
                <bm:parameter name="rowid"/>
            </bm:parameters>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="table_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TABLE_NAME" required="true"/>
        <bm:field name="table_pk_value" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TABLE_PK_VALUE" required="true"/>
        <bm:field name="record_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RECORD_ID" required="true"/>
        <bm:field name="attachment_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ATTACHMENT_ID" required="true"/>
        <bm:field name="file_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_NAME"/>
        <bm:field name="file_type_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_TYPE_CODE"/>
        <bm:field name="file_path" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_PATH"/>
    </bm:fields>
</bm:model>
