1、使用mysql独有的on duplicate key
insert into userList (id,user_name,user_password,user_type) value (21,'1949测试','49旧数据','测试用户w1'),
(22,'1950测试','50旧数据','测试用户p2'),(null,'1951说是','51新数据','测试用户q3'),(null,'1952新数据paper','1952新数','测试用户d4') on duplicate key update
user_name=values(user_name),user_password=values(user_password),user_type=values(user_type)
2、这样会引起主键跳跃,在执行上面的语句后,执行一次alter 表名 userList AUTO_INCREMENT = 1