-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTimeFlow_testData.sql
More file actions
224 lines (213 loc) · 4.7 KB
/
TimeFlow_testData.sql
File metadata and controls
224 lines (213 loc) · 4.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
-- 建立用户表
create table user(
name varchar(10) not null unique comment '用户名',
uid int unsigned primary key auto_increment comment '用户ID',
password varchar(10) default '1234' not null comment '用户密码'
) comment '用户表';
-- 添加用户
insert into
user (name, uid, password)
values
('张一', 1, 1),
('张二', 2, 2),
('张三', 3, 3),
('张四', 4, 4),
('张五', 5, 5),
('张六', 6, 6);
-- 用户注册时建表
create table 1_time_event (
id int unsigned primary key auto_increment comment '事项ID',
name varchar(10) not null comment '事项名',
startTime datetime not null comment '开始时间',
overTime datetime not null comment '结束时间',
setInViewPage tinyint not null comment '是否纳入日视图统计(无痕事件)',
text varchar(400) comment '文本内容(事项注释)',
isCompleted tinyint not null comment '事件是否完成'
) comment '时段事项表';
create table 1_moment_event (
id int unsigned primary key auto_increment comment '事项ID',
name varchar(10) not null comment '事项名',
deadline datetime not null comment '截截止时间',
setInViewPage tinyint not null comment '是否纳入日视图统计(无痕事件)',
text varchar(400) comment '文本内容(事项注释)',
isCompleted tinyint not null comment '事件是否完成'
) comment '时刻事项表';
create table 1_label_event (
id int unsigned primary key auto_increment comment '事项ID',
name varchar(10) not null comment '事项名',
attachdate date not null comment '附着时间',
setInViewPage tinyint not null comment '是否纳入日视图统计(无痕事件)',
text varchar(400) comment '文本内容(事项注释)',
isCompleted tinyint not null comment '事件是否完成'
) comment '标签事项表';
create table 1_te_classification(
id int unsigned primary key auto_increment comment '分类ID',
name varchar(10) not null unique comment '分类名',
text varchar(400) comment '分类注释'
) comment '分类表';
create table 1_te_class_category(
id int unsigned primary key auto_increment comment '关联表下的ID',
id_event int unsigned not null comment '事件的ID',
id_class int unsigned not null comment '类别的ID'
) comment '关联表';
-- 添加用户1的时段事项TE
INSERT INTO
1_time_event (
id,
name,
startTime,
overTime,
setInViewPage,
text,
isCompleted
)
VALUES
(
1,
'TE_1',
'2023-10-21 08:00:00',
'2023-10-21 08:30:00',
1,
null,
0
),
(
2,
'TE_2',
'2023-10-21 09:30:00',
'2023-10-21 11:30:00',
1,
null,
0
),
(
3,
'TE_3',
'2023-10-21 14:30:00',
'2023-10-21 16:00:00',
1,
null,
0
),
(
4,
'TE_4',
'2023-10-22 09:30:00',
'2023-10-22 12:00:00',
1,
null,
0
),
(
5,
'TE_5',
'2023-10-23 10:30:00',
'2023-10-23 14:30:00',
1,
null,
0
);
-- 添加用户1的时刻事项ME
INSERT INTO
1_moment_event (
id,
name,
deadline,
setInViewPage,
text,
isCompleted
)
VALUES
(
1,
'ME_1',
'2023-10-21 08:30:00',
1,
null,
0
),
(
2,
'ME_2',
'2023-10-22 11:30:00',
1,
null,
0
),
(
3,
'ME_3',
'2023-10-22 16:30:00',
1,
null,
0
),
(
4,
'ME_4',
'2023-10-23 10:30:00',
1,
null,
0
),
(
5,
'ME_5',
'2023-10-22 21:30:00',
1,
null,
0
);
-- 添加用户1的标签事项LE
INSERT INTO
1_label_event (
id,
name,
attachdate,
setInViewPage,
text,
isCompleted
)
VALUES
(
1,
'LE_1',
'2023-10-21',
1,
null,
0
),
(
2,
'LE_2',
'2023-10-22',
1,
null,
0
),
(
3,
'LE_3',
'2023-10-23',
1,
null,
0
);
-- 添加用户1的类别事项CL
insert into
1_te_classification (id, name, text)
values
(1, 'CL_A', null),
(2, 'CL_B', null),
(3, 'CL_C', null),
(4, 'CL_D', null);
-- 为用户1的事项分类
insert into
1_te_class_category(id, id_event, id_class)
values
(1, 1, 1),
(2, 1, 2),
(3, 1, 3),
(4, 2, 1),
(5, 2, 2),
(6, 3, 1);