改写SSM项目https://www.bilibili.com/video/BV18J411k7SF?from=search&seid=7715680395343362130出现

Column 'goods_id' in where clause is ambiguous解决办法

原因分析及解释:https://www.bilibili.com/video/av925559812

P22 商品加入购物车前端处理 空降9分42

<select id="selectByExample" parameterType="com.damu.xiaomi.entry.GoodsCartExample" resultMap="BaseResultMapWithGoodsimage"><!--WARNING - @mbg.generatedThis element is automatically generated by MyBatis Generator, do not modify.This element was generated on Tue Dec 10 19:17:22 CST 2019.-->select gc.id, gc.goods_id,  gc.add_date, gc.buy_count, gc.subtotal, gc.consumer_id,gi.id giid, gi.path, gi.title, gi.alt, gi.goods_id gigidfrom xiaomi.goods_cart gcleft join xiaomi.goods_images gion gc.goods_id = gi.goods_id<if test="_parameter != null"><include refid="Example_Where_Clause" /></if><if test="orderByClause != null">order by ${orderByClause}</if></select><resultMap id="BaseResultMapWithGoodsimage" type="com.damu.xiaomi.entry.GoodsCart"><!--WARNING - @mbg.generatedThis element is automatically generated by MyBatis Generator, do not modify.This element was generated on Tue Dec 10 19:17:22 CST 2019.--><id column="id" jdbcType="INTEGER" property="id" /><result column="buy_count" jdbcType="INTEGER" property="buyCount" /><result column="goods_id" jdbcType="INTEGER" property="goodsId" /><result column="add_date" jdbcType="TIMESTAMP" property="addDate" /><result column="subtotal" jdbcType="DOUBLE" property="subtotal" /><result column="consumer_id" jdbcType="INTEGER" property="consumerId" /><collection property="goodsImages" ofType="com.damu.xiaomi.entry.GoodsImages"><id column="giid" property="id"/><result column="path" property="path"/><result column="title" property="title"/><result column="alt" property="alt"/></collection></resultMap>sql id="Example_Where_Clause"><!--WARNING - @mbg.generatedThis element is automatically generated by MyBatis Generator, do not modify.This element was generated on Tue Dec 10 19:17:22 CST 2019.--><where><foreach collection="oredCriteria" item="criteria" separator="or"><if test="criteria.valid"><trim prefix="(" prefixOverrides="and" suffix=")"><foreach collection="criteria.criteria" item="criterion"><choose><when test="criterion.noValue">and ${criterion.condition}</when><when test="criterion.singleValue">and ${criterion.condition} #{criterion.value}</when><when test="criterion.betweenValue">and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}</when><when test="criterion.listValue">and ${criterion.condition}<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">#{listItem}</foreach></when></choose></foreach></trim></if></foreach></where></sql>

解决办法::在mysql 生成视图

create view  v_goodcartinfo as(select gc.id, gc.goods_id,  gc.add_date, gc.buy_count, gc.subtotal, gc.consumer_id,gi.id giid, gi.path, gi.title, gi.alt, gi.goods_id gigidfrom xiaomi.goods_cart gcleft join xiaomi.goods_images gion gc.goods_id = gi.goods_id
)

使用Example_where_Cause出现 Column 'goods_id' in where clause is ambiguous解决办法相关推荐

  1. Column 'id' in where clause is ambiguous

    使用mysql数据库进行左右连接查询的时候出现错误提示 Column 'id' in where clause is ambiguous 使用mysql数据库进行左右连接查询的时候出现错误提示 Col ...

  2. Java Column ‘xxx‘ in where clause is ambiguous问题解决

    问题描述: java.sql.SQLIntegrityConstraintViolationException: Column 'role_id' in where clause is ambiguo ...

  3. pymysql.err.InternalError: (1054, Unknown column '27D24A3B' in 'where clause')之错误解决

    原代码: query_image_path1='SELECT imageTempFilename_0,imageTempFilename_1 FROM %s'% tablename query_ima ...

  4. Error Code: 1052. Column '列名' in where clause is ambiguous

    这种错误主要是sql中出现多个表有列名重名的现象,而查询条件却没有指定选取那个表导致的这个问题. 例如:表A和表B,两个表都有type这个字段做关联查询后: select * from A inner ...

  5. Column 'Status' in where clause is ambiguous

    错误提示: 解决: 在Mapper文件中,多表关联查询中有相同的字段,在查询条件里,没有指定别名. <where><if test="customerName"& ...

  6. sql语句常见错误:Unknown column 'xxx' in 'where clause该如何解决?

    即如下图显示: 翻译得知该列名不存在或者在数据库找不到,先一步步排查 一,先查看数据库 输入的账号密码都没错! 二,检查eclipse中写的sql语句有无错误 粗心的人可能会把数据库中uname列在e ...

  7. navicat连接PostgreSQL报:column “rolcatupdate” does not exist ...错误的解决办法

    avicat premium 连接PostgreSQL出现: column "rolcatupdate" does not exist ... 错误如图: 解决方案: 看看你的na ...

  8. 网优图层制作工具报错”Column '' does not belong to table .”的解决办法

    一.问题现象 在使用网优小工具的时候,导入工作表之后出现下图错误,从英文理解,大意应该是空列不能从属与一个表,导致图层无法制作. 二.解决方法 核查问题原因,主要是标签名未做选择,这是需要选择原始表里 ...

  9. Mysql, where clause is ambiguous

    错误提示 Column 'status' in where clause is ambiguous. 这个错误in where clause is ambiguous 是因为多表查询的时候几个表中同时 ...

最新文章

  1. 应用层下的人脸识别(四):人脸研判
  2. bzoj3295:[CQOI2011]动态逆序对
  3. 安全中间件与应用服务间如用session
  4. 神经病win10无法验证数字签名
  5. 设计模式工厂方法模式
  6. 这6个动作,据说只有20%的人能做到!| 今日最佳
  7. php怎么上传函数,php上传函数怎么封装
  8. 作者:刘昂(1990-),男,中国科学院计算机网络信息中心工程师
  9. 牛客网–华为机试在线训练4:字符串分隔
  10. springboot配置手动提交_kafka教程-springboot消费者-手动提交offset
  11. 腾讯云即时通讯im之获取userSig
  12. 智慧农业项目建设体系之精准饲喂系统及数据分析
  13. 一本书让你知道互联网思维 个人总结
  14. 自写自用的移动小程序故障管理扫码报修系统
  15. C语言函数大全-- q 开头的函数
  16. [DOS教程----读书笔记]命令全集
  17. Java+spring+springmvc 基于ssm的师生防疫登记备案系统设计#毕业设计
  18. 【C刷题记录】地月折纸——对数使用
  19. 空客将在机场安检测试新型“电子鼻”,或可检测新冠病毒
  20. 使用百度EasyDL实现厂区工人抽烟行为识别

热门文章

  1. luogu1979 华容道
  2. FTP主动和被动模式(详解+图示)
  3. 自动延时关机电路分析
  4. 如何正确安装朗文英文当代大词典(2CD版)
  5. 我刚刚通过 @盛大网盘EverBox 分享了 Web协议与实践HTTP.、网络协议、缓存技术和....pdf, 欢迎大家下载!...
  6. 支付宝手机唤起app支付
  7. QQ号转换成16进制登陆
  8. Python入门习题大全——检查用户名
  9. LQ-630K打印发票右边打不全?
  10. iOS MJRefresh 自定义刷新动画