contract_sign_cancel.lwm 2.42 KB
Newer Older
congzhao's avatar
congzhao committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zc
    $Date: 2020年11月18日 14点02分
    $Revision: 1.0
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
                begin
                    con_contract_workflow_pkg.contract_sign_cancel(
                    p_contract_id =>${@contract_id},
                    p_user_id => ${/session/@user_id}
                    );
                end;
            ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
22 23 24 25 26 27 28 29 30 31 32
                  select *
                    from (select cf.ele_flow_id, cf.contract_id
                            FROM CON_CONTRACT_ELE_FLOW cf
                           where cf.ele_flow_type in ('CE', 'AE')
                             and cf.revoke_flag is null
                          union all
                          select ce.ele_flow_id, ce.contract_id
                            from con_contract_ele_flow ce
                           where ce.ele_flow_type = 'ET'
                             and ce.revoke_flag is null
                             and ce.flow_status is null) t
congzhao's avatar
congzhao committed
33 34 35 36 37 38 39 40 41 42
				  #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
                begin
                    update con_contract c
                       set c.ec_sign_type = 'NEW',
                           c.sign_contract_status = 'NEW',
                           c.last_update_date = sysdate,
43
                           c.last_updated_by = nvl(${/session/@user_id},'1')
congzhao's avatar
congzhao committed
44
                     where c.contract_id = ${@contract_id};
45 46

                    delete from con_contract_ele_signer cs where cs.contract_id = ${@contract_id};
47
                    delete from CON_CONTRACT_ELE_FLOW t where t.ele_flow_type in ('CE','AE','ET') and t.contract_id = ${@contract_id};
48
                commit;
congzhao's avatar
congzhao committed
49 50 51 52 53
                end;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
54 55
        <bm:field name="ele_flow_id" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ELE_FLOW_ID"/>
        <bm:field name="contract_id"/>
congzhao's avatar
congzhao committed
56 57
    </bm:fields>
    <bm:query-fields>
58
        <bm:query-field name="contract_id" queryExpression="t.contract_id = ${@contract_id}"/>
congzhao's avatar
congzhao committed
59 60
    </bm:query-fields>
</bm:model>