-
方法名称
作用
未找到数据返回的信息
List<T> selectAll(); 查询全部数据 空集合【】 T selectByPrimaryKey(Object key); 通过主键查询 null T selectOne(T record); 通过实体查询单个数据 null List<T> select(T record); 通过实体查询多个数据 空集合【】 int selectCount(T record); 通过实体查询实体数量 0 boolean existsWithPrimaryKey(Object key); 通过主键查询此主键是否存在 false List<T> selectByIdList(List<long> list); 通过多个主键查询数据 空集合【】 int insert(T record); 全部添加,属性无数据默认为null添加 int insertSelective(T record); 选择性(不为null)的添加,属性为空的值会默认为数据库设置的值 int insertList(List<T> list); 批量插入 int insertUseGeneratedKeys(T record); 如果主键为自增可使用此方法获取添加成功的主键 int insertList(List<T> list); 批量插入 int updateByPrimaryKey(T record); 会对注入的字段全部更新 int updateByPrimaryKeySelective(T record); 会对你注入的字段全部更新 int delete(T record); 按照实体进行删除 int deleteByPrimaryKey(Object o); 按照主键进行删除 int deleteByIdList(List<Long> list); 按照主键批量删除
ibatis通用方法的适用条件以及无数据返回的信息
最新推荐文章于 2022-10-25 16:03:00 发布