<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    faa.file_name,
                    faa.file_size,
                    faa.file_path,
                    faa.attachment_id,
                    fam.table_pk_value check_id
                FROM
                    fnd_atm_attachment_multi fam,
                    fnd_atm_attachment faa
                WHERE
                    fam.table_name             = 'PRJ_CDD_ITEM_CHECK' AND
                    fam.table_pk_value         = ${@check_id} AND
                    fam.attachment_id          = faa.attachment_id AND
                    upper(faa.file_type_code) IN ('JPG', 'PNG','JPEG')
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="file_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_NAME"/>
        <bm:field name="file_size" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_SIZE"/>
        <bm:field name="file_path" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_PATH"/>
        <bm:field name="attachment_id" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ATTACHMENT_ID"/>
        <bm:field name="check_id" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CHECK_ID"/>
    </bm:fields>
</bm:model>
