org.springframework.jdbc.BadSqlGrammarException:
Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4. MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id = null' at line 1
syntax to use near 'WHERE id = null' at line 1
这就是参数问题,你看下控制台的参数情况就知道了,有值传过去了,你后台不一定接收正常。
WHERE id = null,id的值为空。
id is null
- 可以看下mapper中的sql
- 看下*Mapper.java 接口中参数怎么传递的
以上两个地方,你可以截个图片吗?
注:如果是单个参数,你可以用 @Param 注解试试