Request processing failed: nested exception is org.springframework.jdbc.BadSqlGrammarException(后来仔细一看能看出来是sql语法错误)

错误提示:

Request processing failed: nested exception is org.springframework.jdbc.BadSqlGrammarException

Unknown column 'e.dept_id' in 'on clause'

解决方案:

在配置文件src/main/resources/mapper/EmployeeMapper.xml中找到查询语句

FROM tbl_emp e
LEFT JOIN tbl_dept d ON d.`dept_id`=e.`d_id`

发现是其中的e和d写反了,e表格中才有"d_id",d表格中才有"dept_id"。

posted @ 2020-07-30 17:20  imisswenjing  阅读(5926)  评论(0)    收藏  举报