1、问题
关联问题(不过关联问题是containerId字段在xml中写错了,应该写container_id)
### Error querying database. Cause: java.sql.SQLSyntaxErrorException: Unknown column 'containerId' in 'where clause'
### The error may exist in file [F:\ProDocument\xxx\xxx\xxx\target\classes\mapper\xxx\xxxMapper.xml]
### The error may involve com.ruoyi.xxx.mapper.xxxMapper.selectxxxLocatorList-Inline
### The error occurred while setting parameters
### SQL: select id, locator_code, locator_name, container_code, locator_seat, locator_sort, locator_status, create_by, create_time, update_by, update_time, del_flag, remark, equipment_number, tenant_id, use_weight, warehouse_location_id, container_id, equipment_id from smsc_locator WHERE containerId in ( ? )
### Cause: java.sql.SQLSyntaxErrorException: Unknown column 'containerId' in 'where clause' ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Unknown column 'containerId' in 'where clause'
相关类似问题
Annotation-specified bean name.. for bean class ...
clean项目 如果不行就重启(我是重启解决的)
2、场景
若依框架 + Maven项目,xml语句写错了,发现报错去修改,然后重启项目依然报错,于是我就留意一下 target 文件夹
3、原因
target的*.xml文件没有更新
项目编译后会修改target中的内容,如果只删除了代码的java类,而没有删除target中的class,此时编译也会报错;删除target中多余的class类即可。
4、解决方案
Idea2021.3右侧 maven 工具栏,执行clean,再install。之后便可以在target文件夹下找到相关的*.xml文件,重新运行项目,访问成功。
不过每次都要这样重启项目似乎略显麻烦。
待优化
IDEA中target文件夹不自动更新可能存在的原因