今天遇到这个问题 记录一下 在数据库里创建了这个 'model' 字段 , 用QueryWrapper 进行初始化查询, 然后报了这个错 , 然后我去数据库里用系统执行的SQl 语句 查询 ; 结果发现还是报这个错 1054 - Unknown column 'model' in 'field list' ,
之后用通过 "*" 去查询却是能直接查到数据的 ; 这个字段"model"也是有的 , 不太懂这个是啥子情况, 但定位到了 问题 , 就开始修改字段. 然后就没有问题了.
我创建的别的表里有 'model' 字段 却没有出现这个问题
但是这个终究还是个疑问, 看了 别的博客的说明, 发现没有我想要的答案.
期望有大佬们看见后麻烦教一下小弟, 也期望未来的我能直接给自己解答~
报的错
2021-06-10 09:52:09.327 [http-nio-8083-exec-2] ERROR o.jeecg.common.exception.JeecgBootExceptionHandler:57 -
### Error querying database. Cause: java.sql.SQLSyntaxErrorException: Unknown column 'model' in 'field list'
### The error may exist in org/jeecg/modules/scw/scwEquipment/mapper/EquipmentMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT id,create_by,create_time,update_by,update_time,ip_address,housen_no,house_name,date_time,temp_data,max_num,min_num,aver_num,outhumi_data,inhumi_data,outtemp_data,intemp_data,status,model FROM scw_equipment WHERE (housen_no = ?) ORDER BY date_time DESC
### Cause: java.sql.SQLSyntaxErrorException: Unknown column 'model' in 'field list'
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Unknown column 'model' in 'field list'
org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: java.sql.SQLSyntaxErrorException: Unknown column 'model' in 'field list'
### The error may exist in org/jeecg/modules/scw/scwEquipment/mapper/EquipmentMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT id,create_by,create_time,update_by,update_time,ip_address,housen_no,house_name,date_time,temp_data,max_num,min_num,aver_num,outhumi_data,inhumi_data,outtemp_data,intemp_data,status,model FROM scw_equipment WHERE (housen_no = ?) ORDER BY date_time DESC
### Cause: java.sql.SQLSyntaxErrorException:
Unknown column 'model' in 'field list'; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Unknown column 'model' in 'field list'
............(中间无用信息省略)
Caused by: java.sql.SQLSyntaxErrorException: Unknown column 'model' in 'field list'
............(中间无用信息省略)
然后我去数据库里用系统执行的SQl 语句 查询
结果还是报这个错 1054 - Unknown column 'model' in 'field list'
之后用通过 "*" 去查询却是能直接查到数据的. 这个字段"model"也是有的 ,
我创建的别的表里有 'model' 字段, 却能直接查出来