标签:循环控制 tle email des day out ber tac inpu
SELECT DISTINCT t2.xm_code,t2.xm_desc,t2.xm_contact,t3.user_email FROM xm_main t2 LEFT JOIN xm_agree_zb t1 ON t2.xm_code =t1.xm_code LEFT JOIN portal.t_acl_userinfo t3 ON t2.xm_contact=t3.username WHERE t2.xm_code IS NOT NULL AND t2.xm_status NOT IN (‘项目完成‘,‘项目冻结‘) AND (t2.delete_status<>‘1‘ OR t2.delete_status IS NULL) AND (t1.input_date <=DATE_SUB(NOW(),INTERVAL 8 DAY) OR t1.input_date IS NULL) AND t3.user_email IS NOT NULL AND t3.user_email <>‘‘ ORDER BY t2.xm_code DESC
//JavaScript脚本的代码
var prevRowx=previous_result.getRows(); if (prevRowx == null &&(prevRowx.size()=0)) { false; }else{ parent_job.setVariable("prevRowx", prevRowx);////ArrayList存储表名变量 parent_job.setVariable("ht_Size", prevRowx.size());//存储执行文件的总数量 parent_job.setVariable("ht_Num", 0);//循环控制变量 parent_job.setVariable("sid", prevRowx.get(0).getString("xm_code","xm_code")); true; }
SELECT t.USER_EMAIL mail_address FROM portal.t_acl_userinfo AS t WHERE t.username IN (SELECT DISTINCT t1.xm_contact lxr FROM xm_main t1 WHERE t1.xm_code=‘${xm_code}‘) AND t.user_email IS NOT NULL AND t.user_email <>‘‘
//JavaScript var p_mail_address = parent_job.getVariable("v_mail_address"); if(p_mail_address == null) { false; } else { true; }
//累加器
var list_dt_htbh =parent_job.getVariable("prevRowx").replace("[","").replace("]","").replace(" ","").split(","); var ht_Size = new Number(parent_job.getVariable("ht_Size")); var ht_Num = new Number(parent_job.getVariable("ht_Num"))+1; if(ht_Num<ht_Size){ parent_job.setVariable("xm_code", list_dt_htbh[ht_Num]); } parent_job.setVariable("ht_Num",ht_Num); true;
将结果输出查看
var list_dt_htbh =parent_job.getVariable("prevRowx");//这里没有去掉[] var ht_Size = new Number(parent_job.getVariable("ht_Size")); var ht_Num = new Number(parent_job.getVariable("ht_Num"))+‘1‘; if(ht_Num<ht_Size){ parent_job.setVariable("xm_code", list_dt_htbh[ht_Num]); } parent_job.setVariable("ht_Num",ht_Num); true;
输出结果日志
2020/07/17 16:45:33 - Get Variables.0 - field [prevRowx] has value [[[201908KF-ZYFD01471], [201908KF-ZYFD0147], [201905KF-ZGYH0144], [201901KF-ZGYH0136], [201901KF-ZGYH0135], [201901KF-GJKF0164], [201309KF-ZGYH0001]]] 2020/07/17 16:45:33 - Get Variables.0 - Signaling ‘output done‘ to 1\u8f93出 rowsets. 2020/07/17 16:45:33 - Get Variables.0 - 完成处理 (I=0, O=0, R=1, W=1, U=0, E=0 2020/07/17 16:45:33 - 字段选择.0 - 获取记录从前一个步骤: [undefined], [7], [0], [], [[[201908KF-ZYFD01471], [201908KF-ZYFD0147], [201905KF-ZGYH0144], [201901KF-ZGYH0136], [201901KF-ZGYH0135], [201901KF-GJKF0164], [201309KF-ZGYH0001]]] 2020/07/17 16:45:33 - 字段选择.0 - 写记录到下一个步骤: [undefined], [7], [0], [], [[[201908KF-ZYFD01471], [201908KF-ZYFD0147], [201905KF-ZGYH0144], [201901KF-ZGYH0136], [201901KF-ZGYH0135], [201901KF-GJKF0164], [201309KF-ZGYH0001]]] 2020/07/17 16:45:33 - 字段选择.0 - Signaling ‘output done‘ to 1\u8f93出 rowsets.
标签:循环控制 tle email des day out ber tac inpu
原文地址:https://www.cnblogs.com/smile502/p/13331990.html