-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sql
152 lines (143 loc) · 6.43 KB
/
test.sql
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
call register("1111111111", "1234567t5", "fp1", "lp1", "Male", "yes", "2000-01-01", "people", "", "", @RP1, @RjobP1);
select @RP1;
select @RjobP1;
call register("1010101010", "12345675", "fp2", "lp2", "Female", "no", "2000-03-01", "nurse", "22222222", "nurse", @RP2, @RjobP2);
select @RP2;
select @RjobP2;
call register("3333333333", "1234567t5", "fp3", "lp3", "Female", "yes", "2000-06-01", "nurse", "33333333", "matron", @RP3, @RjobP3);
select @RP3;
select @RjobP3;
call register("4444444444", "1234567t5", "fp4", "lp4", "Male", "yes", "1990-05-01", "doctor", "44444", "", @RP4, @RjobP4);
select @RP4;
select @RjobP4;
call register("1111111111", "1234567t5", "wrong ID", "wrong ID", "Female", "yes", "2003-01-01", "people", "", "", @RwrongID, @RjobwrongID);
select @RwrongID;
select @RjobwrongID;
call register("111111111", "1234567t5", "wrongID", "wrongID", "Female", "yes", "2003-01-01", "people", "", "", @RwrongID1, @RjobwrongID1);
select @RwrongID1;
select @RjobwrongID1;
call register("1111p01111", "1234567t5", "wrongID", "wrongID", "Female", "yes", "2003-01-01", "people", "", "", @RwrongID2, @RjobwrongID2);
select @RwrongID2;
select @RjobwrongID2;
call register("0000000000", "12345675", "wrongPass", "wrongPass", "Male", "yes", "2000-01-01", "people", "", "", @RwrongPass, @RjobwrongPass);
select @RwrongPass;
select @RjobwrongPass;
call register("5555555555", "1234567t5", "wrongDocID", "wrongDocID", "Male", "no", "1990-05-01", "doctor", "123", "", @RwrongDocID, @RjobwrongDocID);
select @RwrongDocID;
select @RjobwrongDocID;
call register("6666666666", "1234567t5", "wrongNurse", "wrongNurse", "Female", "no", "2000-03-01", "nurse", "66666666", "doctor", @RwrongNurse, @RjobwrongNurse);
select @RwrongNurse;
select @RjobwrongNurse;
select * from `DB`.System_info;
select * from `DB`.person_info;
select * from `DB`.doctor;
select * from `DB`.nurse;
call login("1111111111", "1234567t6", @tokenWrongPass, @RWrongPass);
select @tokenWrongPass;
select @RWrongPass;
call login("4444444444", "1234567t5", @tokenDoctor, @RDoctor);
select @tokenDoctor;
select @RDoctor;
call deleteAccount(@tokenDoctor, "4444444444", @ResDA);
select @ResDA;
select * from `DB`.login;
call addBrand(@tokenDoctor, "brand1", 2, 3, @ResBrand1);
select @ResBrand1;
call addBrand(@tokenDoctor, "brand1", 3, 3, @RbrandWrong);
select @RbrandWrong;
call addBrand(@tokenDoctor, "brand2", 2, 3, @ResBrand2);
select @ResBrand2;
call addBrand(@tokenDoctor, "brand4", 2, 3, @ResBrand3);
select @ResBrand3;
select * from `DB`.brand;
call addHealthCenter(@tokenDoctor, "HC1", "Add1", @ResHC1);
select @ResHC1;
call addHealthCenter(@tokenDoctor, "HC2", "Add2", @ResHC2);
select @ResHC2;
call addHealthCenter(@tokenDoctor, "HC3", "Add3", @ResHC3);
select @ResHC3;
call addHealthCenter(@tokenDoctor, "HC4", "Add4", @ResHC4);
select @ResHC4;
call addHealthCenter(@tokenDoctor, "HC5", "Add5", @ResHC5);
select @ResHC5;
call addHealthCenter(@tokenDoctor, "HC6", "Add6", @ResHC6);
select @ResHC6;
select * from `DB`.health_center;
call login("2222222222", "1234567t5", @tokenNurse, @RNurse);
select @tokenNurse;
select @RNurse;
select * from `DB`.login;
call vialCreation(@tokenNurse, "1", 2, "2021-05-01", "brand1", @RInvalidNurse);
select @RInvalidNurse;
call login("3333333333", "1234567t5", @tokenMatron, @RMatron);
select @tokenMatron;
select @RMatron;
select * from `DB`.login;
call vialCreation(@tokenMatron, "1", 2, "2021-05-01", "brand1", @RVial1Brand1);
select @RVial1Brand1;
call vialCreation(@tokenMatron, "12", 2, "2021-05-06", "brand1", @RVial2Brand1);
select @RVial2Brand1;
call vialCreation(@tokenMatron, "13", 3, "2021-06-01", "brand1", @RVial3Brand1);
select @RVial3Brand1;
call vialCreation(@tokenMatron, "2", 2, "2021-05-06", "brand2", @RVial1Brand2);
select @RVial1Brand2;
call vialCreation(@tokenMatron, "3", 2, "2021-05-01", "brand3", @RVial1Brand3);
select @RVial1Brand3;
call vialCreation(@tokenMatron, "32", 2, "2021-05-06", "brand3", @RVial2Brand3);
select @RVial2Brand3;
call vialCreation(@tokenMatron, "33", 3, "2021-06-01", "brand3", @RVial3Brand3);
call vialCreation(@tokenMatron, "34", 2, "2021-06-01", "brand3", @RVial4Brand3);
select @RVial4Brand3;
select * from `DB`.vial;
call injection(@tokenMatron, "1111111111", "HC2", "1", @ResInjection);
call injection(@tokenMatron, "2222222222", "HC2", "2", @ResInjection);
call injection(@tokenMatron, "3333333333", "HC3", "3", @ResInjection);
call injection(@tokenMatron, "4444444444", "HC4", "12", @ResInjection);
call injection(@tokenMatron, "5555555555", "HC5", "2", @ResInjection);
call injection(@tokenMatron, "6666666666", "HC6", "3", @ResInjection);
select * from `DB`.history;
call injection(@tokenMatron, "1111111111", "HC1", "4", @ResInvalidSerial);
select @ResInvalidSerial;
call injection(@tokenMatron, "1111111111", "HC9", "4", @ResInvalidHC);
select @ResInvalidHC;
call injection(@tokenMatron, "12", "HC1", "4", @ResInvalidID);
select @ResInvalidID;
call injection(@tokenMatron, "1111111111", "HC1", "33", @ResInvalidBrand);
select @ResInvalidBrand;
call injection(@tokenMatron, "1111111111", "HC2", "1", @Res);
-- call injection(@tokenMatron, "1111111111", "HC4", "12", @ResFuuly);
-- select @ResFuuly;
call injection(@tokenMatron, "2222222222", "HC4", "2", @RInvalidVial);
select @RInvalidVial;
select * from `DB`.history;
call viewInfo(@tokenMatron);
call changePass(@tokenMatron, "123456789t", @RessPass);
select @RessPass;
DELETE FROM `DB`.login WHERE `DB`.login .ID = "2222222222";
call login("3333333333", "123456789t", @tokenMatron, @RMatron);
select @tokenMatron;
select @RMatron;
call scoring(@tokenMatron, 3, "HC2", @ResNotHere);
select @ResNotHere;
call scoring(@tokenMatron, 10, "HC3", @ResInvalidScore);
select @ResInvalidScore;
call scoring(@tokenMatron, 5, "HC3", @ResScore2);
select @ResScore2;
call login("2222222222", "1234567t5", @tokenLogP2, @RLogP2);
call scoriing(@tokenLogP2, 3, "HC2", @ResScore);
select @ResScore;
call login("4444444444", "1234567t5", @tokenLogP2, @RLogP2);
call scoriing(@tokenLogP2, 2, "HC4", @ResScore);
select @ResScore;
select * from `DB`.history;
set @a = 1;
select @a;
call showScores(@a, @a);
call vaccinationNum();
call showVaccinateds();
call showTop3OfEachBrand();
call showSecondDoseCenter(@tokenLogP2);
select * from `DB`.System_info;
select * from `DB`.history;
-- DELETE FROM `DB`.health_center WHERE `DB`.health_center .name = "HC6";
DELETE FROM `DB`.login WHERE `DB`.login.ID = "3333333333";