<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
              select * from(
              select h.policy_hd_id,
                     h.policy_name,
                     h.policy_ext_name,
                     h.division,
                     (select d.description
                        from hls_division d
                       where d.division = h.division) division_n
                from hlcm_comsn_policy_hd h
               where h.wfl_status = 'APPROVED'
                 and h.bp_id = ${@bp_id}) t
                  #WHERE_CLAUSE#
                ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="policy_hd_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="POLICY_HD_ID" prompt="佣金政策id"/>
        <bm:field name="policy_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="220" forDisplay="true" forQuery="true" physicalName="POLICY_NAME" prompt="佣金政策"/>
        <bm:field name="policy_ext_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="120" forDisplay="true" forQuery="true" physicalName="POLICY_NAME" prompt="佣金政策简称"/>
        <bm:field name="division" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DIVISION" prompt="产品线"/>
        <bm:field name="division_n" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="160" forDisplay="true" forQuery="true" physicalName="DIVISION_N" prompt="产品线"/>
   </bm:fields>
     <bm:query-fields>
        <bm:query-field field="policy_name" queryExpression="t.policy_name like &apos;%&apos;||${@policy_name}||&apos;%&apos;"/>
        <bm:query-field field="policy_ext_name" queryExpression="t.policy_ext_name like &apos;%&apos;||${@policy_ext_name}||&apos;%&apos;"/>
        <bm:query-field field="division_n" queryExpression="t.division_n like &apos;%&apos;||${@division_n}||&apos;%&apos;"/>
  </bm:query-fields>
</bm:model>
