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(函数)的步骤实例相关推荐
- mybatis可以用oracle,使用MyBatis调用oracle函数(基于注释)
我需要使用注解在MyBatis中调用Oracle函数.使用MyBatis调用oracle函数(基于注释) 我的映射: @Select("{ CALL #{outParam, jdbcType ...
- qt 处理oracle事务,qt调用oracle存储过程,该怎么处理(2)
当前位置:我的异常网» QT开发 » qt调用oracle存储过程,该怎么处理 qt调用oracle存储过程,该怎么处理(2) www.myexceptions.net 网友分享于:2013-03- ...
- java调用oracle过程,JAVA调用ORACLE存储过程报错
当前位置:我的异常网» Java Web开发 » JAVA调用ORACLE存储过程报错 JAVA调用ORACLE存储过程报错 www.myexceptions.net 网友分享于:2015-07-1 ...
- c oracle udt,c#调用Oracle UDT自定义结构数组类型源代码
[实例简介] c#调用Oracle UDT自定义结构数组类型源代码 [实例截图] [核心代码] ffa2062d-cc85-43bf-9aeb-2cf440e254c3 └── vsstart └── ...
- java调用oracle存储过程_java调用oracle存储过程详解
之前给大家介绍了java代码调用存储过程,下面要给大家介绍的就是java当中调用oracle存储过程,一起来看看吧. 首先来看一下项目结构: 在数据库创建存储过程的脚本,假如,使用的是本地的oracl ...
- c#调用oracle存储过程,c#调用oracle存储过程
c#调用oracle存储过程 CREATE OR REPLACE PACKAGE pkg_tableType IS type Tabletype is ref cursor; PROCEDURE SP ...
- c# 调用oracle function,C#调用Oracle存储过程的方法
GetReviewTask public string GetReviewTask(GetReviewTaskInput input) { /* * 试过三种写法都不对,暂时找不出是什么原因,改成拼S ...
- hibernate 调用oracle存储过程,hibernate调用oracle存储过程||函数
pakeage dao.Impl; //调用函数FUN_GET(); public String get(String Id,String Name){ return getSession().cre ...
- c#怎么调用oracle存储过程,c# 调用oracle 存储过程、方法简易例子
oracle调用了,sql也差不多多,只是有些数据类型不同而已:最终如何定义还是看存储过程如何写的. 调用存储过程: using (OleDbConnection con = new OleDbCon ...
- oracle批处理参数调用,Oracle数据库定时自动备份批处理代码(Windows)
这是最近写的一个Oracle数据库自动备份的批处理,经过测试正常运行,记录如下.包括两部分,逻辑备份和冷备份,如有不完整之处,还往看到本文的高手指导! 注:这些内容是本人经过一番学习和多次测试调试后的 ...
最新文章
- mysql期中考试题及答案_MySQL练习题及答案
- DPI — nDPI — 安装部署与应用示例
- 网页视频播放器插件源码
- C++:MSVCRTD.lib(crtexe.obj) : error LNK2019: 无法解析的外部符号 _main,该符号在函数 ___tmainCRTStart...
- C++空指针访问成员函数
- php的冷门但是很实用的函数
- 纯JavaScript实现的调用设备摄像头并拍照的功能
- 猫、狗与Java的多态
- EditText 双击才能获取点击事件
- 【LeetCode】剑指 Offer 55 - II. 平衡二叉树
- 为什么华为a1路由器网速变慢_上网用的路由器晚上要不要关?1个月能耗多少电?答案很意外!...
- opencv3.1.0 交叉编译 H3516a
- 死磕 java同步系列之AQS起篇
- 区块链应用大数据的优势有哪些
- 报错:libtool: Version mismatch error. This is libtool 2.4.6解决
- H.264/AVC的编码格式
- 【原】豆瓣电台桌面版插件开发——搜索插件
- 对recv函数的一些理解
- 自然语言处理系列十七》中文分词》分词工具实战》Python的Jieba分词
- 奥德赛商务车改装哪一些是必要的?