<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang 
    $Date: 2015-7-10 下午03:44:00  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    e.record_id,
                    e.workflow_name,
                    e.workflow_id,
                    e.instance_id,
                    NVL(e.instance_desc, e.workflow_name) AS workflow_desc,
                    e.node_name,
                    e.created_by,
                    e.employee_name,
                    TO_CHAR(e.date_limit, 'yyyy-mm-dd') date_limit,
                    TO_CHAR(e.creation_date, 'yyyy-mm-dd hh24:mi') creation_date,
                    e.is_late,
                    e.node_id,
                    t.screen_name
                FROM
                    wfl_instance_list_v e,
                    (SELECT
                        device_form_name AS screen_name,
                        node_id
                    FROM
                        wfl_workflow_node_pages
                    WHERE
                        device_type_id='IPHONE'
                    ) t #WHERE_CLAUSE#
                ORDER BY
                    e.is_late DESC,
                    e.creation_date DESC
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="date" queryExpression="to_date(t.creation_date,&apos;yyyy-mm-dd hh24:mi&apos;) &gt; to_date(${@date},&apos;yyyy-MM-dd hh24:mi&apos;)"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="e.employee_id = ${/session/@user_id} AND  e.node_id   = t.node_id"/>
    </bm:data-filters>
</bm:model>
