_sql3="select sum(delay_amount)/sum(order_amount) yuqilv from lie_basic_detail where erp_company_code='%s' "//基础数据
_sql4="select * from lie_model_items where project_id=%s "//查询统计项目梯度详情
_sql5="select count(1) yuqibi from lie_basic_detail where delay_day>0 and erp_company_code='%s'"//发生逾期总笔数
_sql6="select count(1) allbi from lie_basic_detail where return_amount>0 and erp_company_code='%s'"//收款总笔数
_sql8="select sum(delay_day) sum_delay_day from lie_basic_detail where delay_day>0 and erp_company_code='%s'"//每笔逾期账款的逾期时间合计
_sql9="select sum(TIMESTAMPDIFF(DAY,FROM_UNIXTIME(business_time,'%Y-%m-%d'),FROM_UNIXTIME(return_time,'%Y-%m-%d'))) sum_zhang from lie_basic_detail where erp_company_code="//每笔付款账期合计 应收日期在1/1-1/31的支付天数合计
_sql10="select sum(return_amount) sum_rongcha_huan from lie_basic_detail where delay_day<0 and erp_company_code='%s'"//容差范围内的收款(还款)金额 应收日期在1/1-1/31且逾期支付天数<容差值(目前为0)的下单金额合计
_sql11="select count(1) sum_rongcha_bi from lie_basic_detail where delay_day<0 and erp_company_code='%s'"//完成容差范围内收款的笔数 应收日期在1/1-1/31且0<逾期支付天数<容差值(目前为0)的下单订单数
_sql12="select sum(order_amount) sum_jiaohuo from lie_basic_detail where erp_company_code='%s'"//交货总金额 退货总金额+出库总金额
_sql13="select abs(sum(return_amount)) sum_tuihuo from lie_basic_detail where return_amount<0 and erp_company_code='%s'"//退货总金额 下单时间在1/1-1/30且下单金额为负数的金额合计
_sql14="select sum(order_amount) sum_chuhuo from lie_basic_detail where order_amount>0 and erp_company_code='%s'"//出货总金额 下单时间在1/1-1/30的下单总金额合计
_sql15="select sum(return_amount) sum_shou from lie_basic_detail where return_amount>0 and erp_company_code='%s'"//收款总额 应收日期在1/1-1/31的回款金额 下单时间在1/1-1/30的下单总金额合计
_sql16="select sum(final_score) sum_dong_score from lie_scores where type=2 and com_credits_id=%d";//总计动态信用分
_sql3="select sum(delay_amount)/sum(order_amount) yuqilv from lie_basic_detail where erp_company_code='%s' "//基础数据
_sql4="select * from lie_model_items where project_id=%s "//查询统计项目梯度详情
_sql5="select count(1) yuqibi from lie_basic_detail where delay_day>0 and erp_company_code='%s'"//发生逾期总笔数
_sql6="select count(1) allbi from lie_basic_detail where return_amount>0 and erp_company_code='%s'"//收款总笔数
_sql8="select sum(delay_day) sum_delay_day from lie_basic_detail where delay_day>0 and erp_company_code='%s'"//每笔逾期账款的逾期时间合计
_sql9="select sum(TIMESTAMPDIFF(DAY,FROM_UNIXTIME(business_time,'%Y-%m-%d'),FROM_UNIXTIME(return_time,'%Y-%m-%d'))) sum_zhang from lie_basic_detail where erp_company_code="//每笔付款账期合计应收日期在1/1-1/31的支付天数合计
_sql10="select sum(return_amount) sum_rongcha_huan from lie_basic_detail where delay_day<0 and erp_company_code='%s'"//容差范围内的收款(还款)金额应收日期在1/1-1/31且逾期支付天数<容差值(目前为0)的下单金额合计
_sql11="select count(1) sum_rongcha_bi from lie_basic_detail where delay_day<0 and erp_company_code='%s'"//完成容差范围内收款的笔数应收日期在1/1-1/31且0<逾期支付天数<容差值(目前为0)的下单订单数
_sql12="select sum(order_amount) sum_jiaohuo from lie_basic_detail where erp_company_code='%s'"//交货总金额退货总金额+出库总金额
_sql13="select abs(sum(return_amount)) sum_tuihuo from lie_basic_detail where return_amount<0 and erp_company_code='%s'"//退货总金额下单时间在1/1-1/30且下单金额为负数的金额合计
_sql14="select sum(order_amount) sum_chuhuo from lie_basic_detail where order_amount>0 and erp_company_code='%s'"//出货总金额下单时间在1/1-1/30的下单总金额合计
_sql15="select sum(return_amount) sum_shou from lie_basic_detail where return_amount>0 and erp_company_code='%s'"//收款总额应收日期在1/1-1/31的回款金额下单时间在1/1-1/30的下单总金额合计
_sql16="select sum(final_score) sum_dong_score from lie_scores where type=2 and com_credits_id=%d";//总计动态信用分
//ss := fmt.Sprintf("select id from lie_scores where `type` = %d and project_pid = %d and project_id = %d and com_credits_id = %d limit 0,1", score.Type,score.ProjectPid,score.ProjectId,score.ComCreditsId)
//print(ss)
err=d.db.QueryRow(ctx,"select id from lie_scores where `type` = ? and project_pid = ? and project_id = ? and com_credits_id = ? and month= ? limit 0,1",score.Type,score.ProjectPid,score.ProjectId,score.ComCreditsId,month_six_zi).Scan(&exitId)
iferr!=nil{
//fmt.Print(err)
//sql := fmt.Sprintf("select id from lie_scores where `type` = %d and project_pid = %d and project_id = %d and com_credits_id = %d and month= %d limit 0,1", score.Type,score.ProjectPid,score.ProjectId,score.ComCreditsId,month_six_zi);