mysql存储过程造数
DROP PROCEDURE IF EXISTS insertwristband_info
;
DELIMITER //
CREATE PROCEDURE insertwristband_info (IN scount int)
begin
declare Time1 int DEFAULT 0;
declare id1 int DEFAULT 99100000;
while Time1<scount do
set Time1=Time1+1;
set id1=id1+1;
INSERT INTO wristband_info select id1, NULL, UNIX_TIMESTAMP(NOW()), 10084, CONCAT('p', id1), 10091, 1000.00, '', CONCAT('13897',floor(rand()*600000+100000)), NULL, '11', NULL ;
if (Time1 mod 10000)=0 then
commit;
end if;
end while;
end;
//
DELIMITER ;
call insertwristband_info(1000000); --造100万
DROP PROCEDURE IF EXISTS insertexpenses_record
;
DELIMITER //
CREATE PROCEDURE insertexpenses_record (IN scount int)
begin
declare Time2 int DEFAULT 0;
declare id2 int DEFAULT 90000000;
while Time2<scount do
set Time2=Time2+1;
set id2=id2+1;
INSERT INTO expenses_record select id2, NULL, NULL, NULL, '充值', 1000.00, NULL, NULL, 1.00, 1000.00, 0.00, 100, 10121, 10006, NULL, null, '2222222222', NULL, 10013, NULL, 10021, NULL, date_format(now(), '%Y-%m-%d %T'), date_format(now(), '%Y-%m-%d %T'), '01', date_format(now(), '%Y-%m-%d %T'), date_format(now(), '%Y-%m-%d %T'), 'system', '超级管理员', '2222222222_充值', '11', '316', '01', concat(date_format(now(), '%Y%m%d%H%i%s'),FLOOR(rand()900+100)), NULL, 'system', '超级管理员', CONCAT('13897',floor(rand()600000+100000)), 'ptest', NULL;
if (Time2 mod 10000)=0 then
commit;
end if;
end while;
end;
//
DELIMITER ;
call insertexpenses_record(1000000);
DROP PROCEDURE IF EXISTS insertbilling_records
;
DELIMITER //
CREATE PROCEDURE insertbilling_records (IN scount int)
begin
declare Time3 int DEFAULT 0;
declare id3 int DEFAULT 90000000;
while Time3<scount do
set Time3=Time3+1;
set id3=id3+1;
INSERT INTO billing_records select id3, null, NULL, NULL, 0.00, 100, 1000.00, 10000.00, '会员卡', date_format(now(), '%Y-%m-%d %T'), 0;
if (Time3 mod 10000)=0 then
commit;
end if;
end while;
end;
//
DELIMITER ;
call insertbilling_records(1000000);
DROP PROCEDURE IF EXISTS insertpay_record
;
DELIMITER //
CREATE PROCEDURE insertpay_record (IN scount int)
begin
declare Time4 int DEFAULT 0;
declare id4 int DEFAULT 80000000;
while Time4<scount do
set Time4=Time4+1;
set id4=id4+1;
INSERT INTO pay_record select id4, id4, 10101, '0', 1000.00, NULL, date_format(now(), '%Y-%m-%d %T'), '01', 11;
if (Time4 mod 10000)=0 then
commit;
end if;
end while;
end;
//
DELIMITER ;