atm_upload.lwm 7.18 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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="PRJ_CDD_ITEM_CHECK" needAccessControl="false">
    <bm:fields>
        <bm:field name="check_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="cdd_item_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="cdd_item" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="hard_copy" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="original" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="signed" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="availability" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="comments" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="sys_flag" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="project_tab_group" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="file_name"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field name="project_tab_group" queryExpression="t1.project_tab_group = ${@project_tab_group}"/>
    </bm:query-fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
              select * from ( SELECT
                    c.check_id,
                    i.cdd_item_id,
                    i.cdd_item,
                    i.description,
                    c.hard_copy,
                    c.original,
                    c.signed,
                    c.availability,
                    c.comments,
                    i.sys_flag,
                    i.project_tab_group,
                    hls_sys_upload_pkg.get_atm_file_href(p_table_pk_value => ref.check_id,p_source_type => 'PRJ_CDD_ITEM_CHECK',p_user_id => 1) file_name
                FROM
                    prj_cdd_item i,
                    prj_cdd_item_check c,
                    prj_cdd_item_doc_ref ref
                WHERE
                    i.cdd_item_id    = c.cdd_item_id AND
                    ref.check_id=c.check_id and
                    ref.document_id    = ${@document_id} AND
                    ref.document_table = ${@document_table}
                 order by i.cdd_item_id) t1
                 #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="insert">
            <bm:update-sql><![CDATA[
                begin
	                atm_upload_pkg.save_atm_upload(
	                        p_document_table =>${@document_table},
                            p_document_id    =>${@document_id},
                            p_cdd_item		 =>${@cdd_item},
                            p_description    =>${@description},
                            p_cdd_item_id    =>${@cdd_item_id},
                            p_check_id		 =>${@check_id},
                            p_user_id        =>${/session/@user_id},
                            p_hard_copy      =>${@hard_copy},
                            p_original       =>${@original},
                            p_signed         =>${@signed},
                            p_availability   =>${@availability},
                            p_comments       =>${@comments}
                          );
                end;
            ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
              begin
	                atm_upload_pkg.save_atm_upload(
	                        p_document_table =>${@document_table},
                            p_document_id    =>${@document_id},
                            p_cdd_item		 =>${@cdd_item},
                            p_description    =>${@description},
                            p_cdd_item_id    =>${@cdd_item_id},
                            p_check_id		 =>${@check_id},
                            p_user_id        =>${/session/@user_id},
                            p_hard_copy      =>${@hard_copy},
                            p_original       =>${@original},
                            p_signed         =>${@signed},
                            p_availability   =>${@availability},
                            p_comments       =>${@comments}
                          );
                end;
            ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="delete">
            <bm:update-sql><![CDATA[
               begin
	                prj_cdd_item_pkg.prj_cdd_item_doc_ref_delete(
	                        p_document_table => ${/parameter/@document_table},
                            p_document_id    => ${/parameter/@document_id},
                            p_cdd_item_id    => ${/parameter/@cdd_item_id},
                            p_check_id       => ${/parameter/@check_id},
                            p_user_id        => ${/session/@user_id});
                end;
            ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
                begin
                	atm_upload_pkg.init_prj_cdd_item(
            			  p_templet_code           => ${/parameter/@templet_code},
                          p_document_id            => ${/parameter/@document_id},
                          p_document_table         => ${/parameter/@document_table},
                          p_chance_required_flag   => ${/parameter/@chance_required_flag},
                          p_chance_display_flag    => ${/parameter/@chance_display_flag},
                          p_project_required_flag  => ${/parameter/@project_required_flag},
                          p_project_display_flag   => ${/parameter/@project_display_flag},
                          p_contract_required_flag => ${/parameter/@contract_required_flag},
                          p_contract_display_flag  => ${/parameter/@contract_display_flag},
                          p_sign_required_flag     => ${/parameter/@sign_required_flag},
                          p_sign_display_flag      => ${/parameter/@sign_display_flag},
                          p_incept_required_flag   => ${/parameter/@incept_required_flag},
                          p_incept_display_flag    => ${/parameter/@incept_display_flag},
                          p_lender_required_flag   => ${/parameter/@lender_required_flag},
                          p_lender_display_flag    => ${/parameter/@lender_display_flag},
                          p_chance_tab_group       => ${/parameter/@chance_tab_group},
                          p_project_tab_group      => ${/parameter/@project_tab_group},
                          p_contract_tab_group     => ${/parameter/@contract_tab_group},
                          p_sign_tab_group         => ${/parameter/@sign_tab_group},
                          p_incept_tab_group       => ${/parameter/@incept_tab_group},
                          p_lender_tab_group       => ${/parameter/@lender_tab_group},
                          p_user_id                => ${/session/@user_id}
                		);
                end;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>