本文整理匯總了Python中Src.Function.Base.Base.query方法的典型用法代碼示例。如果您正苦於以下問題:Python Base.query方法的具體用法?Python Base.query怎麽用?Python Base.query使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Src.Function.Base.Base
的用法示例。
在下文中一共展示了Base.query方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: insert_ifNameFromTestResult
# 需要導入模塊: from Src.Function.Base import Base [as 別名]
# 或者: from Src.Function.Base.Base import query [as 別名]
def insert_ifNameFromTestResult(self):
"""
如果api_pass_rate表中沒有該條if_name則將if_name插入該表中
:param data:
:param table:
:return:
"""
sql = "INSERT INTO api_pass_rate_wph (if_name) SELECT DISTINCT `if_name` FROM test_result WHERE if_name NOT IN(SELECT if_name FROM api_pass_rate_wph);"
sql1 = "INSERT INTO api_pass_rate (if_name) SELECT DISTINCT `if_name` FROM test_result WHERE if_name NOT IN(SELECT if_name FROM api_pass_rate);"
return Base.query(self, sql), Base.query(self, sql1)
示例2: get_performanceOrderByIfname
# 需要導入模塊: from Src.Function.Base import Base [as 別名]
# 或者: from Src.Function.Base.Base import query [as 別名]
def get_performanceOrderByIfname(self, type, orderby='if_name', method='esc'):
"""
查詢表 最近300條最終按照if_name 排序輸出
:return:
"""
sql = "select * from (select * from api_performance order by id desc limit 300) a where type = '" + type + "' order by " + orderby + " " + method + ";"
test_result = Base.query(self, sql)
return test_result
示例3: update_fail_num
# 需要導入模塊: from Src.Function.Base import Base [as 別名]
# 或者: from Src.Function.Base.Base import query [as 別名]
def update_fail_num(self, if_name):
"""
更新Fail_num字段
:param if_name:
:return:
"""
type = Base.getApiType(self, if_name)
sql = "UPDATE api_pass_rate_wph SET url_target='" + url_target + "',`type`='" + type + "',fail_num=fail_num+1 WHERE if_name = '" + if_name + "';"
return Base.query(self, sql)
示例4: update_pass_num
# 需要導入模塊: from Src.Function.Base import Base [as 別名]
# 或者: from Src.Function.Base.Base import query [as 別名]
def update_pass_num(self, if_name):
type = Base.getApiType(self, if_name)
sql = "UPDATE api_pass_rate_wph SET url_target='" + url_target + "',`type`='" + type + "',pass_num=pass_num+1 WHERE if_name = '" + if_name + "';"
return Base.query(self, sql)