--主表单
select * from ce_administration_procure t where t.id ='HZe992733d668dc6013d671df4760349';
--流程实例表:记录创建的流程基本信息与当前表单名称的信息
select * from TW_HORIZON_Instance t where t.id = 'HZe992733d668dc6013d671df4600347';
--节点表:记录节点状态、节点名称、节点编码等信息;workid为TW_HORIZON_Instance的id
select * from  tw_horizon_author t where t.workid = 'HZe992733d668dc6013d671df4600347';
--主表单与流程表、节点表的中间关系表;workid为TW_HORIZON_Instance的id,dataid为ce_administration_procure的id
select * from twr_horizon_instance t where t.dataid = 'HZe992733d668dc6013d671df4760349';
--记录流程走向与审批流向过程信息:例如上一节点办理人、当前节点办理人;DATAID为TW_HORIZON_Instance的id
select a.* from vd_horizon_todo a  where a.DATAID='HZe992733d668dc6013d671df4600347';

--中间表:TW_HORIZON_Instance与vd_horizon_todo的中间表,
--TW_HORIZON_Instance A 、vd_horizon_todo  B 、 TD_HORIZON_User C
--A.id = B.dataid   A.id = C.dataid  B.id = C.todoid
--由于A、B表可以不通过C表关联,并且中间表的流程状态、当前办理人id在B表中已经存在,所以可以不使用C表
select * from TD_HORIZON_User E where dataid='HZe992733d668dc6013d671df4600347';

--与vd_horizon_todo表存储的信息基本相同,不过没有realuserid字段(当前办理人id);DATAID为TW_HORIZON_Instance的id
select * from TD_HORIZON_Info a where a.DATAID='HZe992733d668dc6013d671df4600347';
--当前流程所处节点的实例信息; id为TW_HORIZON_Instance表的id
select * from vd_horizon_instance d where id='HZe992733d668dc6013d671df4600347';

--状态:TD_HORIZON_User、tw_horizon_author
--status状态:1为待办,2、6为待阅,3为已办,4为已阅,5为删除
--TW_HORIZON_AUTHOR D d.flowstatus = 0
--flowstatus状态:0=起草,1=正常,2=会签,3=退回,4=拿回,5=子流程启动中,7=正常结束,8=异常结束,900X=暂停中(X 表示暂停前的流程状态),1000X=已撤销(X 表示撤销前的流程状态)

--使用到的表:A ce_administration_procure(使用id)、B TW_HORIZON_Instance(使用id)、C twr_horizon_instance(中间表使用workid、dataid)、D tw_horizon_author(使用flowstatus)、E TD_HORIZON_User(使用userid、status)
--A.id = C.dataid  B.id = C.workid  C.workid=D.workid  C.workid=E.dataid

--<input type=checkbox name=ids value='|b.id|'>

--ce_administration_procure A,TW_HORIZON_Instance B,TWR_HORIZON_Instance C,TW_HORIZON_AUTHOR D,TD_HORIZON_User E

--a.id = c.dataid and b.id = c.workid and c.workid = d.workid and c.workid = e.dataid and d.flowstatus !='0' and a.apply_type != '区域保洁' and e.userid='|userid|' and (e.status='2' or  e.status='6')

delete from ce_administration_detail

--删除某条业务数据
--1、查询业务表id
select a.id  from ce_administration_procure a;
--2、查询中间表C表的workid
select c.workid from twr_horizon_instance c where c.dataid='';
--3、删除B、D、E表数据
delete from TW_HORIZON_Instance b where b.id='';
delete from tw_horizon_author d where d.workid='';
delete from TD_HORIZON_User e where e.dataid='';
--4、删除中间表C表数据
delete from twr_horizon_instance c where c.dataid='';
--5、删除业务表A表数据
delete from ce_administration_procure a where a.id='';

--删除所有业务数据
--1、查询业务表id
select a.id  from ce_administration_procure a;
--2、查询中间表C表的workid
select c.workid from twr_horizon_instance c where c.dataid in(select a.id  from ce_administration_procure a);
--3、删除B、D、E表数据
delete from TW_HORIZON_Instance b where b.id in(select c.workid from twr_horizon_instance c where c.dataid in(select a.id  from ce_administration_procure a));
delete from tw_horizon_author d where d.workid  in(select c.workid from twr_horizon_instance c where c.dataid in(select a.id  from ce_administration_procure a));
delete from TD_HORIZON_User e where e.dataid  in(select c.workid from twr_horizon_instance c where c.dataid in(select a.id  from ce_administration_procure a));
--4、删除中间表C表数据
delete from twr_horizon_instance c where c.dataid in(select a.id  from ce_administration_procure a);
--5、删除业务表A表数据
delete from ce_administration_procure a;

Working——流程关系状态表的更多相关文章

  1. Linux/UNIX流程关系

    流程关系 过程组 除了一个过程,每个过程ID此外.也属于一个进程组.过程基是一个或多个过程的集合. 通常它们与相同的作业相关联,它接受各种信号从相同终端. #include<unistd.h&g ...

  2. 关于OA流程相关数据表的设计

    一.前言 近期有些同学问起流程的表设计,终于有时间能写下博客,并整理下之前所发布的文章. 之前的文章讲到的表设计,没有给全且还存在漏洞,在这里向各位同学表示歉意.这是我个人最新领悟的一些流程思维,欢迎 ...

  3. activiti自定义流程之自定义表单(三):表单列表及预览和删除

    注:(1)环境配置:activiti自定义流程之自定义表单(一):环境配置 (2)创建表单:activiti自定义流程之自定义表单(二):创建表单 自定义表单创建成功,要拿到activiti中使用,自 ...

  4. activiti自定义流程之自定义表单(二):创建表单

    注:环境配置:activiti自定义流程之自定义表单(一):环境配置 在上一节自定义表单环境搭建好以后,我就正式开始尝试自己创建表单,在后台的处理就比较常规,主要是针对ueditor插件的功能在前端进 ...

  5. http 状态表

    整理一下xmlHttp.status的值(http 状态表)   状态码 状态码 意义 释义 100 1xx (临时响应)表示临时响应并需要请求者继续执行操作的状态代码.  继续 客户端应当继续发送请 ...

  6. django模型中有外键关系的表删除相关设置

    0904自我总结 django模型中有外键关系的表删除相关设置 一.一对一 例如有Author.AuthorDetail两表 author = models.OneToOneField(to='Aut ...

  7. Python3-sqlalchemy-orm 多对多关系建表、插入数据、查询数据

    现在来设计一个能描述"图书"与"作者"的关系的表结构,需求是 一本书可以有好几个作者一起出版 一个作者可以写好几本书 此时你会发现,用之前学的外键好像没办法实现 ...

  8. day03 mysql外键 表的三种关系 单表查询 navicat

    day03 mysql navicat   一.完整性约束之     外键 foreign key     一个表(关联表: 是从表)设置了外键字段的值, 对应的是另一个表的一条记录(被关联表: 是主 ...

  9. activiti自定义流程之自定义表单(一):环境配置

    先补充说一下自定义流程整个的思路,自定义流程的目的就是为了让一套代码解决多种业务流程,比如请假单.报销单.采购单.协作单等等,用户自己来设计流程图. 这里要涉及到这样几个基本问题,一是不同的业务需求, ...

随机推荐

  1. 运行jar应用程序引用其他jar包的四种方法(转)

    Runnable JAR  RunnableJAR(1)在Eclipse中操作 上面的截图中eclipse的版本是: 方案二:安装Eclipse打包插件Fat Jar 方案一对于含有较多第三方jar文 ...

  2. 精确覆盖DLX算法模板另一种写法

    代码 struct DLX { int n,id; int L[maxn],R[maxn],U[maxn],D[maxn]; ]; int H[ms]; ) //传列长 { n=nn; ;i<= ...

  3. Hdu2437-Jerboas(取余数判重搜索)

    Jerboas are small desert-living animals, which resemble mice with a long tufted tail and very long h ...

  4. LeetCode198 House Robber

    You are a professional robber planning to rob houses along a street. Each house has a certain amount ...

  5. 《Algorithms 4th Edition》读书笔记——3.1 符号表(Elementary Symbol Tables)-Ⅲ

    3.1.3 用例举例 在学习它的实现之前我们还是应该先看看如何使用它.相应的我们这里考察两个用例:一个用来跟踪算法在小规模输入下的行为测试用例和一个来寻找更高效的实现的性能测试用例. 3.1.3.1 ...

  6. Static用法

    一.Static全局变量和全局变量的区别 1)全局变量(外部变量)的说明之前再冠以static 就构成了静态的全局变量.全局变量本身就是静态存储方式, 静态全局变量当然也是静态存储方式. 这两者在存储 ...

  7. IT人员应该怎么跳槽

    中国的程序员只有两个状态,刚跳槽和准备跳槽.   中国IT行业的快速发展对IT从业人员的需求不断扩大,记得08年刚毕业的时候,在帝都找一个3k的工作都让我特别满足,现在仅能写出”hello world ...

  8. [Cycle.js] From toy DOM Driver to real DOM Driver

    This lessons shows how we are able to easily swap our toy DOM Driver with the actual Cycle.js DOM Dr ...

  9. 对于Android Service 生命周期进行全解析

    应用程序组件有一个生命周期——一开始Android实例化他们响应意图,直到结束实例被销毁.在这期间,他们有时候处于激活状态,有时候处于非激 活状态:对于活动,对用户有时候可见,有时候不可见.组件生命周 ...

  10. 前端--关于javascript对象

    在javascript中对象是一种基本的数据类型,在数据结构上是一种散列表,可以看作是属性的无序集合,除了原始值其他一切都是对象.它可以用来表示现实世界中或者我们大脑中抽象出来的客体,这和其他面向对象 ...