Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
kaopu-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9c009727
authored
Dec 31, 2019
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
判断sql插入限制
parent
85b95985
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
internal/dao/bank_dong.go
internal/dao/com_credits.go
internal/dao/common.go
internal/dao/bank_dong.go
View file @
9c009727
...
...
@@ -59,7 +59,7 @@ func (d *dao) BankDongMain(ctx context.Context,project_id int,erp_company_code s
if
project_id
!=
999
&&
project_id
!=
0
{
//项目配置
sql_str1
:=
fmt
.
Sprintf
(
_sql1
,
strconv
.
Itoa
(
project_id
))
modelItem
,
_
=
d
.
QueryOne
(
ctx
,
1
,
sql_str1
)
modelItem
,
_
=
d
.
QueryOne
(
ctx
,
3
,
sql_str1
)
if
modelItem
==
nil
{
logic
.
LogWrite
(
"不存在该项目配置lie_model.project_id:"
+
strconv
.
Itoa
(
project_id
),
log_pre
,
1
)
return
...
...
@@ -68,7 +68,7 @@ func (d *dao) BankDongMain(ctx context.Context,project_id int,erp_company_code s
//查询逾期率项目详情
sql_str4
:=
fmt
.
Sprintf
(
_sql3
,
strconv
.
Itoa
(
project_id
))
modelItems
,
_
=
d
.
QueryMany
(
ctx
,
1
,
sql_str4
)
modelItems
,
_
=
d
.
QueryMany
(
ctx
,
3
,
sql_str4
)
if
modelItems
==
nil
{
logic
.
LogWrite
(
"不存在该项目配置详情lie_model_items,project_id:"
+
strconv
.
Itoa
(
project_id
),
log_pre
,
1
)
return
...
...
@@ -82,7 +82,7 @@ func (d *dao) BankDongMain(ctx context.Context,project_id int,erp_company_code s
_sql2
=
fmt
.
Sprintf
(
_sql2_2
,
erp_company_code
)
//查询一个公司
}
company_info
,
err
:=
d
.
QueryMany
(
ctx
,
1
,
_sql2
);
company_info
,
err
:=
d
.
QueryMany
(
ctx
,
3
,
_sql2
);
if
err
!=
nil
{
logic
.
LogWrite
(
"错误"
+
err
.
Error
(),
log_pre
,
1
)
...
...
@@ -166,7 +166,7 @@ func (d *dao) BankDongRate(ctx context.Context,y map[string]string,modelItems []
s1
,
s2
string
//拼接六个月月份字符串
)
sqla
:=
fmt
.
Sprintf
(
bank_sql4
,
y
[
"erp_company_code"
],
month_six
)
c1
,
_
:=
d
.
QueryOne
(
ctx
,
1
,
sqla
)
c1
,
_
:=
d
.
QueryOne
(
ctx
,
3
,
sqla
)
switch
project_id
{
case
35
:
////1 计算逾期金额率:逾期金额/收款总额:
...
...
internal/dao/com_credits.go
View file @
9c009727
...
...
@@ -15,7 +15,7 @@ func (d *dao) GetCompanyCresitsList(ctx context.Context) (res []map[string]strin
var
(
rows
*
sql
.
Rows
)
if
rows
,
err
=
d
.
db
.
Query
(
ctx
,
"SELECT "
+
SqlField
+
" FROM lie_com_credits where
id > 5147
"
);
err
!=
nil
{
if
rows
,
err
=
d
.
db
.
Query
(
ctx
,
"SELECT "
+
SqlField
+
" FROM lie_com_credits where
status = 5 or status = 10
"
);
err
!=
nil
{
err
=
errors
.
WithStack
(
err
)
return
}
...
...
internal/dao/common.go
View file @
9c009727
...
...
@@ -59,6 +59,11 @@ func (d *dao) QueryOne(ctx context.Context,db int,sql_str string)(res map[string
err
=
errors
.
WithStack
(
err
)
return
}
}
else
if
db
==
3
{
if
rows
,
err
=
d
.
db_bank
.
Query
(
ctx
,
sql_str
);
err
!=
nil
{
err
=
errors
.
WithStack
(
err
)
return
}
}
else
{
if
rows
,
err
=
d
.
db2
.
Query
(
ctx
,
sql_str
);
err
!=
nil
{
err
=
errors
.
WithStack
(
err
)
...
...
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