函数名: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