天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
查看: 1793|回复: 0

[Iscript] 如何用sql语句查出我参与的所有流程的记录【视图-SQl查询我办理过的所有流程记录】

[复制链接]
irene 发表于 2012-6-27 09:59:05 | 显示全部楼层 |阅读模式
本帖最后由 bess 于 2013-1-6 10:02 编辑

Q:如何在视图sql模式中用sql语句查出我参与的所有流程的记录
A:可参考如下脚本:
  1. var userid =getWebUser().getId();
  2. var sql="SELECT * FROM TLK_FM_DISPATCH where id in(select doc.id from  GALLOPSOA.T_DOCUMENT  doc,GALLOPSOA.T_FLOW_INTERVENTION pen,GALLOPSOA.T_FLOWSTATERT fs,GALLOPSOA.T_NODERT node,GALLOPSOA.T_ACTORRT actor  where doc.id = pen.id and doc.id =fs.docid and fs.id =node.flowstatert_id and  node.id = actor.nodert_id and doc.issubdoc is null and doc.parent is null and doc.state is not null and doc.statelabel is not null  and actor.actorid ='";
  3. sql += userid;
  4. sql += "' UNION select doc.id from  GALLOPSOA.T_DOCUMENT  doc,GALLOPSOA.T_ACTORHIS ahis,GALLOPSOA.T_RELATIONHIS rhis,GALLOPSOA.T_FLOW_INTERVENTION pen,GALLOPSOA.T_FLOWSTATERT fs where doc.id=rhis.docid and rhis.id = ahis.nodehis_id and doc.id = pen.id and doc.id =fs.docid and doc.issubdoc is null and doc.parent is null and doc.state is not null and doc.statelabel is not null  and ahis.actorid='";
  5. sql += userid ;
  6. sql +="')";
  7. sql;
复制代码

本版积分规则

QQ|手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-12 15:26

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表