mybatis中Parameter index out of range (1 > number of parameters, which is 0).

在mybatis里面写就是应该是 like  ‘%${name} %’ 而不是 ‘%#{name} %’  

${name} 是不带单引号的,而#{name} 是带单引号的

所以,当你用到 like ‘%#{name}%’ 会报这种错误

点赞

Leave a Reply

Your email address will not be published. Required fields are marked *