| | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 自定义 Mapper 接口, 实现 自定义扩展 |
| | |
| | | * @return 插入操作是否成功的布尔值 |
| | | */ |
| | | default boolean insertBatch(Collection<T> entityList) { |
| | | Db.saveBatch(entityList); |
| | | // 临时解决 新版本 mp 插入状态判断错误问题 |
| | | return true; |
| | | return Db.saveBatch(entityList); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 更新操作是否成功的布尔值 |
| | | */ |
| | | default boolean updateBatchById(Collection<T> entityList) { |
| | | Db.updateBatchById(entityList); |
| | | // 临时解决 新版本 mp 插入状态判断错误问题 |
| | | return true; |
| | | return Db.updateBatchById(entityList); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 插入或更新操作是否成功的布尔值 |
| | | */ |
| | | default boolean insertOrUpdateBatch(Collection<T> entityList) { |
| | | Db.saveOrUpdateBatch(entityList); |
| | | // 临时解决 新版本 mp 插入状态判断错误问题 |
| | | return true; |
| | | return Db.saveOrUpdateBatch(entityList); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 插入操作是否成功的布尔值 |
| | | */ |
| | | default boolean insertBatch(Collection<T> entityList, int batchSize) { |
| | | Db.saveBatch(entityList, batchSize); |
| | | // 临时解决 新版本 mp 插入状态判断错误问题 |
| | | return true; |
| | | return Db.saveBatch(entityList, batchSize); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 更新操作是否成功的布尔值 |
| | | */ |
| | | default boolean updateBatchById(Collection<T> entityList, int batchSize) { |
| | | Db.updateBatchById(entityList, batchSize); |
| | | // 临时解决 新版本 mp 插入状态判断错误问题 |
| | | return true; |
| | | return Db.updateBatchById(entityList, batchSize); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 插入或更新操作是否成功的布尔值 |
| | | */ |
| | | default boolean insertOrUpdateBatch(Collection<T> entityList, int batchSize) { |
| | | Db.saveOrUpdateBatch(entityList, batchSize); |
| | | // 临时解决 新版本 mp 插入状态判断错误问题 |
| | | return true; |
| | | return Db.saveOrUpdateBatch(entityList, batchSize); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param idList 主键ID集合 |
| | | * @return 查询到的VO对象列表 |
| | | */ |
| | | default List<V> selectVoBatchIds(Collection<? extends Serializable> idList) { |
| | | return selectVoBatchIds(idList, this.currentVoClass()); |
| | | default List<V> selectVoByIds(Collection<? extends Serializable> idList) { |
| | | return selectVoByIds(idList, this.currentVoClass()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param <C> VO类的类型 |
| | | * @return 查询到的VO对象列表,经过转换为指定的VO类后返回 |
| | | */ |
| | | default <C> List<C> selectVoBatchIds(Collection<? extends Serializable> idList, Class<C> voClass) { |
| | | List<T> list = this.selectBatchIds(idList); |
| | | default <C> List<C> selectVoByIds(Collection<? extends Serializable> idList, Class<C> voClass) { |
| | | List<T> list = this.selectByIds(idList); |
| | | if (CollUtil.isEmpty(list)) { |
| | | return CollUtil.newArrayList(); |
| | | } |