优化 BaseMapperX的update、insert方法返回值

pull/71/head
1351515658@qq.com 2023-11-29 09:51:03 +08:00
parent 16c303bc28
commit bc05fe497c
1 changed files with 14 additions and 14 deletions

View File

@ -121,8 +121,8 @@ public interface BaseMapperX<T> extends MPJBaseMapper<T> {
*
* @param entities
*/
default void insertBatch(Collection<T> entities) {
Db.saveBatch(entities);
default Boolean insertBatch(Collection<T> entities) {
return Db.saveBatch(entities);
}
/**
@ -131,28 +131,28 @@ public interface BaseMapperX<T> extends MPJBaseMapper<T> {
* @param entities
* @param size Db.saveBatch 1000
*/
default void insertBatch(Collection<T> entities, int size) {
Db.saveBatch(entities, size);
default Boolean insertBatch(Collection<T> entities, int size) {
return Db.saveBatch(entities, size);
}
default void updateBatch(T update) {
update(update, new QueryWrapper<>());
default int updateBatch(T update) {
return update(update, new QueryWrapper<>());
}
default void updateBatch(Collection<T> entities) {
Db.updateBatchById(entities);
default Boolean updateBatch(Collection<T> entities) {
return Db.updateBatchById(entities);
}
default void updateBatch(Collection<T> entities, int size) {
Db.updateBatchById(entities, size);
default Boolean updateBatch(Collection<T> entities, int size) {
return Db.updateBatchById(entities, size);
}
default void insertOrUpdate(T entity) {
Db.saveOrUpdate(entity);
default Boolean insertOrUpdate(T entity) {
return Db.saveOrUpdate(entity);
}
default void insertOrUpdateBatch(Collection<T> collection) {
Db.saveOrUpdateBatch(collection);
default Boolean insertOrUpdateBatch(Collection<T> collection) {
return Db.saveOrUpdateBatch(collection);
}
default int delete(String field, String value) {