dao 层的 mapper接口类的方法:
Integer editBook(@Param("bookVO") BookVO bookVO);
明明加了 @Param
注解却还是报错了…
看了一下xml 中的 SQL 语句:
<update id="editBook">
update book set
book_name = #{bookName},
book_content = #{bookContent},
update_date=now(),
update_by=#{updateBy}
where id = #{id} and delete_flag = 'normal'
</update>
【解决方法】
改成下面的就好了:
<update id="editBook">
update book set
book_name = #{bookVO.bookName},
book_content = #{bookVO.bookContent},
update_date=now(),
update_by=#{bookVO.updateBy}
where id = #{bookVO.id} and delete_flag = 'normal'
</update>