Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
mysql 插入数据时如果存在主键则跳过
@Insert("INSERT IGNORE INTO t_user " +
"(email, password, salt, is_active) " +
"VALUES (#{email}, #{password}, #{salt}, 1)")
int addUser(TUser user);
//重点是 IGNORE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.