Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
2a980a75
Commit
2a980a75
authored
Jan 07, 2020
by
huangjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hj
parent
bf8d6a3b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
calc_result/IndexGet.py
+6
-4
No files found.
calc_result/IndexGet.py
View file @
2a980a75
...
@@ -8,23 +8,25 @@ import pymysql
...
@@ -8,23 +8,25 @@ import pymysql
from
IndexItem
import
IndexItem
from
IndexItem
import
IndexItem
class
IndexGet
:
class
IndexGet
:
conn
=
pymysql
.
connect
(
host
=
'43.247.184.35'
,
port
=
8899
,
user
=
'write'
,
password
=
'write'
,
db
=
'fktaxctl'
,
charset
=
"utf8mb4"
)
conn
=
pymysql
.
connect
(
host
=
'43.247.184.35'
,
port
=
8899
,
user
=
'write'
,
password
=
'write'
,
db
=
'fktaxctl'
,
charset
=
"utf8mb4"
)
def
Subscribe
(
self
,
span
,
type
):
def
Subscribe
(
self
,
span
,
type
):
print
(
"查询条件"
,
span
,
type
)
cursor
=
self
.
conn
.
cursor
()
cursor
=
self
.
conn
.
cursor
()
list
=
[]
list
=
[]
sql
=
"SELECT * from gongshi WHERE span =
%
s and type =
%
s;"
sql
=
"SELECT * from gongshi WHERE span =
%
s and type =
%
s;"
try
:
try
:
# 执行SQL语句
# 执行SQL语句
cursor
.
execute
(
sql
,[
span
,
type
])
cursor
.
execute
(
sql
,[
span
,
type
])
print
(
"查询条件"
,
span
,
type
)
# 获取所有记录列表
# 获取所有记录列表
results
=
cursor
.
fetchall
()
results
=
cursor
.
fetchall
()
for
row
in
results
:
for
row
in
results
:
indexItem
=
IndexItem
()
indexItem
=
IndexItem
()
# indexItem.Id = row[0]
indexItem
.
Name
=
row
[
1
]
indexItem
.
Name
=
row
[
1
]
indexItem
.
IndexName
=
row
[
2
]
indexItem
.
IndexName
=
row
[
2
]
funs
=
str
(
row
[
3
])
.
replace
(
"
\n
"
,
""
)
.
replace
(
";"
,
";"
)
.
replace
(
")]"
,
"))"
)
.
replace
(
"AND"
,
"and"
)
.
replace
(
"OR"
,
"or"
)
.
replace
(
"[("
,
"(("
)
.
split
(
";"
)
funs
=
str
(
row
[
3
])
if
"max"
not
in
funs
and
"min"
not
in
funs
:
funs
=
str
(
row
[
3
])
.
replace
(
"
\n
"
,
""
)
.
replace
(
";"
,
";"
)
.
replace
(
")]"
,
"))"
)
.
replace
(
"AND"
,
"and"
)
.
replace
(
"OR"
,
"or"
)
.
replace
(
"[("
,
"(("
)
.
split
(
";"
)
else
:
funs
=
str
(
row
[
3
])
.
replace
(
"
\n
"
,
""
)
.
replace
(
";"
,
";"
)
.
replace
(
"AND"
,
"and"
)
.
replace
(
"OR"
,
"or"
)
.
split
(
";"
)
funsGrp
=
[]
funsGrp
=
[]
for
fun
in
funs
:
for
fun
in
funs
:
funsGrp
.
append
(
fun
)
funsGrp
.
append
(
fun
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment