目前

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun  3 18:20:08 2019

@author: lg
"""

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 30 09:44:52 2019

@author: lg
"""

from src.utils.db_processor import postgre_processor,mysql_processor
from collections import Counter
import pandas  as pd
from collections import Counter
import numpy as np


#select * from dw.dw_platform_quotation_recycler_quote_record    where product_combine_sku_name like '苹果 iPhone X%' limit 1000 

#buying   price 


sql="""
SELECT 
aa.platform_reference_price,
aa.recycler_start_price,
aa.recycler_reference_price,
aa.quotation_amount_num,
aa.is_confirm_flag_id,
aa.product_combine_sku_id,
aa.product_combine_level_id,
aa.quotation_document_no,

bb.is_quote_flag_id,
bb.inventory_amount_num,
bb.start_amount_num,
bb.recycler_quote_amount_num,
bb.last_start_amount_num,
bb.last_settle_amount_num,
bb.number_shots_thirty

--aa.*,
--bb.*
FROM dw.dw_platform_quotation_recycler_quote_record aa 
INNER JOIN dw.dw_platform_document_product bb
on  aa.product_combine_sku_id =bb.product_combine_sku_id and aa.product_combine_level_id=bb.product_combine_level_id and aa.quotation_document_no=bb.quotation_document_no


where bb.quotation_document_begin_date >  '2019-05-01' and aa.quote_date>'2019-05-01'
limit 10000
"""


data = postgre_processor.load_sql(sql)


#data2=pd.read_excel('data2.xlsx')

#ll=list(data2.columns)

ll=['platform_reference_price',
 'recycler_start_price',
 'recycler_reference_price',
 'quotation_amount_num',
 'product_combine_sku_id',
 'product_combine_level_id',
 'is_quote_flag_id',
 'start_amount_num',
 'number_shots_thirty']

data3=data[ll]
posted @ 2022-08-19 22:53  luoganttcc  阅读(9)  评论(0)    收藏  举报