updateprimarykey 会对左右的字段都进行更新,updateprimaryKeySelective 只会对不为null的字段进行更新..所以在填表的web项目需要注意这个两个方法的选择,因为有的选项会传null,如果允许传null,那么第二个方方法就没有更新效果. int updateByPrimaryKeySelective(TbItem record);int updateByPrimaryKey(TbItem record);上面的是逆转工程生成的Mapper接口 对应的xml…
1.创建如下mysql脚本 drop table if exists book_info; create table if not exists book_info( book_id ) primary key auto_increment, book_name ) not null, book_author ) not null, book_publish ) not null, book_page ) not null, book_price ,) not null, creation_ti…