BEGIN
AN_O_RET_CODE := 0;
AC_O_RET_MSG := "";
select COUNT (*) INTO COUNTALL from (
select kf_id,o.name kf_name,sessionid,decode(score,"1","","2","","0","",score) as satis,to_char(create_time,"yyyy-mm-dd HH:MM:ss")
from tb_zxkf_evaluate e
left join tb_sso_oper o on e.kf_id = o.logincode
where to_char(create_time,"yyyymmdd") between BEGINDATE and ENDDATE
);
limit2:=limit1;
if limit1<0 then
limit2:=COUNTALL;
end if;
--/* */
OPEN CUR_RET FOR
SELECT * FROM (SELECT ROWNUM AS ROW_NUM,WM.* FROM(
select kf_id,o.name kf_name,sessionid,decode(score,"1","","2","","0","",score) as satis,to_char(create_time,"yyyy-mm-dd HH:MM:ss") as create_time
from tb_zxkf_evaluate e
left join tb_sso_oper o on e.kf_id = o.logincode
where to_char(create_time,"yyyymmdd") between BEGINDATE and ENDDATE
)WM order by create_time desc) WHERE ROW_NUM BETWEEN start1 AND limit2;
EXCEPTION
WHEN OTHERS THEN
AN_O_RET_CODE := -1;
AC_O_RET_MSG := ":" || SQLCODE || CHR(13) || ":" || SQLERRM;
END ZXKF_SatisDet;