sql=" select id from workflow_currentoperator \n"+
"where requestid = "+requestid+
"and nodeid= "+currentNodeId+
"and isremark = 4 \n"+
"and preisremark = 4 \n"+
"and receivedate in(select max(receivedate ) as receivedate from workflow_currentoperator where requestid = "+requestid+" and nodeid="+currentNodeId+")\n"+
"and receivetime in(select max(receivetime) as receivetime from workflow_currentoperator where requestid = "+requestid+" and nodeid="+currentNodeId+")";
sql=" select distinct id as userid from workflow_forecastOperator t1 where t1.requestid = "+requestid+" and t1.nodeid ="+currentNodeId+" and t1.operateType in(-3,-4) ";
@ -520,23 +523,18 @@ public class SendPortalMonitorUtil {
if("3".equals(currentnodetype)){
JSONArraytaskObjectList=newJSONArray();
sql=" select t2.userid,h1.loginid,h1.lastname,h1.email,t2.isremark,t1.requestid,t2.nodeid,d1.nodename,c1."+cus_staff+" as staffid "+
" from workflow_requestbase t1\n"+
" inner join workflow_currentoperator t2 on t1.requestid = t2.requestid\n"+
" left join cus_fielddata c1 on c1.id = t2.userid and c1.scopeid= "+scopeid+" and c1.scope = '"+scope+"' "+
" left join (select id, lastname,loginid,email from hrmresource where STATUS = 1 union all select id,lastname,loginid,'' as email from hrmresourcemanager ) h1 on h1.id = t2.userid\n"+
" left join workflow_nodebase d1 on d1.id = t2.nodeid "+
" where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n"+
" and t2.isremark =2 and t2.preisremark in (8,9) \n"+
" and t2.islasttimes = 1 \n"+
" and (t2.isprocessing = '' or t2.isprocessing is null)\n"+
" and t2.requestid = "+requestid;
sql=" select t2.id as userid,c1."+cus_staff+" as staffid,h1.loginid \n"+
" from ( select distinct id from workflow_forecastOperator t1 where t1.requestid = "+requestid+" and t1.nodeid ="+currentNodeId+" and t1.operateType in(-3,-4) ) t2 "+
" left join cus_fielddata c1 on c1.id = t2.id and c1.scopeid="+scopeid+" and c1.scope = '"+scope+"' \n"+
" left join (select id,lastname,loginid,email from hrmresource where status = 1 union all select id,lastname,loginid,'' as email from hrmresourcemanager ) h1 on h1.id = t2.id \n";
@ -891,42 +920,12 @@ public class SendPortalMonitorUtil {
requestObject.put("nodeName",currentNodeName);
requestObject.put("ticketType",workflowname);
JSONArraytaskObjectList=newJSONArray();
sql=" select t2.userid,h1.loginid,h1.lastname,h1.email,t2.isremark,t1.requestid,t2.nodeid,d1.nodename,c1."+cus_staff+" as staffid "+
" from workflow_requestbase t1\n"+
" inner join workflow_currentoperator t2 on t1.requestid = t2.requestid\n"+
" left join cus_fielddata c1 on c1.id = t2.userid and c1.scopeid= "+scopeid+" and c1.scope = '"+scope+"' "+
" left join (select id, lastname,loginid,email from hrmresource where STATUS = 1 union all select id,lastname,loginid,'' as email from hrmresourcemanager ) h1 on h1.id = t2.userid\n"+
" left join workflow_nodebase d1 on d1.id = t2.nodeid "+
" where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n"+
" and ((t2.isremark = '0' and (t2.takisremark is null or t2.takisremark = 0)) or t2.isremark in ('1','5','8','9','7','11')) \n"+
" and t2.islasttimes = 1 \n"+
" and (t2.isprocessing = '' or t2.isprocessing is null)\n"+
sql=" select t2.userid,h1.loginid,h1.lastname,h1.email,t2.isremark,t1.requestid,t2.nodeid,d1.nodename,c1."+cus_staff+" as staffid "+
" from workflow_requestbase t1\n"+
" inner join workflow_currentoperator t2 on t1.requestid = t2.requestid\n"+
" left join cus_fielddata c1 on c1.id = t2.userid and c1.scopeid= "+scopeid+" and c1.scope = '"+scope+"' "+
" left join (select id, lastname,loginid,email from hrmresource where STATUS = 1 union all select id,lastname,loginid,'' as email from hrmresourcemanager ) h1 on h1.id = t2.userid\n"+
" left join workflow_nodebase d1 on d1.id = t2.nodeid "+
" where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n"+
" and ((t2.isremark = '0' and (t2.takisremark is null or t2.takisremark = 0)) or t2.isremark in ('1','5','8','9','7','11')) \n"+
" and t2.islasttimes = 1 \n"+
" and (t2.isprocessing = '' or t2.isprocessing is null)\n"+