Skip to content

Instantly share code, notes, and snippets.

@diaolizhi
Created January 7, 2019 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diaolizhi/42a333f8de86661f898fe4017b26d822 to your computer and use it in GitHub Desktop.
Save diaolizhi/42a333f8de86661f898fe4017b26d822 to your computer and use it in GitHub Desktop.
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