/* * Copyright (c) 2011-2016, hubin (jobob@qq.com). *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at *
* http://www.apache.org/licenses/LICENSE-2.0 *
* Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.baomidou.mybatisplus.extension.service; import java.io.Serializable; import java.util.Collection; import java.util.List; import java.util.Map; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; /** *
* 顶级 Service *
* * @author hubin * @since 2018-06-23 */ public interface IService* 插入一条记录(选择字段,策略插入) *
* * @param entity 实体对象 * @return boolean */ boolean insert(T entity); /** ** 插入(批量),该方法不适合 Oracle *
* * @param entityList 实体对象集合 * @return boolean */ boolean insertBatch(Collection* 插入(批量) *
* * @param entityList 实体对象集合 * @param batchSize 插入批次数量 * @return boolean */ boolean insertBatch(Collection* 批量修改插入 *
* * @param entityList 实体对象集合 * @return boolean */ boolean insertOrUpdateBatch(Collection* 批量修改插入 *
* * @param entityList 实体对象集合 * @param batchSize * @return boolean */ boolean insertOrUpdateBatch(Collection* 根据 ID 删除 *
* * @param id 主键ID * @return boolean */ boolean deleteById(Serializable id); /** ** 根据 columnMap 条件,删除记录 *
* * @param columnMap 表字段 map 对象 * @return boolean */ boolean deleteByMap(Map* 根据 entity 条件,删除记录 *
* * @param wrapper 实体包装类 {@link Wrapper} * @return boolean */ boolean delete(Wrapper* 删除(根据ID 批量删除) *
* * @param idList 主键ID列表 * @return boolean */ boolean deleteBatchIds(Collection extends Serializable> idList); /** ** 根据 ID 选择修改 *
* * @param entity 实体对象 * @return boolean */ boolean updateById(T entity); /** ** 根据 whereEntity 条件,更新记录 *
* * @param entity 实体对象 * @param wrapper 实体包装类 {@link Wrapper} * @return boolean */ boolean update(T entity, Wrapper* 根据ID 批量更新 *
* * @param entityList 实体对象集合 * @return boolean */ boolean updateBatchById(Collection* 根据ID 批量更新 *
* * @param entityList 实体对象集合 * @param batchSize 更新批次数量 * @return boolean */ boolean updateBatchById(Collection* TableId 注解存在更新记录,否插入一条记录 *
* * @param entity 实体对象 * @return boolean */ boolean insertOrUpdate(T entity); /** ** 根据 ID 查询 *
* * @param id 主键ID * @return T */ T selectById(Serializable id); /** ** 查询(根据ID 批量查询) *
* * @param idList 主键ID列表 * @return Collection* 查询(根据 columnMap 条件) *
* * @param columnMap 表字段 map 对象 * @return Collection* 根据 Wrapper,查询一条记录 *
* * @param wrapper 实体对象 * @return T */ T selectOne(Wrapper* 根据 Wrapper,查询一条记录 *
* * @param wrapper {@link Wrapper} * @return Map* 根据 Wrapper,查询一条记录 *
* * @param wrapper {@link Wrapper} * @return Object */ Object selectObj(Wrapper* 根据 Wrapper 条件,查询总记录数 *
* * @param wrapper 实体对象 * @return int */ int selectCount(Wrapper* 查询列表 *
* * @param wrapper 实体包装类 {@link Wrapper} * @return */ Collection* 翻页查询 *
* * @param page 翻页对象 * @param wrapper 实体包装类 {@link Wrapper} * @return */ IPage* 查询列表 *
* * @param wrapper {@link Wrapper} * @return */ List