添加数据库常用视图
parent
7f6a01cb01
commit
9ad082697a
24
常用信息.md
24
常用信息.md
|
@ -121,9 +121,7 @@ mysqldump -uroot -p'passowrd' --single-transaction -R -E --databases ecology_dev
|
||||||
**mysql常用视图**
|
**mysql常用视图**
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
#
|
-- 流程类型视图,可用于数据集成或流览按钮
|
||||||
流程类型视图
|
|
||||||
,可用于数据集成或流览按钮
|
|
||||||
create
|
create
|
||||||
or replace view workflow_type_info_view as
|
or replace view workflow_type_info_view as
|
||||||
select wb.id,
|
select wb.id,
|
||||||
|
@ -134,10 +132,7 @@ select wb.id,
|
||||||
from workflow_base wb
|
from workflow_base wb
|
||||||
RIGHT JOIN workflow_type wt on wb.workflowtype = wt.id;
|
RIGHT JOIN workflow_type wt on wb.workflowtype = wt.id;
|
||||||
|
|
||||||
#
|
-- 流程表单视图,用于流览按钮或数据集成,配置流程类型表可以用字段联动获取流程表表名
|
||||||
流程表单视图
|
|
||||||
,用于流览按钮或数据集成
|
|
||||||
,配置流程类型表可以用字段联动获取流程表表名
|
|
||||||
create
|
create
|
||||||
or replace view workflow_table_view as
|
or replace view workflow_table_view as
|
||||||
select base.id,
|
select base.id,
|
||||||
|
@ -148,10 +143,7 @@ select base.id,
|
||||||
from workflow_bill bill
|
from workflow_bill bill
|
||||||
join workflow_base base on base.formid = bill.id;
|
join workflow_base base on base.formid = bill.id;
|
||||||
|
|
||||||
#
|
-- 流程明细表信息,可用流程主表查询对应的明细表信息,用于流览框
|
||||||
流程明细表信息
|
|
||||||
,可用流程主表查询对应的明细表信息
|
|
||||||
,用于流览框
|
|
||||||
create
|
create
|
||||||
or replace view workflow_detail_table_view as
|
or replace view workflow_detail_table_view as
|
||||||
select CONCAT(bill.id, '-', base.id) id,
|
select CONCAT(bill.id, '-', base.id) id,
|
||||||
|
@ -163,9 +155,7 @@ select CONCAT(bill.id, '-', base.id) id,
|
||||||
from workflow_billdetailtable bill
|
from workflow_billdetailtable bill
|
||||||
join workflow_base base on base.formid = bill.billid;
|
join workflow_base base on base.formid = bill.billid;
|
||||||
|
|
||||||
#
|
-- 流程和建模字段视图,更具流程和建模的billid可以查询流程和建模中的字段信息
|
||||||
流程和建模字段视图
|
|
||||||
,更具流程和建模的billid可以查询流程和建模中的字段信息
|
|
||||||
create
|
create
|
||||||
or replace view workflow_field_table_view as
|
or replace view workflow_field_table_view as
|
||||||
select wb.id,
|
select wb.id,
|
||||||
|
@ -196,8 +186,7 @@ select wb.id,
|
||||||
from workflow_billfield wb
|
from workflow_billfield wb
|
||||||
left join htmllabelindex ht on wb.fieldlabel = ht.id;
|
left join htmllabelindex ht on wb.fieldlabel = ht.id;
|
||||||
|
|
||||||
#
|
-- 建模表信息视图
|
||||||
建模表信息视图
|
|
||||||
create
|
create
|
||||||
or replace view mode_bill_info_view as
|
or replace view mode_bill_info_view as
|
||||||
select bill.id, bill.tablename, hti.indexdesc
|
select bill.id, bill.tablename, hti.indexdesc
|
||||||
|
@ -206,8 +195,7 @@ from workflow_bill bill
|
||||||
where bill.id < 0
|
where bill.id < 0
|
||||||
and bill.tablename like 'uf%';
|
and bill.tablename like 'uf%';
|
||||||
|
|
||||||
#
|
-- 流程节点信息视图
|
||||||
流程节点信息视图
|
|
||||||
create
|
create
|
||||||
or replace view workflow_node_info_view as
|
or replace view workflow_node_info_view as
|
||||||
select distinct nb.id,
|
select distinct nb.id,
|
||||||
|
|
Loading…
Reference in New Issue