con_contract_modify.lwm 3.33 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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: lpc 9874  
    $Date: 2017/11/21 9:39:12  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:s="leaf.plugin.script" xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    *
                FROM
                    (SELECT
                        c.contract_id,
                        c.data_class,
                        c.contract_number,
                        (SELECT
                            p.project_number
                        FROM
                            prj_project p
                        WHERE
                            p.project_id = c.project_id
                        ) project_number,
                        c.kingdee_contract_number,
                        c.bp_id_tenant,
                        (SELECT
                            h.kingdee_bp_code
                        FROM
                            hls_bp_master h
                        WHERE
                            h.bp_id = c.bp_id_tenant
                        ) kingdee_bp_code,
                        (SELECT h.bp_name FROM hls_bp_master h WHERE h.bp_id = c.bp_id_tenant
                        ) bp_name
                    FROM
                        con_contract c
                    ) t #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
                BEGIN
                    UPDATE
                        con_contract
                    SET
                        kingdee_contract_number = ${@kingdee_contract_number}
                    WHERE
                        contract_id = ${@contract_id};
                        
                    UPDATE
                        hls_bp_master
                    SET
                        kingdee_bp_code = ${@kingdee_bp_code}
                    WHERE
                        bp_id = ${@bp_id_tenant};
                END;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="bp_id_tenant" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="project_number" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="data_class" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="kingdee_contract_number" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="kingdee_bp_code" databaseType="VARCHAR2" datatype="java.lang.String"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="contract_number" queryExpression="contract_number like ${@contract_number}"/>
        <bm:query-field field="project_number" queryExpression="project_number like ${@project_number}"/>
        <bm:query-field field="bp_name" queryExpression="bp_name like ${@bp_name}"/>
        <bm:query-field field="data_class" queryExpression="t.data_class = &apos;NORMAL&apos;"/>
    </bm:query-fields>
</bm:model>