⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 init.sql

📁 基于jbpm开发的实例
💻 SQL
字号:
create database flowdemo;

use flowdemo;

--############################
--设定一个用户上下级关系表
--userId  praentId hasChild

create table Relations
(
	relationId int auto_increment primary key,
	userId varchar(20) not null,
	parentId varchar(20) null,
	hasChild int not null
)

--############################
--一个用户表
--userId userName userPass

create table Users
(
	userId varchar(20) not null primary key,
	userName varchar(20) not null,
	userPass varchar(20) not null
)

--############################
--一个报销单表
--expenseId processInstanceId money reason userId

create table Expenses
(
	expenseId int auto_increment primary key,
	processInstanceId varchar(20) ,
	money varchar(20) not null,
	reason varchar(30) not null ,
	userId varchar(20) not null,
	foreign key(userId) references Users(userId)
)

--初始化脚本
--用户初始化
insert into users(userId,userName,userPass) values('001','employee','employee');

insert into users(userId,userName,userPass) values('002','manager','manager');

insert into users(userId,userName,userPass) values('003','boss','boss');


--关系表初始化
--hasChild字段:1代表有下属,0代表没有
insert into relations(userId,parentId,hasChild) values('001','002',0);

insert into relations(userId,parentId,hasChild) values('002','003',1);

insert into relations(userId,parentId,hasChild) values('003','',1);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -