藤井树441 2022-04-23 14:02 采纳率: 93.8%
浏览 54
已结题

Parameter 'brandname' don't Found 求解 vue+

问题遇到的现象和发生背景

在使用vue是用数据库update的方法,

 @Update("update tb_brand set brand_name=#{brandName} where Id=id,update tb_brand set company_name=#{companyName} where Id=id,update tb_brand set ordered=#{ordered} where Id=id,update tb_brand set description=#{description} where Id=id,update tb_brand set status=#{status} where Id=id")
    void update(Brand brand,Integer id);

问题相关代码,请勿粘贴截图
Caused by: org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: org.apache.ibatis.binding.BindingException: Parameter 'brandName' not found. Available parameters are [arg1, arg0, param1, param2]
### The error may exist in com/itheima/mapper/BrandMapper.java (best guess)
### The error may involve com.itheima.mapper.BrandMapper.update-Inline
### The error occurred while setting parameters
### SQL: update tb_brand set brand_name=? where Id=id,update tb_brand set company_name=? where Id=id,update tb_brand set ordered=? where Id=id,update tb_brand set description=? where Id=id,update tb_brand set status=? where Id=id
### Cause: org.apache.ibatis.binding.BindingException: Parameter 'brandName' not found. Available parameters are [arg1, arg0, param1, param2]
    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199)
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:67)


运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果
  • 写回答

1条回答 默认 最新

  • Jessie_fancy 2022-04-23 14:27
    关注
     @Update("update tb_brand set brand_name=#{brand.brandName} , set company_name=#{brand.companyName},set ordered=#{brand.ordered}, set description=#{brand.description} , set status=#{brand.status} where Id=#{id}")
        void update(Brand brand,Integer id);
    
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录

报告相同问题?

问题事件

  • 系统已结题 5月1日
  • 已采纳回答 4月23日
  • 创建了问题 4月23日

悬赏问题

  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码