wx_con_query.lwm 2.5 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
<?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
                    t.project_number,
                    t.contract_number,
                    t.bp_id_tenant_n,
                    t.contract_status_n,
                    t.contract_status,
                    t.creation_date,
                    t.contract_id
                FROM
                    con_contract_lv t #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="project_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_NUMBER"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER"/>
        <bm:field name="bp_id_tenant_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_ID_TENANT_N"/>
        <bm:field name="contract_status_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_STATUS_N"/>
        <bm:field name="contract_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_STATUS" required="true"/>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" required="true"/>
        <bm:field name="creation_date" databaseType="DATE" datatype="java.util.Date" physicalName="CREATION_DATE"/>
    </bm:fields>
    <bm:data-filters>
        <bm:data-filter name="data_class" enforceOperations="query" expression="t.data_class=&apos;NORMAL&apos;"/>
        <bm:data-filter name="access_token" enforceOperations="query" expression="exists  (select 1 from con_contract_bp cb,cus_weixin_register cr where cb.contract_id = t.contract_id and cb.id_type = cr.id_type and cb.id_card_no = cr.id_card_no and cb.enabled_flag=&apos;Y&apos; and cr.access_token=${@access_token})"/>
    </bm:data-filters>
    <bm:query-fields>
        <bm:query-field field="project_number" matchany="true" queryOperator="like"/>
        <bm:query-field field="contract_number" matchany="true" queryOperator="like"/>
        <bm:query-field field="bp_id_tenant_n" matchany="true" queryOperator="like"/>
        <bm:query-field field="contract_status" queryOperator="="/>
        <bm:query-field field="creation_date" queryExpression="trunc(t.creation_date) = to_date(${@creation_date},&apos;yyyy-mm-dd&apos;)"/>
    </bm:query-fields>
</bm:model>