-- 批量创建诊所用户SQL脚本
USE callback_system;

-- 学前街门诊用户
INSERT INTO users (username, password_hash, user_type, clinic_access, created_at, is_active) 
VALUES 
('jinqin', SHA2('jinqin123', 256), 'user', '["clinic_xuexian"]', NOW(), 1),
('renshanshan', SHA2('renshanshan123', 256), 'user', '["clinic_xuexian"]', NOW(), 1),
('shaojun', SHA2('shaojun123', 256), 'user', '["clinic_xuexian"]', NOW(), 1)
ON DUPLICATE KEY UPDATE 
    password_hash = VALUES(password_hash),
    clinic_access = VALUES(clinic_access),
    updated_at = NOW();

-- 新吴门诊用户
INSERT INTO users (username, password_hash, user_type, clinic_access, created_at, is_active) 
VALUES 
('litingting', SHA2('litingting123', 256), 'user', '["clinic_xinwu"]', NOW(), 1)
ON DUPLICATE KEY UPDATE 
    password_hash = VALUES(password_hash),
    clinic_access = VALUES(clinic_access),
    updated_at = NOW();

-- 红豆门诊用户
INSERT INTO users (username, password_hash, user_type, clinic_access, created_at, is_active) 
VALUES 
('maqiuyi', SHA2('maqiuyi123', 256), 'user', '["clinic_hongdou"]', NOW(), 1),
('tangqimin', SHA2('tangqimin123', 256), 'user', '["clinic_hongdou"]', NOW(), 1)
ON DUPLICATE KEY UPDATE 
    password_hash = VALUES(password_hash),
    clinic_access = VALUES(clinic_access),
    updated_at = NOW();

-- 东亭门诊用户
INSERT INTO users (username, password_hash, user_type, clinic_access, created_at, is_active) 
VALUES 
('yueling', SHA2('yueling123', 256), 'user', '["clinic_dongting"]', NOW(), 1)
ON DUPLICATE KEY UPDATE 
    password_hash = VALUES(password_hash),
    clinic_access = VALUES(clinic_access),
    updated_at = NOW();

-- 马山门诊用户
INSERT INTO users (username, password_hash, user_type, clinic_access, created_at, is_active) 
VALUES 
('jijunlin', SHA2('jijunlin123', 256), 'user', '["clinic_mashan"]', NOW(), 1),
('zhouliping', SHA2('zhouliping123', 256), 'user', '["clinic_mashan"]', NOW(), 1)
ON DUPLICATE KEY UPDATE 
    password_hash = VALUES(password_hash),
    clinic_access = VALUES(clinic_access),
    updated_at = NOW();

-- 总院用户
INSERT INTO users (username, password_hash, user_type, clinic_access, created_at, is_active) 
VALUES 
('feimiaomiao', SHA2('feimiaomiao123', 256), 'user', '["clinic_hospital"]', NOW(), 1),
('chenxinyu', SHA2('chenxinyu123', 256), 'user', '["clinic_hospital"]', NOW(), 1)
ON DUPLICATE KEY UPDATE 
    password_hash = VALUES(password_hash),
    clinic_access = VALUES(clinic_access),
    updated_at = NOW();

-- 惠山门诊用户
INSERT INTO users (username, password_hash, user_type, clinic_access, created_at, is_active) 
VALUES 
('yanghong', SHA2('yanghong123', 256), 'user', '["clinic_huishan"]', NOW(), 1),
('panjinli', SHA2('panjinli123', 256), 'user', '["clinic_huishan"]', NOW(), 1)
ON DUPLICATE KEY UPDATE 
    password_hash = VALUES(password_hash),
    clinic_access = VALUES(clinic_access),
    updated_at = NOW();

-- 大丰门诊用户
INSERT INTO users (username, password_hash, user_type, clinic_access, created_at, is_active) 
VALUES 
('chenlin', SHA2('chenlin123', 256), 'user', '["clinic_dafeng"]', NOW(), 1)
ON DUPLICATE KEY UPDATE 
    password_hash = VALUES(password_hash),
    clinic_access = VALUES(clinic_access),
    updated_at = NOW();

-- 查看创建结果
SELECT 
    username,
    user_type,
    clinic_access,
    created_at,
    is_active
FROM users 
WHERE user_type = 'user'
ORDER BY created_at DESC; 