|
@@ -46,13 +46,18 @@ class DBDownload:
|
|
if self.mode==1:
|
|
if self.mode==1:
|
|
self.cursor.execute("select %s from %s where sn='%s' order by id desc limit 1" %(str,tablename,sn))
|
|
self.cursor.execute("select %s from %s where sn='%s' order by id desc limit 1" %(str,tablename,sn))
|
|
elif self.mode==0:
|
|
elif self.mode==0:
|
|
- self.cursor.execute("select %s from %s where sn='%s' and %s between '%s' and '%s'" %(str,tablename,sn,timename,st,sp))
|
|
|
|
|
|
+ if len(sn)>1:
|
|
|
|
+ self.cursor.execute("select %s from %s where sn='%s' and %s between '%s' and '%s'" %(str,tablename,sn,timename,st,sp))
|
|
|
|
+ else:
|
|
|
|
+ self.cursor.execute("select %s from %s where %s between '%s' and '%s'" %(str,tablename,timename,st,sp))
|
|
elif self.mode==2:
|
|
elif self.mode==2:
|
|
self.cursor.execute("select %s from %s where factory='%s'" %(str,tablename,factory))
|
|
self.cursor.execute("select %s from %s where factory='%s'" %(str,tablename,factory))
|
|
elif self.mode==3:
|
|
elif self.mode==3:
|
|
self.cursor.execute("select %s from %s" %(str,tablename))
|
|
self.cursor.execute("select %s from %s" %(str,tablename))
|
|
elif self.mode==4:
|
|
elif self.mode==4:
|
|
self.cursor.execute("select %s from %s where qrcode='%s' order by id desc limit 1" %(str,tablename,sn))
|
|
self.cursor.execute("select %s from %s where qrcode='%s' order by id desc limit 1" %(str,tablename,sn))
|
|
|
|
+ elif self.mode==5:
|
|
|
|
+ self.cursor.execute("select %s from %s where info='%s'" %(str,tablename,timename))
|
|
res = self.cursor.fetchall()
|
|
res = self.cursor.fetchall()
|
|
df_res = pd.DataFrame(res, columns=param)
|
|
df_res = pd.DataFrame(res, columns=param)
|
|
df_res = df_res.reset_index(drop=True)
|
|
df_res = df_res.reset_index(drop=True)
|