当前使用版本(必填,否则不予处理)

<dependency>
    <groupId>com.baomidou</groupId>
    <artifactId>mybatis-plus-boot-starter</artifactId>
    <version>3.5.3.1</version>
</dependency>

该问题是如何引起的?(确定最新版也有问题再提!!!)

@TableName("article")
public class Article {
    // 省略其他字段

    @TableLogic
    private Integer deleted;
    // 省略get&set
}

重现步骤(如果有就写完整)

Article article = lambdaQuery().eq(Article::getId, id).one();

报错信息

  1. 仅使用@TableLogic注解的情况下
BadSqlGrammarException:
### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: FUNCTION honyee.0AND does not exist
### The error may exist in com/honyee/app/mapper/ArticleMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT id, title, cover, content, deleted, create_by, create_date, update_by, update_date FROM article WHERE deleted = 0AND(id = ?)
### Cause: java.sql.SQLSyntaxErrorException: FUNCTION honyee.0AND does not exist
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: FUNCTION honyee.0AND does not exist

  1. 注解@TableLogic(value ="0")配置了value 的情况下,甚至是value="0 " (0后有空格)
### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: Unknown column 'deleted' in 'field list'
### The error may exist in com/honyee/app/mapper/ArticleMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT id, title, cover, content, deleted, create_by, create_date, update_by, update_date FROM article WHERE deleted = 0AND(id = ?)
### Cause: java.sql.SQLSyntaxErrorException: Unknown column 'deleted' in 'field list'
; bad SQL grammar []
  1. 注解@TableLogic(value ="0 ")配置了value 的情况下(0后有空格)
### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: Unknown column 'deleted' in 'field list'
### The error may exist in com/honyee/app/mapper/ArticleMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT id, title, cover, content, deleted, create_by, create_date, update_by, update_date FROM article WHERE deleted = 0 AND(id = ?)
### Cause: java.sql.SQLSyntaxErrorException: Unknown column 'deleted' in 'field list'
; bad SQL grammar []