mybatis insert into select from where 子句中的参数无法作用

insert into中嵌套select子句,select中的where子句无法使用参数!
是mybatis无法识别出来吗

mapper.xml:

图片描述

测试:

图片描述

无法插入:

图片描述

修改mapper.xml:

图片描述

可以插入:

图片描述

ProductProcess类:

图片描述

阅读 12.7k
2 个回答

看起来像是你在 new ProductProcess(...) 的时候, materialNameblenderName 传反了?

// 在你的 mybatis 实现的 DAO 接口中的参数前增加注解
@Param("materialName"), @Param("blenderName")
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题