fund_order_id=`mysql -N$mysqld xyqb -e"select id from baitiao_fund_order where order_id='$order_id'"`
fund_order_id=`mysql -N$mysqld xyqb -e"select id from baitiao_fund_order where order_id='$order_id'"`
term_no=`mysql -N$mysqld xyqb -e"select count(*) from baitiao_bill_repayment_plan where order_id='$order_id'"`
term_no=`mysql -N$mysqld xyqb -e"select count(*) from baitiao_bill_repayment_plan where order_id='$order_id'"`
baitiao_fund_repayment_plan=`mysql -N$mysqld xyqb -e"select id from baitiao_fund_repayment_plan where plan_id='$plan_id'"`
if[[-n"baitiao_fund_repayment_plan"]];then
echo"finish~"
exit
else
insert_sql0="insert into baitiao_fund_repayment_plan("plan_id","fund_order_id","term_no","principal","interest","discount","finance_record_id","status") values ($plan_id,'$fund_order_id',1,'0','0','0',NULL,'0')"
insert_sql0="insert into baitiao_fund_repayment_plan("plan_id","fund_order_id","term_no","principal","interest","discount","finance_record_id","status") values ($plan_id,'$fund_order_id',1,'0','0','0',NULL,'0')"