MySQL实现
1 | insert into books (`bookName`,`bookCounts`,`detail`) |
错误
1 | <insert id="addBook" parameterType="Books"> |
日志:1
2==> Preparing: insert into books (bookName,bookCounts,detail) values (?,?,?) on duplicate key update bookCounts=bookCounts+values(?), detail=values(?) ;
==> Parameters: MySQL(String), 2(Integer), 2(String), 2(Integer), 2(String)
正确
1 | <insert id="addBook" parameterType="Books"> |
日志:1
2==> Preparing: insert into books (bookName,bookCounts,detail) values (?,?,?) on duplicate key update bookCounts=bookCounts+values(bookCounts), detail=values(detail) ;
==> Parameters: MySQL(String), 2(Integer), 2(String)