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

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 asp.textbox后台赋值前端不能显示什么原因
  • ¥15 宇视监控服务器无法登录
  • ¥15 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥15 DruidDataSource一直closing
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误