mybatis-plus reports database syntax error

Generally speaking, mp directly encapsulates the sql statement, and we only need to call the corresponding api without writing the sql statement when using it. Therefore, generally speaking, there will be no syntax errors in SQL.

But there are some special cases, such as the sql field uses the sql keyword.

As shown below

 show is a keyword of mysql

When calling the relevant mp statement to operate the database, as follows

A mysql syntax error will be reported

 It is relatively rare to use mp to report mysql syntax errors. If you have not encountered a keyword bug, you will be very confused.

Solution:

Change show to is_show

 run

result

Guess you like

Origin blog.csdn.net/Leungiyee/article/details/128835256