oracle pl sql case,oracle plsql case when_end case小记

create or replace function func_1_2_mv_orderstatus(in_orderbill_status in portal_orderbill.orderbill_status%type)

/* 过程、函数简要描述信息

**********************************************************

*  函数名  : func_1_2_mv_orderstatus

*  建立日期      : 2012-11-30

*  作者              :

*  模块              :

*  功能描述      :

*  输入参数      :

*

*

*  输出参数      :

*  源表:

*  目标表:

*  备注:                      :

*------------------------------------------------------------

*  修改历史

*  序号    日期             修改人      修改原因

*  1       2012-11-30              创建

************************************************************ */

return  integer

is

v_result integer;

begin

--一期订单 订单状态

/*  订单状态:0关闭,1支付成功2未支付3支付失败,4已下发

,5计费成功,6计费失败,7待审核,8审核驳回,9审核通过

,10退款已受理,11退款成功,101已经预约,102等待通知,103待(收货)付款

,55充值中,111充值请求成功,222充值请求失败,

555充值请求中*/

--二期增值业务订单 订单状态

/*订单状态:0初始状态,1成功,2失败

见字典表s_dic.dic_type='BILL_STATUS'*/

case

when in_orderbill_status='1'       then v_result:=1;

when in_orderbill_status='2'       then v_result:=0;

when in_orderbill_status='4'       then v_result:=0;

when in_orderbill_status='5'       then v_result:=1;

when in_orderbill_status='6'       then v_result:=2;

when in_orderbill_status='7'       then v_result:=0;

when in_orderbill_status='8'       then v_result:=2;

when in_orderbill_status='9'       then v_result:=1;

when in_orderbill_status='10'      then v_result:=2;

when in_orderbill_status='103'     then v_result:=0;

when in_orderbill_status='111'     then v_result:=1;

when in_orderbill_status='222'     then v_result:=2;

when in_orderbill_status='500'     then v_result:=0;

when in_orderbill_status='501'     then v_result:=0;

when in_orderbill_status='502'     then v_result:=0;

when in_orderbill_status='505'     then v_result:=0;

when in_orderbill_status='555'     then v_result:=0;

when in_orderbill_status='601'     then v_result:=0;

end case;

return v_result;

end func_1_2_mv_orderstatus;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值