Commit 9c009727 by Joneq

判断sql插入限制

parent 85b95985
......@@ -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 计算逾期金额率:逾期金额/收款总额:
......
......@@ -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
}
......
......@@ -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)
......
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 sign in to comment