<?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 ppb.bp_name,
       pp.project_number,
       ppb.id_card_no,
       ppb.cell_phone,
       to_char(t1.creation_date, 'YYYY-MM-DD HH24:MI:SS') creation_date,
       t1.user_id,
       ppb.address_on_resident_booklit,
       ppb.work_unit_address,
       ppb. living_address,
       ppb.work_unit,
      (SELECT A.code_value_name VALUE_NAME
  FROM SYS_CODE_VALUES_V A
 WHERE A.code = 'RELATIONSHIP_BP'and a.code_value=ppb.relationship_sp)relationship_sp,
       ppb.bp_name_sp,
       ppb.id_no_sp,
       ppb.cell_phone_sp,
       ppb.living_address_db,
        (select a.bp_name value_name
          from HLS_BP_MASTER_LV a
         where a.bp_category = 'AGENT'
           and pp.invoice_agent_id = a.bp_id) invoice_agent_id_n
  FROM prj_project                 pp,
       prj_project_bp              ppb,
       zj_wfl_instance_node_rcpt_v t1
 WHERE pp.project_id = ppb.project_id
   AND pp.wfl_instance_id = t1.instance_id
   AND t1.workflow_code = 'WFL_PRJ'
   AND ppb.bp_category = 'TENANT'
     and t1.user_id ='1582')
   #WHERE_CLAUSE#]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="承租人姓名"/>
        <bm:field name="project_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="项目编号"/>
        <bm:field name="id_card_no" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="承租人身份证号"/>
        <bm:field name="cell_phone" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="承租人手机号"/>
        <bm:field name="creation_date"/>
        <bm:field name="user_id"/>
        <bm:field name="address_on_resident_booklit"/>
        <bm:field name="work_unit_address"/>
        <bm:field name="living_address"/>
        <bm:field name="work_unit"/>
        <bm:field name="relationship_sp"/>
        <bm:field name="bp_name_sp"/>
        <bm:field name="id_no_sp"/>
        <bm:field name="cell_phone_sp"/>
        <bm:field name="living_address_db"/>
        <bm:field name="invoice_agent_id_n"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field name="user_id" queryExpression="user_id=${@user_id}"/>
        <!-- <bm:query-field name="project_number" queryExpression="upper(project_number) like &apos;%&apos; || upper(${@project_number}) || &apos;%&apos;"/> -->
        <!-- <bm:query-field name="id_card_no" queryExpression="upper(id_card_no) like &apos;%&apos; || upper(${@id_card_no}) || &apos;%&apos;"/> -->
        <!-- <bm:query-field name="cell_phone" queryExpression="cell_phone=${@cell_phone}"/> -->
        <bm:query-field name="creation_date_from" queryexpression="trunc(to_date(creation_date,&apos;yyyy-mm-dd HH24:MI:SS&apos;)) &gt;= to_date(${@creation_date_from},&apos;yyyy-mm-dd HH24:MI:SS&apos;)"/>
        <bm:query-field name="creation_date_to" queryexpression="trunc(to_date(creation_date,&apos;yyyy-mm-dd HH24:MI:SS&apos;)) &lt;= to_date(${@creation_date_to},&apos;yyyy-mm-dd HH24:MI:SS&apos;)"/>
    </bm:query-fields>
</bm:model>
