Created
January 7, 2019 12:30
-
-
Save diaolizhi/42a333f8de86661f898fe4017b26d822 to your computer and use it in GitHub Desktop.
mysql 插入数据时如果存在主键则跳过
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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