mapper接口

返回类型 方法 功能说明
int countByExample(UsersExample example); 按条件计数
int deleteByExample(UsersExample example); 按条件删除
int deleteByPrimaryKey(Long uId); 按主键删除
int insert(Users record); 插入数据,所有字段都会执行
int insertSelective(Users record); 插入数据,只执行有数据的字段
User selectByExample(UsersExample example); 按条件查询
对象 selectByPrimaryKey(Long uId); 按主键查询
list updateByExampleSelective(@Param("record") Users record, @Param("example") UsersExample example); 按条件更新表的某些属性而不是所有
int updateByExample(@Param("record") Users record, @Param("example") UsersExample example); 按条件更新所有的属性
int updateByPrimaryKeySelective(Users record); 按主键更新值不为null的字段
int updateByPrimaryKeySelective(Users record);

根据id更新,会判断字段为空

int updateByPrimaryKey(Users record); 更具id更新,不会判断字段


 

最后修改于 2021-10-25 21:20:22
如果觉得我的文章对你有用,请随意赞赏
扫一扫支付
上一篇