Commit c706c685 authored by wukong's avatar wukong

现金贷十月份赔付表 按日展开完整代码

parent fe1f44b3
......@@ -15,7 +15,7 @@ end_time = "2017-11-01"
path = u"/vpants/peifu_loan_id_bo_11/"
engine_con = create_engine(
'mysql+mysqldb://internal_r:ArbNgtvlJzZHXsEu@172.16.3.201:3306/new_transaction?charset=utf8',
'mysql+mysqldb://internal_r:ArbNgtvlJzZHXsEu@172.16.3.201:3306/all_back_0930?charset=utf8',
echo=True)
# 应还资金方本息 部分
......@@ -27,7 +27,7 @@ SELECT deadline ,repaid_at ,principle,interest,funding_code,loan_id,term_no,ref_
# 部分应还资金方取客户的应还
sql_query_user_fund = """
SELECT deadline,xyqb_repaid_at repaid_at,principle,interest,fund_code funding_code,real_loan_id loan_id,term_no,ref_id FROM new_transaction.user_repayment_plan
WHERE fund_code IN (270, 310, 320, 210, 365, 350,290, 330, 340, 390,410,420)
WHERE fund_code IN (210, 365, 350, 290, 330, 340,390,410,1,2,3,4,5,70,135,141,420,480,465,365,270,310,320,410)
"""
# 客户等级
......@@ -64,7 +64,7 @@ JOIN new_transaction.`user_repayment_plan` t3 ON t1.plan_id = t3.id
sql_query_repay_online = """
SELECT
DATE(t3.deadline) deadline,
DATE(t3.bill_time) repaid_at,
DATE(t2.bill_time) repaid_at,
(t1.principle-t1.mitigate_principle) principle,
(t1.interest-t1.mitigate_interest) interest,
t3.fund_code funding_code,
......@@ -74,8 +74,9 @@ SELECT
FROM
new_transaction.`xjd_repay_plan_repay_record_ref` t1
JOIN new_transaction.`user_repayment_plan` t3 ON t1.plan_id = t3.id AND t1.repay_channel IN (1,2,4,6,8,9,10,11,12,20,21,25)
AND t3.bill_time >= '%s'
AND t3.bill_time < '%s'
join new_transaction.repay_record_online t2 on t1.record_id = t2.id and t1.repay_channel = t2.pay_approach
AND t2.bill_time >= '%s'
AND t2.bill_time < '%s'
"""
# 查询银行还款
......@@ -118,6 +119,7 @@ AND repay_date < '%s'
"""
sql_arrays = {"sql_query_fund": sql_query_user_fund
, "sql_query_user_fund": sql_query_user_fund
, "sql_query_loan_manifest": sql_query_loan_manifest
......@@ -128,6 +130,12 @@ sql_arrays = {"sql_query_fund": sql_query_user_fund
}
sql_arrays = {
"sql_query_user_fund": sql_query_user_fund
}
for key in sql_arrays.iterkeys():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment