本文整理匯總了Python中Src.Function.Base.Base類的典型用法代碼示例。如果您正苦於以下問題:Python Base類的具體用法?Python Base怎麽用?Python Base使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Base類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: update_fail_num
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)
示例2: insert_ifNameFromTestResult
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)
示例3: insert_testResult
def insert_testResult(self, data):
"""
插入一條
:param data: 數據集合 {字段:字段值,}
:return: int
"""
return Base.insert(self, data, self.table)
示例4: delete_ShortUrl
def delete_ShortUrl(self, where):
"""
刪除表數據
:param where: 條件
:return: 影響行數
"""
return Base.delete(self, self.table, where)
示例5: insert_many_apiPassRateWph
def insert_many_apiPassRateWph(self, data):
"""
插入多條
:param data:數據列表 [{field:value...}...]
:return:
"""
return Base.insert_many(self, data, self.table)
示例6: insert_ShortUrl
def insert_ShortUrl(self, data):
"""
插入一條
:param data: 數據集合 {字段:字段值,}
:return: int
"""
return Base.insert(self, data, self.table)
示例7: delete_apiPassRateWph
def delete_apiPassRateWph(self, where):
"""
刪除表數據
:param where: 條件
:return: 影響行數
"""
return Base.delete(self, self.table, where)
示例8: insert_apiPassRateWph
def insert_apiPassRateWph(self, data):
"""
插入一條
:param data: 數據集合 {字段:字段值,}
:return: int
"""
return Base.insert(self, data, self.table)
示例9: insert_many_ShortUrl
def insert_many_ShortUrl(self, data):
"""
插入多條
:param data:數據列表 [{field:value...}...]
:return:
"""
return Base.insert_many(self, data, self.table)
示例10: delete_apiPerformance
def delete_apiPerformance(self, where):
"""
刪除表數據
:param where: 條件
:return: 影響行數
"""
return Base.delete(self, self.table, where)
示例11: insert_apiPerformance
def insert_apiPerformance(self, data):
"""
插入一條
:param data: 數據集合 {字段:字段值,}
:return: int
"""
return Base.insert(self, data, self.table)
示例12: get_performanceOrderByIfname
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
示例13: update_ShortUrl
def update_ShortUrl(self, data, where):
"""
更新表
:param data: 數據集合 {field:value...}
:param where: "if_name ='a01'"
:return: 影響行數
"""
return Base.update(self, data, self.table, where)
示例14: get_testResultOrderByIfName
def get_testResultOrderByIfName(self):
"""
查詢y接口狀態
:param if_name:'a01'
:return:[{}]
"""
kwargs = dict(table=self.table, order='if_name')
return Base.select(self, **kwargs)
示例15: get_testResultByIfName
def get_testResultByIfName(self, if_name):
"""
查詢y接口狀態
:param if_name:'a01'
:return:{}
"""
where = "if_name='%s'" % if_name
kwargs = dict(table=self.table, where=where)
return Base.select(self, **kwargs)