-
Notifications
You must be signed in to change notification settings - Fork 0
/
opt_class.py
157 lines (108 loc) · 4.71 KB
/
opt_class.py
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
#coding=utf-8
from class_file import BaseClass,Dir
class Parameter(object):
def __init__(self,name,val):
self.name = name
self.val = val
class OptBaseClass(object):
def __init__(self):
self.param_1 = Parameter('param_1',None)
self.param_2 = Parameter('param_2',None)
self.value = None
self.description = None
#self.__dict__.update([self.param_1,self.param_2])
class Project(BaseClass,OptBaseClass): #Project(C,T) Project(c,T) Project(G,T) Project(F,T)
def __init__(self,t_name, c_name, c_type):
BaseClass.__init__(self,t_name,c_name,c_type)
OptBaseClass.__init__(self)
self.param_list = [self.param_1,self.param_2]
#Proself.__dict__.update(self.param_list)
class Modify(BaseClass,OptBaseClass):
def __init__(self,t_name, c_name, c_type):
BaseClass.__init__(self,t_name,c_name,c_type)
OptBaseClass.__init__(self)
self.param_list = [self.param_1,self.param_2]
class CClass(BaseClass,OptBaseClass):
def __init__(self,t_name,c_name,c_type):
BaseClass.__init__(self,t_name,c_name,c_type)
OptBaseClass.__init__(self)
self.param_list = [self.param_1,self.param_2]
def __str__(self):
return "C"
class In(BaseClass,OptBaseClass):
# In(c,N) c.c_type = N.c_type
# In(F,N) F.c_type = N.c_type
#In(c,V) c.c_name = V.c_name
def __init__(self,t_name, c_name, c_type):
BaseClass.__init__(self,t_name, c_name, c_type)
OptBaseClass.__init__(self)
self.param_list = [self.param_1,self.param_2]
class Combine(BaseClass,OptBaseClass):
def __init__(self,t_name, c_name, c_type):
BaseClass.__init__(self,t_name, c_name, c_type)
OptBaseClass.__init__(self)
self.param_list = [self.param_1,self.param_2]
class Select(BaseClass,OptBaseClass): #Select(Filter, T)
def __init__(self,t_name, c_name, c_type):
BaseClass.__init__(self,t_name, c_name, c_type)
OptBaseClass.__init__(self)
self.param_list = [self.param_1,self.param_2]
class Group(BaseClass,OptBaseClass): #Group(F,C|c) Group(F,EachV) Group(G1, C|c)
def __init__(self,t_name,c_name,c_type):
BaseClass.__init__(self, t_name, c_name, c_type)
OptBaseClass.__init__(self)
self.param_list = [self.param_1,self.param_2]
class CombineF(BaseClass,OptBaseClass):
def __init__(self,t_name,c_name,c_type):
BaseClass.__init__(self, t_name, c_name, c_type)
OptBaseClass.__init__(self)
self.param_list = [self.param_1, self.param_2]
class AggrateClass(BaseClass):
def __init__(self, t_name, c_name, c_type):
super(AggrateClass,self).__init__(t_name,c_name,c_type)
self.param = Parameter('param',None)
self.value = None
self.param_list = [self.param]
self.description = None
class Min(AggrateClass):
def __init__(self, t_name, c_name, c_type):
super(Min,self).__init__(t_name,c_name,c_type)
class Max(AggrateClass):
def __init__(self, t_name, c_name, c_type):
super(Max,self).__init__(t_name,c_name,c_type)
class Avg(AggrateClass):
def __init__(self, t_name, c_name, c_type):
super(Avg,self).__init__(t_name,c_name,c_type)
class Sum(AggrateClass):
def __init__(self, t_name, c_name, c_type):
super(Sum,self).__init__(t_name,c_name,c_type)
class Count(AggrateClass): #一种参数是一个c类, 一种是一个'*'
def __init__(self, t_name, c_name, c_type):
super(Count,self).__init__(t_name,c_name,c_type)
self.distinct = False
class Order(BaseClass,OptBaseClass):
def __init__(self,t_name,c_name,c_type):
BaseClass.__init__(self, t_name, c_name, c_type)
OptBaseClass.__init__(self)
self.dir = Dir(None,None,None)
self.param_list = [self.param_1, self.param_2, self.dir]
class Join(BaseClass,OptBaseClass):
def __init__(self, t_name, c_name, c_type):
BaseClass.__init__(self,t_name,c_name,c_type)
OptBaseClass.__init__(self)
self.param_list = [self.param_1, self.param_2]
class And(BaseClass,OptBaseClass):
def __init__(self, t_name, c_name, c_type):
BaseClass.__init__(self, t_name, c_name, c_type)
OptBaseClass.__init__(self)
self.param_list = [self.param_1, self.param_2]
class Or(BaseClass,OptBaseClass):
def __init__(self,t_name, c_name, c_type):
BaseClass.__init__(self, t_name, c_name, c_type)
OptBaseClass.__init__(self)
self.param_list = [self.param_1, self.param_2]
class Not(BaseClass,OptBaseClass):
def __init__(self,t_name, c_name, c_type):
BaseClass.__init__(self,t_name,c_name,c_type)
OptBaseClass.__init__(self)
self.param_list = [self.param_1,self.param_2]