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;