请求大佬支援!SpringBoot报错Parameter 'name' not found. Available parameters are [1, id, param1, param2]

执行更新语句报错Parameter 'name' not found. Available parameters are [1, id, param1, param2]

@Update("update emp set name=#{name},avatar=#{avatar},dept_id=#{deptId},job=#{job},birthday=#{birthday}," +
            "sex=#{sex},edu=#{edu},idcard=#{idcard},address=#{address},phone=#{phone},remark=#{remark} where id = #{id}")
    void updateByEmp(@Param("id") Integer id,Emp emp);

参数Emp emp加上@Param注解,且传入sql字段带上emp变量,类似如下试试:

@Update("update emp set name=#{emp.name},avatar=#{emp.avatar},dept_id=#{emp.deptId},job=#{emp.job},birthday=#{emp.birthday}," +
            "sex=#{emp.sex},edu=#{emp.edu},idcard=#{emp.idcard},address=#{emp.address},phone=#{emp.phone},remark=#{emp.remark} where id = #{id}")
    void updateByEmp(@Param("id") Integer id,@Param("emp") Emp emp);

@Param注解没写?
或许你可以看下这里:https://blog.csdn.net/sinat_35814207/article/details/80815289
希望能帮到你