Failed to process, please exclude the tableName or statementId

场景

  • spring boot 使用的是 mybatisplus
    在这里插入图片描述

遇坑

  • 执行报错:Failed to process, please exclude the tableName or statementId
    在这里插入图片描述

检查

  • 客户端检查正常
  • 推测受到 mybatisplus 拦截
    在这里插入图片描述

原因

Failed to process, please exclude the tableName or statementId
翻译过来就是:处理失败,请将表名或者语句id进行排除。
实则为集成 mybatis-plus多租户插件出的问题

填坑

  • 全局操作,不推荐
    在mybatis-plus的配置文件中去掉解析链
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MybatisPlusConfigure {
    /**
     * 分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        //List<ISqlParser> sqlParserList = new ArrayList<>();
        // 攻击 SQL 阻断解析器、加入解析链
        //sqlParserList.add(new BlockAttackSqlParser());
        //paginationInterceptor.setSqlParserList(sqlParserList);
        return paginationInterceptor;
    }
}
  • 独立忽略
    在这里插入图片描述
Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐