本文整理汇总了Python中custom.db.mysql.Custom_MySQL.query_by_sql方法的典型用法代码示例。如果您正苦于以下问题:Python Custom_MySQL.query_by_sql方法的具体用法?Python Custom_MySQL.query_by_sql怎么用?Python Custom_MySQL.query_by_sql使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类custom.db.mysql.Custom_MySQL
的用法示例。
在下文中一共展示了Custom_MySQL.query_by_sql方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: in
# 需要导入模块: from custom.db.mysql import Custom_MySQL [as 别名]
# 或者: from custom.db.mysql.Custom_MySQL import query_by_sql [as 别名]
"where s.type='dm' and s.id in ({0}) and d.id={1}) a where if(a.log_namee=f.log_name," \
"FROM_UNIXTIME(UNIX_TIMESTAMP(date_add(f.log_date,INTERVAL 1 DAY)), '%Y%m%d')=a.log_date," \
"f.log_date=a.log_date) and f.game=a.gamee and f.platform=a.platformm and f.log_name=a.table_namee " \
"and f.status!=3".format(from_id, pid)
else:
sql = "select distinct a.* from dw2dm_log f,(select s.game gamee,s.platform platformm," \
"s.table_name table_namee,d.log_name log_namee,s.flag flagg, d.* from structure s,dw2dm_log d " \
"where s.type='dm' and s.id in ({0}) and d.id={1}) a where if(a.log_namee=f.log_name," \
"FROM_UNIXTIME(UNIX_TIMESTAMP(date_add(f.log_date,INTERVAL 1 DAY)), '%Y%m%d')=a.log_date," \
"f.log_date=a.log_date) and f.game=a.gamee and f.platform=a.platformm and f.log_name=a.table_namee " \
"and f.status!=3".format(from_id, pid)
else:
sql = ""
#result = mysql.query(sql)
result = mysql.query_by_sql(sql)
# 如果为空,则全部完成
if result['output'] is None or result['output'] == '':
# 查找该条任务
formal_sql = "select d.*,s.db_name,s.table_name from dw2dm_log d, structure s " \
"where d.id = %s and d.target_id = s.id" % pid
formal_result = ""
if grouped == 1 and priority == 1:
formal_result = mysql.get(formal_sql)
elif grouped == 1 and priority != 1:
# 查找组别为1且优先级小于该条任务优先级的其他dw2dm任务是否完成
gpsql = "select d.* from dw2dm_log d,(select priority from dw2dm_log where id = %s) a " \
"where d.log_date = '%s' and d.game = '%s' and d.platform = '%s' and d.grouped = 1 " \