You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

106 lines
4.4 KiB

-- 企业端,密码:123456
-- 17608540150,weil45,"",15817307171,深圳农牧美益肉业有限公司,91440300662678582M,21
-- 17608557492,DGD440881199506180622,"",15817381630,深圳市深水龙岗污水处理有限公司,914403006820066603,12
-- 17608540121,smiledzb1982,"",13723454151,深圳康泰生物制品股份有限公司,91440300618837873J,10
-- 17608594890,A7271888,"",13751661770,深圳市里程食品有限公司,91440300738848091F,9
-- 17608565612,qintongzhen138,"",13823610579,欧姆龙电子部件(深圳)有限公司,914403007261811621,9
-- 17608601734,XP073215,"",15012671807,深圳市强达电路股份有限公司,91440300763461366N,9
-- 17608556724,33ef1970fd449676fa4bc197,"",13537602265,吉田拉链(深圳)有限公司公明工厂,91440300788302281W,8
update enterprise_user set password='df9f19db2f0503c4564d967956adc318',salt='413f53' where user_id='17608540150';
update enterprise_user set password='011c72e1631ae4d37463b6ec1f0d4825',salt='413f53' where user_id='17608557492';
update enterprise_user set password='4c5ddbdb1266ef79b9e552f603c5a368',salt='413f53' where user_id='17608540121';
update enterprise_user set password='18e70eb4a12f389c2969d09d16964ed2',salt='413f53' where user_id='17608594890';
update enterprise_user set password='f1035f44ee5654be31465a6be5cd4240',salt='413f53' where user_id='17608565612';
update enterprise_user set password='0071ba98dde715b02b82b22acfc7379c',salt='413f53' where user_id='17608601734';
update enterprise_user set password='efc923c94bbb4a3d617d6865d7b7e694',salt='413f53' where user_id='17608556724';
--测试表
create table test_enf_demo
(
id bigint not null comment '主键'
primary key,
enf_text varchar(255) null comment '文本',
enf_content longtext null comment '长文本',
tenant_id varchar(20) default '000000' null comment '租户编号',
dept_id bigint null comment '部门id',
user_id bigint null comment '用户id',
order_num int default 0 null comment '排序号',
test_key varchar(255) null comment 'key键',
value varchar(255) null comment '值',
version int default 0 null comment '版本',
create_dept varchar(100) null comment '创建部门',
create_time datetime null comment '创建时间',
create_by bigint null comment '创建人',
update_time datetime null comment '更新时间',
update_by bigint null comment '更新人',
del_flag int default 0 null comment '删除标志'
)
comment 'enf测试单表';
-- 为 test_enf_demo 表生成 10000 条测试数据
-- 使用存储过程批量插入
DROP PROCEDURE IF EXISTS generate_test_enf_demo_data;
DELIMITER $$
CREATE PROCEDURE generate_test_enf_demo_data()
BEGIN
DECLARE i INT DEFAULT 1;
DECLARE batch_size INT DEFAULT 500;
DECLARE current_batch INT DEFAULT 0;
-- 关闭自动提交,提升插入性能
SET autocommit = 0;
WHILE i <= 10000 DO
INSERT INTO test_enf_demo (
id, enf_text, enf_content, tenant_id, dept_id, user_id,
order_num, test_key, value, version,
create_dept, create_time, create_by, update_time, update_by, del_flag
) VALUES (
i,
CONCAT('文本_', i),
CONCAT('这是第', i, '条测试长文本内容,用于测试数据填充。'),
'000000',
100 + FLOOR(RAND() * 50),
1000 + FLOOR(RAND() * 500),
i,
CONCAT('KEY_', LPAD(i, 5, '0')),
CONCAT('VAL_', LPAD(i, 5, '0')),
0,
CONCAT('部门_', FLOOR(RAND() * 20)),
DATE_ADD('2024-01-01', INTERVAL FLOOR(RAND() * 730) DAY),
1,
NOW(),
1,
0
);
-- 每 500 条提交一次
SET current_batch = current_batch + 1;
IF current_batch >= batch_size THEN
COMMIT;
SET current_batch = 0;
END IF;
SET i = i + 1;
END WHILE;
-- 提交剩余数据
COMMIT;
SET autocommit = 1;
END$$
DELIMITER ;
-- 执行存储过程
CALL generate_test_enf_demo_data();
-- 清理存储过程
DROP PROCEDURE IF EXISTS generate_test_enf_demo_data;
-- 验证数据量
SELECT COUNT(*) AS total_count FROM test_enf_demo;