日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ibatis oracle function,IBATIS调用oracle function(函数)的步骤实例

發布時間:2023/12/20 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ibatis oracle function,IBATIS调用oracle function(函数)的步骤实例 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

IBATIS調用oracle function(函數)的方法實例

引用

create or replace function getClassifiedCode(p_planCode in varchar2 -- 險種代碼

,

p_usageAttributeCode in varchar2 -- 使用性質代碼

,

p_ownershipAttributeCode in varchar2 -- 所屬性質代碼

,

p_vehicleTypeCode in varchar2 -- 車輛種類代碼

) return varchar2 is

v_classified_code varchar2(10);

v_vehicleTypeCode varchar2(200) := p_vehicleTypeCode;

v_message varchar2(2000);

-- 定義字符串數組類型

type type_array is varray(9) of varchar2(200);

vehicleArray type_array := type_array('A010:A011:A012',

'A020:A021:A022:A032',

'A030:A031:A042:A052',

'B010:B011:B012',

'B020:B021:B022:B032',

'B030:B031:B042',

'C010:C011:C020:C021:C030:C031:B140:B141:E010:E011:E110:E111:C012:C022:C032:C042:B142:E012:E022:E112:E122',

'D110:D111:D010:D011:D012:D022:D112',

'C012:C112:C122:C132:C142:C152:C162:C172:C182');

begin

for i in 1 .. vehicleArray.count loop

if (instr(vehicleArray(i), p_vehicleTypeCode, 1, 1) > 0) then

v_vehicleTypeCode := vehicleArray(i);

exit;

end if;

end loop;

select max(class_rule_code)

into v_classified_code

from class_rule_factor

where factor_code = 'F00085'

and factor_value_set = p_planCode;

if (v_classified_code is not null) then

return v_classified_code;

end if;

select max(class_rule_code)

into v_classified_code

from class_rule_factor

where class_rule_code in

(select distinct class_rule_code

from class_rule_factor

where class_rule_code in

(select distinct class_rule_code

from class_rule_factor

where factor_code = 'F00039'

and factor_value_set = p_usageAttributeCode)

and factor_code = 'F00040'

and factor_value_set = p_ownershipAttributeCode)

and factor_code = 'F00042'

and factor_value_set = v_vehicleTypeCode;

if (v_classified_code is not null) then

return v_classified_code;

end if;

select max(class_rule_code)

into v_classified_code

from class_rule_factor

where class_rule_code in

(select distinct class_rule_code

from class_rule_factor

where factor_code = 'F00039'

and factor_value_set = p_usageAttributeCode)

and factor_code = 'F00042'

and factor_value_set = v_vehicleTypeCode;

if (v_classified_code is not null) then

return v_classified_code;

end if;

select distinct max(class_rule_code)

into v_classified_code

from class_rule_factor

where factor_code = 'F00999'

and factor_value_set = 'OTHER';

return v_classified_code;

exception

when others then

v_message := sysdate || '日運行錯誤,錯誤號:' || SQLCODE || '錯誤原因:' ||

substr(sqlerrm, 1, 1800);

-- dbms_output.put_line(v_message);

return null;

end getClassifiedCode;

@Override

public String getClassifiedCode(Map paramMap) throws PafaDAOException {

String classifiedCode = null;

try{

this.getSqlMapClientTemplate().queryForObject("apply.getClassifiedCode", paramMap);

classifiedCode = (String) paramMap.get("result");

}catch(DataAccessException e){

throw NBAExceptionFactory.createPafaDAOException(this.getClass().getName(), "getClassifiedCode", "根據險種代碼查找classifiedCode異常 .", "參數:paramMap = "+paramMap, e);

}

return classifiedCode;

}

{ ?= call epciscde.getClassifiedCode(?,?,?,?)}

總結

以上是生活随笔為你收集整理的ibatis oracle function,IBATIS调用oracle function(函数)的步骤实例的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。