project_approval.lwm 2.21 KB
Newer Older
lijingjing's avatar
lijingjing committed
1 2 3 4 5 6 7 8 9
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: shenyamin
    $Date: 2018-11_03 上午11:00:06  
    $Revision: 3.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
gzj34291's avatar
gzj34291 committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                 SELECT COUNT(1) v_count
      FROM (SELECT p.project_id
              FROM prj_project p, prj_project_lease_item v
             WHERE p.project_id = v.project_id
               AND (v.machine_number_70 = ${@machine_number} or v.machine_number = ${@machine_number})
               AND p.project_status <> 'CLOSED'
               AND nvl(p.secondary_lease, 'NO') = 'NO'
               and p.project_id <> nvl(${@project_id},1)
            UNION
            SELECT c.project_id
              FROM con_contract c, con_contract_lease_item h
             WHERE c.contract_id = h.contract_id
               AND (h.machine_number_70 = ${@machine_number} or h.machine_number = ${@machine_number})
               AND c.contract_status <> 'CANCEL'
               AND nvl(c.secondary_lease, 'NO') = 'NO'
               AND c.data_class = 'NORMAL'
               and c.project_id != nvl(${@project_id},1))
                ]]>
            </bm:query-sql>
        </bm:operation>
lijingjing's avatar
lijingjing committed
32 33 34 35 36 37
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
                begin
                    prj_project_pkg.project_submit(
                    p_project_id =>${@project_id}, 
                    p_user_id => ${/session/@user_id}
38

lijingjing's avatar
lijingjing committed
39 40 41 42 43 44 45 46
                    );
                end;
            ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
                begin
                    prj_project_check_pkg.check_prj_lease_item(
gzj34291's avatar
gzj34291 committed
47
                    p_project_id      =>${@project_id},
lijingjing's avatar
lijingjing committed
48 49 50
                    p_machine_number =>${@machine_number},
                    p_user_id => ${/session/@user_id}

lijingjing's avatar
lijingjing committed
51 52 53 54 55
                    );
                end;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
gzj34291's avatar
gzj34291 committed
56 57 58
    <bm:fields>
        <bm:field name="v_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="v_count"/>
    </bm:fields>
lijingjing's avatar
lijingjing committed
59
</bm:model>