springboot整合mybatis,报 for the right syntax to use near '' at line 5 at sun.reflect.NativeConstructo

先给你们看一下原本的sql

springboot整合mybatis,报 for the right syntax to use near '' at line 5 at sun.reflect.NativeConstructo

如果你已经看出问题来了,那么本文你可以不用往下看了!

如果没有,那我们来尝试解决

首先直接换成'${username}'

springboot整合mybatis,报 for the right syntax to use near '' at line 5 at sun.reflect.NativeConstructo

这样子一下就能看出问题来了吧

没错就是这个多余的逗号,删除逗号完美解决!

有任何问题欢迎评论交流!