#!/bin/bash
ip=$1
card_no=$2

#"请输入要删除的银行卡号或者该银行卡绑卡的手机号:" card_no 

mysql -h"$ip" -p"3306" -u"qa" -p"qatest" <<EOF
delete from payment_center.bank_card where card_no=$card_no;
delete from payment_center.bank_card_detail where card_no=$card_no;
delete from payment_center.card_bind_info where card_no=$card_no;
delete from payment_center.bank_card where user_id=(select id from payment_center.user where phone_no =$card_no);
delete from payment_center.bind_card_order where user_id=(select id from payment_center.user where phone_no =$card_no);
delete from payment_center.card_bind_info where user_id=(select id from payment_center.user where phone_no =$card_no);

EOF
echo "done!!!"
