def GetEnvInfo(self): SQL = r'select distinct Env from dfr_productline' result = [] if g_DB.Execute(SQL): res = g_DB.fetchAll() if res: for data in res: for key in data: result.append(data[key]) g_Log.LogInfo('获取环境信息成功') else: g_Log.LogError('获取环境信息失败') g_Log.LogDebug('SQL语句:' + SQL) return result
def GetProductFamilyInfo(self, ProductType): SQL = r'select productFamily from dfr_productline where Class="' + ProductType + '"' result = [] if g_DB.Execute(SQL): res = g_DB.fetchAll() if res: for data in res: for key in data: result.append(data[key]) g_Log.LogInfo('从数据库获取产品族信息成功') else: g_Log.LogError('从数据库获取产品族信息失败') g_Log.LogDebug('SQL语句:' + SQL) return result