The error message "java.sql.SQLSyntaxErrorException: Unknown column 'ci.user_id' in 'where clause'" indicates that the SQL query being executed contains an invalid column reference. Specifically, the 'ci.user_id' column is not found in the 'where' clause of the query. This error is likely originating from the file "CustomerInfoMapper.xml", which is located at the path "C:\project\zhongxin\CiticMetal-Backend\customer\customer-biz\target\classes\mapper\CustomerInfoMapper.xml". The error is occurring within the 'defaultParameterMap' section of the file. The faulty SQL statement is as follows: "SELECT COUNT(*) FROM (SELECT ci.customer_id, ci.customer_name, ci.cbmm_cgs_name, ci.customer_type, ci.update_time FROM cm_customer_info ci WHERE ci.del_flag = '0' AND (ci.user_id = ? OR ci.user_id IS NULL) GROUP BY ci.customer_id) TOTAL". The error occurs because the column 'ci.user_id' is not present in the 'cm_customer_info' table, which is aliased as 'ci' in the query. To fix this issue, you need to either add the 'user_id' column to the 'cm_customer_info' table or modify the query to utilize a different column that exists within the table.

SQLSyntaxErrorException: Unknown column 'ci.user_id' in 'where clause' - Troubleshooting Guide

原文地址: https://www.cveoy.top/t/topic/qhn4 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录