Home  >  Q&A  >  body text

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

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

mapper.xml:

测试:

无法插入:

修改mapper.xml:

可以插入:

ProductProcess类:

PHP中文网PHP中文网2712 days ago734

reply all(2)I'll reply

  • 高洛峰

    高洛峰2017-04-18 10:31:30

    Looks like you new ProductProcess(...) 的时候, materialNameblenderName transmitted the wrong message?

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-18 10:31:30

    // 在你的 mybatis 实现的 DAO 接口中的参数前增加注解
    @Param("materialName"), @Param("blenderName")

    reply
    0
  • Cancelreply