"tb42" class="mar10">
判断任务过期时间: create or replace function GetUrgentState(m_TaskID varchar2, m_SendTime date, m_flag varchar2) return varchar2 IS myDate date. ExpireTime date. strsql varchar2(200). begin myDate := m_SendTime. strsql := 0select max(EXPIRETIME) from t_wf_supervise where TASKID = || m_TaskID || . execute immediate strsql into ExpireTime. --没有到期时间 就是正常状态 if ExpireTime is null then if m_flag = String then return 正常 . end if. if m_flag = Img then return cb_execute.gif . end if. end if. --未发送任务,就是判断当前时间 if m_SendTime is null then myDate := sysdate. end if. if ExpireTime <. myDate then if m_flag = String then return 超期 . end if. if m_flag = Img then return cb_limit.gif . end if. end if. --小于3天的任务预警 if ExpireTime - myDate <. 3 then if m_flag = String then return 预警 . end if. if m_flag = Img then return cb_warning.gif . end if.