函数名:noModify
BEGIN
declare auditP int(10);
declare scoreP double(20,2);
declare sid int(10) ;
declare cid int(10);
SET sid=( SELECT auditId FROM a_countdown where isuse='1' and type='4' and endtime<NOW() limit 1);
SET cid=( SELECT id FROM a_countdown where isuse='1' and type='4' and endtime<NOW() limit 1 );
if sid is not null and sid<>0 then
set auditP=(select auditObject from audit_process where id=sid);
set scoreP=(select score from audit_process where id=sid);
insert into jf_userscorelog (userid,auditid,score,scorenameid,scoringtime,scorereason,scoreruleid)
values(auditP,sid,scoreP,11,SYSDATE(),'对员工工作绩效考核的评分',33);
update audit_process set state=4,isrechange=0 where id = sid;
DELETE from a_countdown where id=cid;
end if;
END
说明: declare是声明一个参数
可以在计划事件中执行函数 noModify ,如:
BEGIN
call noModify();
END
配置计划示例
也可以在事件中直接写,如:
BEGIN
delete from t_task_affix where length(taskid)>32;
delete from bs_backcashplanissue where length(planId)>32;
delete from f_feedback where length(feedbackid)>32;
END
本文介绍了一个自定义函数`noModify`,用于在特定条件下更新用户评分和系统状态。通过调用此函数,系统可以执行一系列操作,包括从数据库中检索审计ID和计数器ID,然后根据审计ID更新用户评分、状态和记录评分日志。此外,该函数还负责删除不再使用的计数器ID,确保系统资源的有效管理和优化。
2万+

被折叠的 条评论
为什么被折叠?



