<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Harry
	$Date: 2018/11/16 14:26
	$Revision: 1.0
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" accessControlMode="false" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                 SELECT to_char(h.journal_header_id) JOURNAL_HEADER_ID,
						(select h.INTERFACE_URL
						from hls_interface_parameter h
						where h.interface_code = ${@interface_code}) INTERFACE_URL,
						(select h.INTERFACE_USERNAME
						from hls_interface_parameter h
						where h.interface_code = ${@interface_code}) INTERFACE_USERNAME,
						(select h.INTERFACE_PASSWORD
						from hls_interface_parameter h
						where h.interface_code = ${@interface_code}) INTERFACE_PASSWORD,
						(select h.ATTRIBUTE_1
						from hls_interface_parameter h
						where h.interface_code = ${@interface_code}) ATTRIBUTE_1
                  FROM hls_journal_header h
                 WHERE h.sap_belnr IS NULL
                   and h.reversed_flag = 'R'
                   and h.post_gl_status = 'N'
                   and nvl(h.re_type,'N') != 'E'
                   and h.journal_date >= to_date('2019-01-01', 'yyyy-mm-dd')
                   and exists
                   (SELECT 1
                          FROM hls_journal_header t
                         WHERE t.journal_header_id = h.reversed_journal_header_id
                           AND t.journal_date >= to_date('2019-01-01', 'yyyy-mm-dd')
                           AND t.sap_belnr IS NOT NULL)
                   and rownum <=20 for update nowait
                ]]>
            </bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>