con_collection_base.lwm 2.04 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
<?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
        	    t1.staff_id,
        	    t1.staff_name,
        	    ${@time} overdue_date,
        	    con_collection_pkg.get_succ_count(t1.staff_id, to_date(${@time},'yyyy-mm-dd')) succ_count,
        	    con_collection_pkg.get_succ_total(t1.staff_id, to_date(${@time},'yyyy-mm-dd')) succ_total,
        	    con_collection_pkg.get_payment_total(t1.staff_id, to_date(${@time},'yyyy-mm-dd')) payment_total,
        	    con_collection_pkg.get_over_total(t1.staff_id, to_date(${@time},'yyyy-mm-dd')) over_total,
        	    con_collection_pkg.get_wastage_total(t1.staff_id, to_date(${@time},'yyyy-mm-dd')) wastage_total,
        	    con_collection_pkg.get_new_count(t1.staff_id, to_date(${@time},'yyyy-mm-dd')) new_count,
        	    con_collection_pkg.get_old_count(t1.staff_id, to_date(${@time},'yyyy-mm-dd')) old_count,
        	    con_collection_pkg.get_flow_count(t1.staff_id, to_date(${@time},'yyyy-mm-dd')) flow_count,
        	    con_collection_pkg.get_ptp_count(t1.staff_id, to_date(${@time},'yyyy-mm-dd')) ptp_count,
        	    con_collection_pkg.get_pool_count(t1.staff_id, to_date(${@time},'yyyy-mm-dd')) pool_count,
        	    con_collection_pkg.get_other_count(t1.staff_id, to_date(${@time},'yyyy-mm-dd')) other_count
        	FROM
        	    con_collection_v t1 #WHERE_CLAUSE#
        	GROUP BY
        	    t1.staff_id,
        	    t1.staff_name
    	]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="staff_id" queryExpression="t1.staff_id = ${@staff_id}"/>
    </bm:query-fields>
    <bm:data-filters>
        <!-- <bm:data-filter name="query" expression="t1.user_id = ${/session/@user_id} or EXISTS (SELECT 1 FROM sys_user_role_groups_vl sy WHERE sy.user_id = ${/session/@user_id} AND sy.role_code = &apos;0041&apos;)"/> --><![CDATA[
        
    ]]></bm:data-filters>
</bm:model>