Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
duizhang_tools
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data—王林芳
duizhang_tools
Commits
c706c685
Commit
c706c685
authored
Nov 09, 2017
by
wukong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
现金贷十月份赔付表 按日展开完整代码
parent
fe1f44b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
导出所需数据文件.py
每日赔付/十月份每日赔付/导出所需数据文件.py
+13
-5
No files found.
每日赔付/十月份每日赔付/导出所需数据文件.py
View file @
c706c685
...
...
@@ -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 (2
70, 310, 320, 210, 365, 350,290, 330, 340, 390,410,42
0)
WHERE fund_code IN (2
10, 365, 350, 290, 330, 340,390,410,1,2,3,4,5,70,135,141,420,480,465,365,270,310,320,41
0)
"""
# 客户等级
...
...
@@ -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(t
3
.bill_time) repaid_at,
DATE(t
2
.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
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment