石油焦百川查询sql调整
This commit is contained in:
parent
8573211441
commit
deab1ec0bb
@ -304,7 +304,7 @@ table_name = 'v_tbl_crude_oil_warning'
|
||||
baichuan_table_name = 'V_TBL_BAICHUAN_YINGFU_VALUE'
|
||||
# select BAICHUAN_ID, DATA_DATE, DATA_VALUE from V_TBL_BAICHUAN_YINGFU_VALUE where BAICHUAN_ID in ('1588348470396475286', '1666')
|
||||
# 开关
|
||||
is_train = False # 是否训练
|
||||
is_train = True # 是否训练
|
||||
is_debug = False # 是否调试
|
||||
is_eta = True # 是否使用eta接口
|
||||
is_market = False # 是否通过市场信息平台获取特征 ,在is_eta 为true 的情况下生效
|
||||
|
@ -2224,13 +2224,14 @@ def addtimecharacteristics(df, dataset):
|
||||
def get_baichuan_data(baichuanidnamedict):
|
||||
baichuanidlist = [str(k) for k in baichuanidnamedict.keys()]
|
||||
baichuanidlist= [f"'{id}'" for id in baichuanidlist]
|
||||
startdate = str(config.start_year)+'0101'
|
||||
# 连接数据库
|
||||
db = config.db_mysql
|
||||
if db is None:
|
||||
db.connect()
|
||||
# 执行SQL查询 select BAICHUAN_ID,DATA_DATE,DATA_VALUE from V_TBL_BAICHUAN_YINGFU_VALUE where BAICHUAN_ID in ('1588348470396475286','1666');
|
||||
sql = f"SELECT BAICHUAN_ID,DATA_DATE,DATA_VALUE FROM {global_config['baichuan_table_name']} WHERE BAICHUAN_ID in ({','.join(baichuanidlist)})"
|
||||
|
||||
sql = f"SELECT BAICHUAN_ID,DATA_DATE,DATA_VALUE FROM {global_config['baichuan_table_name']} WHERE DATA_DATE >= {startdate} AND BAICHUAN_ID in ({','.join(baichuanidlist)})"
|
||||
print(sql)
|
||||
# 获取查询结果
|
||||
results = db.execute_query(sql)
|
||||
df = pd.DataFrame(results, columns=[
|
||||
|
Loading…
Reference in New Issue
Block a user