mybatis参数错误 Parameter '×××' not found. Available parameters are [0, 1, param1, param2]

时间:2022-01-02 05:24:02

报错的代码

@Update("update staff_info set ApplyState = #{applyState} where Id = #{userId}")
int handleStaff( Integer userId, Integer applyState);

修改后的代码

@Update("update staff_info set ApplyState = #{applyState} where Id = #{userId}")
int handleStaff(@Param(value="userId") Integer userId,@Param(value="applyState") Integer applyState);

完美解决问题