错误: 字段关联 “id“ 是不明确的

1, 版本

在这里插入图片描述

2,问题

org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.postgresql.util.PSQLException: 错误: 字段关联 "id" 是不明确的
  位置:331
### The error may exist in file [D:\ccs-fz\mm\mm-svc\target\classes\com\paas\mm\maper\ItemTypeConfigDetailMapper.map.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: select       i.id,   d.type,  d.company_id,  d.item_type_code,  d.item_type_name,  d.item_type_name_enus,  i.ITEM_TYPE,   i.purchase_group,  i.cost_code,  i.cost_name            from mm_item_type_config_detail d      LEFT JOIN mm_item_type_config i      on d.item_type_code=i.ITEM_TYPE_CODE                WHERE 1=1           and id = ?                                                 and ( company_id like             (                'uuu'             ,                'bbbb'             ,                'uuuuu'             )               or company_id is null              )                                                                                                                and ACTIVE = 'Y' limit 10
### Cause: org.postgresql.util.PSQLException: 错误: 字段关联 "id" 是不明确的
  位置:331

	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107)

3,解决方法

添加别名

在这里插入图片描述


版权声明:本文为riding_horse原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。