##大盘表
dapan_sql='''
select id,sku_no,price,cid1,cid2,cid3,brand_name,brand_id from
    offline_recommend.recommend_same_product 
'''

##根据cid3获取cid2，cid1等数据
cid1_3_sql="""
select distinct c_id1,c_id2,c_id3 from kdsp.t_sku_info
"""

##商品表
skuinfo_sql='''
select id,sku_no,sku_name,price,cid1,cid2,cid3,brand_name,brand_id,source_type from
    offline_recommend.recommend_product_info
'''
##相似表
similar_redis='product_similarity:{skuno}'

##商品关联度
correlation_redis='product_correlation:${skuNo}'

##上一批次
nearly_batch_sql="""
select a.*,b.sku_no,b.recall_reason from 
(select id,recall_batch_uuid,event_type from nearline_recommend_test.recommend_product_batch where user_uuid='{}' order by id desc limit 1)a
join nearline_recommend_test.recommend_product_record b on a.recall_batch_uuid=b.recall_batch_uuid
"""

cur_batch_sql="""
select id,recall_batch_uuid,event_type from nearline_recommend.recommend_product_batch 
"""



#b.jg_id,b.category_id,b.category_level,b.final_score,a.rank,a.click_num
hot_jd150_sql="""
select distinct {}  from offline_recommend.jg_heat_rank 
join offline_recommend.jg_intention_score  on jg_heat_rank.jg_id=jg_intention_score.jg_id
order by jg_heat_rank.rank desc
"""

##推荐位用户意图得分表
jd_hot_sql="""
select jg_id,category_id,category_level,brand_name,final_score from offline_recommend.jg_intention_score 
"""

##金刚位大盘表-金刚位热度表
jg_dapan_sql="""
select * from offline_recommend.jg_heat_rank  order by rank desc limit 30
"""

##推荐位用户意图得分表
jg_purpost_sql="""

"""


jg_purpost_all_sql="""
select * from   where cid3={} or cid2={} or cid1={} or brand_name='{}'
"""

#图关联表
graph_redis="""
product_graph:{sku_no}
"""
graph_relation_sql="""
select * from xyqb_recommender_system.mix_products_graph 
"""
##ALS相关表
als_redis="""
product_correlation:{sku_no}
"""
als_sql="""
select * from xyqb_recommender_system.mix_products_correlation 
"""

dapan_hot_sql="""
select * from 
xyqb_recommender_system.kdsp_same_ranked_list
"""
##获取上一批次记录后，再去mysql批次表里拿数据
back_batch_redis="""
recommend_recall:{uuid}:{sku_no}
"""

##支付图关联表,有序列表
pay_product_redis="""pay_product_graph:{sku_no}"""
##下单图关联表,有序列表
order_product_redis="""
order_product_graph:{sku_no}
"""
##加购图关联表,字符串
product_redis="""
product_graph:{sku_no}
"""
##ALS关联度表，有序列表
als_correlation_redis="""
product_correlation:{sku_no}
"""

###more-热度表（大盘热度表）
cate_brand_heat_rank_sql="""
select * from 
offline_recommend.cate_brand_heat_rank 
"""

###more-用户意图得分表
cate_brand_intention_score_sql="""
select * from 
offline_recommend.cate_brand_intention_score 
"""
