Commit 2a980a75 by huangjing

hj

parent bf8d6a3b
...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment