prj_project.lwm 16.3 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 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-4-23 上午9:29:27  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="PRJ_PROJECT">
    <bm:fields>
        <bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROJECT_ID"/>
        <bm:field name="project_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_NAME" prompt="PRJ501.PRJ_PROJECT.PROJECT_NAME"/>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID"/>
        <bm:field name="bp_name" forInsert="false" forUpdate="false" prompt="PRJ501.PRJ_PROJECT.BP_NAME"/>
        <bm:field name="lease_chance_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_CHANCE_ID"/>
        <bm:field name="lease_chance_code" forInsert="false" forUpdate="false" prompt="HLS.LEASE_CHANCE_CODE"/>
        <bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STATUS"/>
        <bm:field name="status_desc" forInsert="false" forUpdate="false" prompt="PRJ501.PRJ_PROJECT.STATUS"/>
        <bm:field name="project_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_NUMBER" prompt="PRJ501.PRJ_PROJECT.PROJECT_NO"/>
        <bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE"/>
        <bm:field name="document_type_desc" forInsert="false" forUpdate="false" prompt="PRJ501.PRJ_PROJECT.DOCUMENT_TYPE"/>
        <bm:field name="business_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE"/>
        <bm:field name="document_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_CATEGORY"/>
        <bm:field name="lease_organization" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_ORGANIZATION" prompt="HLS.LEASE_ORGANIZATION_CODE"/>
        <bm:field name="lease_organization_desc" forInsert="false" forUpdate="false" prompt="HLS.LEASE_ORGANIZATION_NAME"/>
        <bm:field name="lease_channel" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANNEL" prompt="HLS.LEASE_CHANNEL_CODE"/>
        <bm:field name="lease_channel_desc" forInsert="false" forUpdate="false" prompt="HLS.LEASE_CHANNEL_NAME"/>
        <bm:field name="division" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DIVISION" prompt="HLS.DIVISION"/>
        <bm:field name="division_desc" forInsert="false" forUpdate="false" prompt="HLS.DIVISION_NAME"/>
        <bm:field name="owner_user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OWNER_USER_ID"/>
        <bm:field name="unit_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="UNIT_ID"/>
        <bm:field name="unit_name" forInsert="false" forUpdate="false" prompt="HLS.UNIT_NAME"/>
        <bm:field name="employee_id_of_manager" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EMPLOYEE_ID_OF_MANAGER"/>
        <bm:field name="employee_name_of_manager" forInsert="false" forUpdate="false" prompt="PRJ501.PRJ_PROJECT.EMPLOYEE_NAME_OF_MANAGER"/>
        <bm:field name="employee_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EMPLOYEE_ID"/>
        <bm:field name="employee_name" forInsert="false" forUpdate="false" prompt="PRJ501.PRJ_PROJECT.EMPLOYEE_NAME"/>
        <bm:field name="financed_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="FINANCED_AMOUNT" prompt="PRJ501.PRJ_PROJECT.FINANCED_AMOUNT"/>
        <bm:field name="financing_purpose" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FINANCING_PURPOSE" prompt="PRJ501.PRJ_PROJECT.FINANCING_PURPOSE"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION" prompt="PRJ501.PRJ_PROJECT.DESCRIPTION"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="PRJ501.PRJ_PROJECT.REF_V01"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="PRJ501.PRJ_PROJECT.REF_V02"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03" prompt="PRJ501.PRJ_PROJECT.REF_V03"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04" prompt="PRJ501.PRJ_PROJECT.REF_V04"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05" prompt="PRJ501.PRJ_PROJECT.REF_V05"/>
        <bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N01" prompt="PRJ501.PRJ_PROJECT.REF_N01"/>
        <bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N02" prompt="PRJ501.PRJ_PROJECT.REF_N02"/>
        <bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N03" prompt="PRJ501.PRJ_PROJECT.REF_N03"/>
        <bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N04" prompt="PRJ501.PRJ_PROJECT.REF_N04"/>
        <bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N05" prompt="PRJ501.PRJ_PROJECT.REF_N05"/>
        <bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01" prompt="PRJ501.PRJ_PROJECT.REF_D01"/>
        <bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02" prompt="PRJ501.PRJ_PROJECT.REF_D02"/>
        <bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03" prompt="PRJ501.PRJ_PROJECT.REF_D03"/>
        <bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04" prompt="PRJ501.PRJ_PROJECT.REF_D04"/>
        <bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05" prompt="PRJ501.PRJ_PROJECT.REF_D05"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="project_id" queryOperator="="/>
        <bm:query-field field="employee_id" queryOperator="="/>
        <bm:query-field field="unit_id" queryOperator="="/>
        <bm:query-field field="project_number" queryOperator="like"/>
    </bm:query-fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
    			select t1.project_id,
				       t1.project_name,
				       t1.bp_name,
				       t1.company_id,
				       t1.lease_chance_id,
				       t1.lease_chance_code,
				       t1.status,
				       t1.status_desc,
				       t1.project_number,
				       t1.document_type,
				       t1.document_type_desc,
				       t1.business_type,
				       t1.document_category,
				       t1.lease_organization,
				       t1.lease_organization_desc,
				       t1.lease_channel,
				       t1.lease_channel_desc,
				       t1.division,
				       t1.division_desc,
				       t1.owner_user_id,
				       t1.employee_id_of_manager,
				       t1.employee_name_of_manager,
				       t1.unit_id,
				       t1.unit_name,
				       t1.employee_id,
				       t1.employee_name,
				       t1.finance_amount,
				       t1.financing_purpose,
				       t1.description,
				       t1.ref_v01,
				       t1.ref_v02,
				       t1.ref_v03,
				       t1.ref_v04,
				       t1.ref_v05,
				       t1.ref_n01,
				       t1.ref_n02,
				       t1.ref_n03,
				       t1.ref_n04,
				       t1.ref_n05,
				       t1.ref_d01,
				       t1.ref_d02,
				       t1.ref_d03,
				       t1.ref_d04,
				       t1.ref_d05
				  from prj_project_v t1
    			#WHERE_CLAUSE#
    			 order by t1.project_number
    		]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="insert">
            <bm:parameters>
                <bm:parameter name="project_id" input="false" output="true" outputPath="@project_id"/>
                <bm:parameter name="project_no" input="true" inputPath="@project_no" output="true" outputPath="@project_no"/>
            </bm:parameters>
            <bm:update-sql><![CDATA[
	        	begin
				   PRJ501_PROJECT_SAVE_PKG.project_manage(p_sql_type		   	   => 'INSERT',
											  			  p_project_id             => ${@project_id},
											              p_project_name           => ${@project_name},
											              p_company_id             => ${/session/@company_id},
											              p_lease_chance_id        => ${@lease_chance_id},
											              p_status                 => ${@status},
											              p_project_no             => ${@project_no},
											              p_document_type          => ${@document_type},
											              p_document_category      => ${@document_category},
											              p_business_type          => ${@business_type},
											              p_lease_organization     => ${@lease_organization},
											              p_lease_channel          => ${@lease_channel},
											              p_division               => ${@division},
											              p_employee_id            => ${@employee_id},
											              p_owner_user_id          => ${/session/@user_id},
											              p_unit_id                => ${@unit_id},
											              p_employee_id_of_manager => ${@employee_id_of_manager},
											              p_financed_amount		   => ${@financed_amount},
											              p_financing_purpose      => ${@financing_purpose},
											              p_description            => ${@description},
											              p_user_id                => ${/session/@user_id},
											              p_ref_v01                => ${@ref_v01},
											              p_ref_v02                => ${@ref_v02},
											              p_ref_v03                => ${@ref_v03},
											              p_ref_v04                => ${@ref_v04},
											              p_ref_v05                => ${@ref_v05},
											              p_ref_n01                => ${@ref_n01},
											              p_ref_n02                => ${@ref_n02},
											              p_ref_n03                => ${@ref_n03},
											              p_ref_n04                => ${@ref_n04},
											              p_ref_n05                => ${@ref_n05},
											              p_ref_d01                => to_date(${@ref_d01},'yyyy-mm-dd'),
											              p_ref_d02                => to_date(${@ref_d02},'yyyy-mm-dd'),
											              p_ref_d03                => to_date(${@ref_d03},'yyyy-mm-dd'),
											              p_ref_d04                => to_date(${@ref_d04},'yyyy-mm-dd'),
											              p_ref_d05                => to_date(${@ref_d05},'yyyy-mm-dd'));
				end;
			]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
	        	begin
				   PRJ501_PROJECT_SAVE_PKG.project_manage(p_sql_type		   	   => 'UPDATE',
											  			  p_project_id             => ${@project_id},
											              p_project_name           => ${@project_name},
											              p_company_id             => ${/session/@company_id},
											              p_lease_chance_id        => ${@lease_chance_id},
											              p_status                 => ${@status},
											              p_project_no             => ${@project_no},
											              p_document_type          => ${@document_type},
											              p_document_category      => ${@document_category},
											              p_business_type          => ${@business_type},
											              p_lease_organization     => ${@lease_organization},
											              p_lease_channel          => ${@lease_channel},
											              p_division               => ${@division},
											              p_employee_id            => ${@employee_id},
											              p_owner_user_id          => ${/session/@user_id},
											              p_unit_id                => ${@unit_id},
											              p_employee_id_of_manager => ${@employee_id_of_manager},
											              p_financed_amount		   => ${@financed_amount},
											              p_financing_purpose      => ${@financing_purpose},
											              p_description            => ${@description},
											              p_user_id                => ${/session/@user_id},
											              p_ref_v01                => ${@ref_v01},
											              p_ref_v02                => ${@ref_v02},
											              p_ref_v03                => ${@ref_v03},
											              p_ref_v04                => ${@ref_v04},
											              p_ref_v05                => ${@ref_v05},
											              p_ref_n01                => ${@ref_n01},
											              p_ref_n02                => ${@ref_n02},
											              p_ref_n03                => ${@ref_n03},
											              p_ref_n04                => ${@ref_n04},
											              p_ref_n05                => ${@ref_n05},
											              p_ref_d01                => to_date(${@ref_d01},'yyyy-mm-dd'),
											              p_ref_d02                => to_date(${@ref_d02},'yyyy-mm-dd'),
											              p_ref_d03                => to_date(${@ref_d03},'yyyy-mm-dd'),
											              p_ref_d04                => to_date(${@ref_d04},'yyyy-mm-dd'),
											              p_ref_d05                => to_date(${@ref_d05},'yyyy-mm-dd'));
				end;
			]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="delete">
            <bm:update-sql><![CDATA[
	        	begin
				   PRJ501_PROJECT_SAVE_PKG.project_manage(p_sql_type		   	   => 'DELETE',
											  			  p_project_id             => ${@project_id},
											              p_project_name           => ${@project_name},
											              p_company_id             => ${/session/@company_id},
											              p_lease_chance_id        => ${@lease_chance_id},
											              p_status                 => ${@status},
											              p_project_no             => ${@project_no},
											              p_document_type          => ${@document_type},
											              p_document_category      => ${@document_category},
											              p_business_type          => ${@business_type},
											              p_lease_organization     => ${@lease_organization},
											              p_lease_channel          => ${@lease_channel},
											              p_division               => ${@division},
											              p_employee_id            => ${@employee_id},
											              p_owner_user_id          => ${/session/@user_id},
											              p_unit_id                => ${@unit_id},
											              p_employee_id_of_manager => ${@employee_id_of_manager},
											              p_financed_amount		   => ${@financed_amount},
											              p_financing_purpose      => ${@financing_purpose},
											              p_description            => ${@description},
											              p_user_id                => ${/session/@user_id},
											              p_ref_v01                => ${@ref_v01},
											              p_ref_v02                => ${@ref_v02},
											              p_ref_v03                => ${@ref_v03},
											              p_ref_v04                => ${@ref_v04},
											              p_ref_v05                => ${@ref_v05},
											              p_ref_n01                => ${@ref_n01},
											              p_ref_n02                => ${@ref_n02},
											              p_ref_n03                => ${@ref_n03},
											              p_ref_n04                => ${@ref_n04},
											              p_ref_n05                => ${@ref_n05},
											              p_ref_d01                => to_date(${@ref_d01},'yyyy-mm-dd'),
											              p_ref_d02                => to_date(${@ref_d02},'yyyy-mm-dd'),
											              p_ref_d03                => to_date(${@ref_d03},'yyyy-mm-dd'),
											              p_ref_d04                => to_date(${@ref_d04},'yyyy-mm-dd'),
											              p_ref_d05                => to_date(${@ref_d05},'yyyy-mm-dd'));
				end;
			]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="project_id"/>
    </bm:primary-key>
</bm:model>