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

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

[已解决] 如何用代码模式实现如下功能

[复制链接]
常州易龙信息 发表于 2013-7-8 11:21:10 | 显示全部楼层 |阅读模式
本帖最后由 shary 于 2013-7-8 16:34 编辑

teemlink.jpg
如题。
shary 发表于 2013-7-8 13:48:44 | 显示全部楼层
回复 1# 常州易龙信息


    您好,关于这类问题的解决方案是在视图设置模式按照您如图设置,然后再前台点击该视图获取对应tomcat控制台的sql就是您该逻辑的sql了。本地按照您一楼的需求对应通过这种方式获取TLK_分支流程的sql如下:
SELECT d.* FROM TLK_分支流程 d WHERE D.ID IN(select distinct doc.id DOCID  from  OBPM_APP.T_DOCUMENT  doc,OBPM_APP.T_ACTORHIS ahis,OBPM_APP.T_RELATIONHIS rhis,OBPM_APP.T_FLOW_INTERVENTION pen,OBPM_APP.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 = '11e1-7f98-dc0c84d6-a04d-05b43c063ac2' )  OR d.AUTHOR ='11e1-7f98-dc0c84d6-a04d-05b43c063ac2' OR (d.ID IN(SELECT DOC_ID FROM AUTH_分支流程 AUTH WHERE AUTH.VALUE = '11e1-7f98-dc0c84d6-a04d-05b43c063ac2'))

参数解析:
TLK_分支流程  --查询的表名
OBPM_APP.T_DOCUMENT  doc,OBPM_APP.T_ACTORHIS ahis,OBPM_APP.T_RELATIONHIS rhis,OBPM_APP.T_FLOW_INTERVENTION pen,OBPM_APP.T_FLOWSTATERT fs--该表所在业务库下的相关系统表
11e1-7f98-dc0c84d6-a04d-05b43c063ac2  --前台登录用户ID

您先参考该sql完善,有问题我们再沟通。
shary 发表于 2013-7-8 16:34:06 | 显示全部楼层
Q上客户反馈通过提供的解决方案对应问题已解决。
 楼主| 常州易龙信息 发表于 2013-11-22 14:01:57 | 显示全部楼层
使用代码实现上述查询时,再增加其他查询条件时无效
  1. select * from TLK_tt_clientRepairs where ID IN(select distinct doc.id DOCID from T_DOCUMENT doc,T_ACTORHIS ahis,T_RELATIONHIS rhis,T_FLOW_INTERVENTION pen,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 = '11e2-ef46-4a45befe-82a6-494f46ad2509' ) OR AUTHOR ='11e1-7f98-dc0c84d6-a04d-05b43c063ac2' OR (ID IN(SELECT DOC_ID FROM AUTH_tt_clientRepairs AUTH WHERE AUTH.VALUE = '11e2-ef46-4a45befe-82a6-494f46ad2509')) and ITEM_cr_teams='11e2-dfd4-c76b3976-ace6-81005c945946' and statelabel='工程部处理' and statelabel !='结束'
复制代码
kimi 发表于 2013-11-22 14:53:32 | 显示全部楼层
您好:您上面的sql语句在sql客户端执行都有问题,把您的sql语句改为类似如下:

  1. select * from TLK_tt_clientRepairs where ( ID IN(select distinct doc.id DOCID from T_DOCUMENT doc,T_ACTORHIS ahis,T_RELATIONHIS rhis,T_FLOW_INTERVENTION pen,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 = '11e2-ef46-4a45befe-82a6-494f46ad2509' ) OR AUTHOR ='11e1-7f98-dc0c84d6-a04d-05b43c063ac2' OR (ID IN(SELECT DOC_ID FROM AUTH_tt_clientRepairs AUTH WHERE AUTH.VALUE = '11e2-ef46-4a45befe-82a6-494f46ad2509'))) and ITEM_cr_teams='11e2-dfd4-c76b3976-ace6-81005c945946' and statelabel='工程部处理' and statelabel !='结束'
复制代码
您先尝试,有问题我们再沟通。

本版积分规则

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

GMT+8, 2026-8-13 10:28

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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