造数据存储过程
create function rand_num( )
returns int(5)
begin
declare i int default 0;
set i = floor(10+rand()*500);
return i;
end;
DROP PROCEDURE IF EXISTS `insert_his_2017_sys_order_pay_val`;
CREATE PROCEDURE `insert_his_2017_sys_order_pay_val`()
BEGIN
DECLARE num INTEGER ;
DECLARE order_id varchar(32);
#set autocommit = 0 //把autocommit设置成0,这样可以只提交一次,否则。。。。。
set num=1;
set order_id=20190501000000;
START TRANSACTION;
WHILE num <=1000000 DO
set order_id=order_id+1;
INSERT INTO `cpay`.`his_2017_sys_order_pay` (`order_id`, `channel_no_user`, `channel_no_pay`, `branch_code`, `branch_terminal_code`, `user_code`, `user_type`, `user_cost_code`, `fee_rate`, `fee_amt_customer`, `fee_amt_platform`, `order_amt`, `order_amt_rmb`, `order_amt_refunding`, `order_amt_refund`, `currency_code`, `order_exchange_rate`, `overdue_amt`, `date_unit`, `date_num`, `tran_status`, `pay_status`, `bit_pay_status`, `product_code`, `product_name`, `product_desc`, `message`, `order_fields_type`, `order_fields`, `create_time_sys`, `create_time_utc`, `create_time_channel`, `update_time_sys`, `update_time_utc`, `update_time_channel`, `remark`, `ext_fld1`, `channel_type_pay`, `terminal_self_code`)
VALUES (CONCAT(order_id,DATE_FORMAT(now(),'%Y%m%d'),rand_num( )), NULL, 'PC000131', '10036939704285', '1004o1v9792zakl9', '288345827929938436', NULL, 'userCostCode', '11.00', NULL, NULL, '1.00', NULL, NULL, NULL, 'JPY', NULL, NULL, NULL, NULL, '01', '11', NULL, NULL, NULL, NULL, NULL, '0', NULL, '20190219000000', '20190219000000', '20190219000000', '20190219000000', '20190219000000', '20190219000000', 'insertdata', NULL, '01', 'zyc_dls2_jmd1_dp1_zdtest');
#INSERT INTO `his_2017_sys_order_pay` (`order_no`, `user_no`, `trans_code`, `out_order_no`, `out_date_time`, `origional_order_no`, `mer_no`, `payer_name`, `payer_no`, `payer_acct_no`, `payer_acct_type`, `channel_flag`, `pay_serial_id`, `pay_amount`, `currency`, `busi_date`, `trans_fee`, `fee_currency`, `recv_name`, `recv_no`, `recv_branch_no`, `recv_account_no`, `recv_acct_type`, `recv_type`, `realtime_type`, `order_type`, `agent_order_type`, `detail_flag`, `in_account_date`, `order_desc`, `prod_code`, `prod_name`, `pay_type`, `assoc_no`, `in_out_flag`, `channel_name`, `order_status`, `create_time`, `update_time`, `end_time`, `sys_order_flag`, `receive_url`, `pickup_url`, `sms_confirm`, `order_valid_time`, `scan_flag`, `memo`, `extfld1`, `extfld2`, `extfld3`)
#VALUES (CONCAT(order_no,rand_num( )), NULL, trans_code, CONCAT(out_order_no,DATE_FORMAT(now(),'%Y%m%d'),rand_num( )), '20190106000000', NULL, '80000004', NULL, NULL, NULL, NULL, '3', 'f7eac91b03dc4fb08595db4bdb7d688a', '0.01', 'JPY', DATE_FORMAT(now(),'%Y%m%d'), '0.00', 'JPY', '批量插入', NULL, NULL, NULL,NULL, NULL, NULL, 'O', NULL, '3', NULL, '海外支付申请', NULL,'test', NULL, NULL, '0', 'ALIPAY_OVERSEAS', '3', '20190106000000', '20190106000000', NULL, NULL, NULL, NULL, NULL, '20190106000000', '0', 'guxw自动化用例', NULL, NULL, NULL);
set num =num+1;
end WHILE;
COMMIT ;
END;
call insert_his_2017_sys_order_pay_val();