<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:fields>
        <bm:field name="record_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RECORD_ID" prompt="ZX_WHITELIST.RECORD_ID"/>
        <!-- <bm:field name="bp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID" prompt="ZX_WHITELIST.BP_ID"/> -->
        <bm:field name="bp_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CODE" prompt="ZX_WHITELIST.BP_CODE"/>
        <!--  <bm:field name="bp_class" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CLASS" prompt="ZX_WHITELIST.BP_CLASS"/> -->
        <bm:field name="bp_name"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
   			select t1.* from (select zw.record_id, zw.bp_code, h.bp_name
			  from hls_bp_master h, zx_whitelist zw
			 where h.bp_id = zw.bp_id
			   and zw.bp_class = 'INS') t1
			 #WHERE_CLAUSE#
   		
   		]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="insert">
            <bm:update-sql><![CDATA[
    		 	begin
   				   hls_zx_whitelist_save.hls_whitelist_insert(p_bp_id => ${@bp_id},
   				   												  p_bp_code => ${@bp_code},
        		    										      p_user_id => ${/session/@user_id});
   			
   			   end;
    		 ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
    		 	begin
   				   hls_zx_whitelist_save.hls_whitelist_update(p_record_id =>${@record_id},
   				   												  p_bp_id => ${@bp_id},
        		    										      p_user_id => ${/session/@user_id});
   			   end;
    		 ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="delete">
            <bm:update-sql><![CDATA[
    		 	begin
   				   delete from zx_whitelist zw where zw.record_id=${@record_id};
   				   commit;
   			   end;
    		 ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="bp_code" queryExpression="t1.bp_code=${@bp_code}"/>
        <bm:query-field name="bp_name" queryExpression="t1.bp_name=${@bp_name}"/>
    </bm:query-fields>
</bm:model>
