本文整理汇总了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)