<?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"/>
        <bm:field name="bp_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="bp_code" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="bp_class" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <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_id,zw.bp_class, 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 = 'ORG') 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};
   			   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>
