create or replace function f_login_pwd_check
(
i_in_operateid in number, --操作员账号
i_in_operatortype in number, --操作员类型(1.系统管理员 2.铃音制作商 3.集团管理员)
i_in_loginPwdTimeout in number --配置项中密码有效期
) return integer --返回值 0过期 1没过期
is
i_l_count integer;
i_l_lastpwdtime integer;
dt_l_createtime date;
begin
select count(1) into i_l_count
from t_operatorinfo
where operateid = i_in_operateid and operatortype = i_in_operatortype;
if (i_l_count = 0) then
insert into t_operatorinfo
(
operateinfoid,
operateid,
operatortype,
status,
lastlogined,
failnum,
lastpwdtime
)
values
(
s_operatorinfoid.nextval,
i_in_operateid,
i_in_operatortype,
1,
sysdate,
0,
dt_l_createtime
);
commit;
end if;
select (sysdate - lastpwdtime) * 24 * 60 * 60 into i_l_lastpwdtime
from t_operatorinfo
where operateid = i_in_operateid and operatortype = i_in_operatortype;
if (i_l_lastpwdtime < i_in_loginPwdTimeout*24*60*60) then
return 1;
end if;
return 0;
exception
when others then
--记录异常信息
rollback;
return -1;
end f_login_pwd_check;
--创建存储过程--
create or replace procedure p_statsinfo
as
i_l_return integer;
i_l_result integer;
dt_l_statsdate date;
begin
dt_l_statsdate := trunc(sysdate);
i_l_result := f_di_statsinfo(dt_in_statsdate => dt_l_statsdate,i_out_result =>i_l_result );
end p_statsinfo;
(
i_in_operateid in number, --操作员账号
i_in_operatortype in number, --操作员类型(1.系统管理员 2.铃音制作商 3.集团管理员)
i_in_loginPwdTimeout in number --配置项中密码有效期
) return integer --返回值 0过期 1没过期
is
i_l_count integer;
i_l_lastpwdtime integer;
dt_l_createtime date;
begin
select count(1) into i_l_count
from t_operatorinfo
where operateid = i_in_operateid and operatortype = i_in_operatortype;
if (i_l_count = 0) then
insert into t_operatorinfo
(
operateinfoid,
operateid,
operatortype,
status,
lastlogined,
failnum,
lastpwdtime
)
values
(
s_operatorinfoid.nextval,
i_in_operateid,
i_in_operatortype,
1,
sysdate,
0,
dt_l_createtime
);
commit;
end if;
select (sysdate - lastpwdtime) * 24 * 60 * 60 into i_l_lastpwdtime
from t_operatorinfo
where operateid = i_in_operateid and operatortype = i_in_operatortype;
if (i_l_lastpwdtime < i_in_loginPwdTimeout*24*60*60) then
return 1;
end if;
return 0;
exception
when others then
--记录异常信息
rollback;
return -1;
end f_login_pwd_check;
--创建存储过程--
create or replace procedure p_statsinfo
as
i_l_return integer;
i_l_result integer;
dt_l_statsdate date;
begin
dt_l_statsdate := trunc(sysdate);
i_l_result := f_di_statsinfo(dt_in_statsdate => dt_l_statsdate,i_out_result =>i_l_result );
end p_statsinfo;