@@ -18,6 +18,59 @@ class Body:
18
18
_rings : dict
19
19
_properties : dict
20
20
21
+ BODY_SELECT_BY_KEY = '''
22
+ select key, system_key, name, type,
23
+ sub_type, discovery, update_time, materials,
24
+ solid_composition, atmosphere_composition, parents, belts,
25
+ rings, properties
26
+ from body
27
+ where key = %(key)s
28
+ '''
29
+
30
+ BODY_SELECT_BY_SYSTEM_KEY = '''
31
+ select key, system_key, name, type,
32
+ sub_type, discovery, update_time, materials,
33
+ solid_composition, atmosphere_composition, parents, belts,
34
+ rings, properties
35
+ from body
36
+ where system_key = %(system_key)s
37
+ '''
38
+
39
+ BODY_INSERT = '''
40
+ insert into body
41
+ (key, system_key, name, type,
42
+ sub_type, discovery, update_time, materials,
43
+ solid_composition, atmosphere_composition, parents,
44
+ belts, rings, properties)
45
+ values
46
+ (%(key)s, %(system_key)s, %(name)s, %(type)s,
47
+ %(sub_type)s, %(discovery)s, %(update_time)s, %(materials)s,
48
+ %(solid_composition)s, %(atmosphere_composition)s, %(parents)s,
49
+ %(belts)s, %(rings)s, %(properties)s)
50
+ '''
51
+
52
+ BODY_UPDATE_BY_KEY = '''
53
+ update body
54
+ set system_key = %(system_key)s,
55
+ name = %(name)s,
56
+ type = %(type)s,
57
+ sub_type = %(sub_type)s,
58
+ discovery = %(discovery)s,
59
+ update_time = %(update_time)s,
60
+ materials = %(materials)s,
61
+ solid_composition = %(solid_composition)s,
62
+ atmosphere_composition = %(atmosphere_composition)s,
63
+ parents = %(parents)s,
64
+ belts = %(belts)s,
65
+ rings = %(rings)s,
66
+ properties = %(properties)s
67
+ where key = %(key)s
68
+ '''
69
+
70
+ BODY_DELETE_BY_KEY = '''
71
+ delete from body where key = %(key)s
72
+ '''
73
+
21
74
@property
22
75
def key (self ) -> dict :
23
76
return self ._key
0 commit comments