<?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 * FROM(
            select pp.project_id,
            	   hfcl.times,
            	   hfcl.other_fee2,
			       hfcl.calc_date,
			       nvl((select 'Y' from dual where
             		(select count(1) from hls_fin_calculator_ln t where t.calc_session_id = hfcl.calc_session_id and nvl(t.other_fee2,0) <> 0) > 1),'N') compare_chose,
			       hfcl.calc_session_id
			  from hls_fin_calculator_ln hfcl, prj_quotation pq, prj_project pp
			 where hfcl.calc_session_id = pq.calc_session_id
			   and pq.document_category = 'PROJECT'
			   and pq.document_id = pp.project_id
			   and pq.quotation_type = 'MAJOR'
			   and pp.project_id = ${@project_id}
			   ) t1 #WHERE_CLAUSE#
			   ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
