更新时间: 2025-01-02 05:00:39#mybatis-plus. SQLSyntaxErrorException: Unknown column '' in 'field list'用的mybatis-plus 记得原先 mybatis 无用的字段,写在实体类上也不要紧。这里mybatis-plus 一直报错, 除非字段上增加 @TableField(exist = false) // 该字段不会映射到数据库 List<MiInstruments> getxx = instrumentsMapper.getxx(); // select * from table .自动映射,没有的不映射,默认为NULL // 这种 queryWrapper 的形式,会拼装sql 变成 select a,b,c,d... from table 而不是select * from table MiInstruments miInstruments1 = instrumentsMapper.selectOne(new QueryWrapper<>()); MiInstruments one = iMiInstrumentsService.getOne(new QueryWrapper<>()); 改动的话,改变所有的query 直接变成select * .不拼接字段, 自己的指定的字段,报Unknown column理所应当。 #update处理,updateByEntity ??? 拼装sql , allFieldList 包含了 Unknown column ,怎么避免?