add BaseMapper.deleteAllByExample

This commit is contained in:
Timi
2025-12-01 11:13:36 +08:00
parent 23598242f0
commit 745b3acfef
4 changed files with 76 additions and 4 deletions

View File

@ -31,13 +31,13 @@ public interface BaseMapper<T, P> {
DESC
}
static final String NOT_DELETE = " AND `deleted_at` IS NULL ";
String NOT_DELETE = " AND `deleted_at` IS NULL ";
static final String LIMIT_1 = " LIMIT 1";
String LIMIT_1 = " LIMIT 1";
static final String UNIX_TIME = " FLOOR(UNIX_TIMESTAMP(NOW(3)) * 1000) ";
String UNIX_TIME = " FLOOR(UNIX_TIMESTAMP(NOW(3)) * 1000) ";
static final String PAGE = NOT_DELETE + " LIMIT #{offset}, #{limit}";
String PAGE = NOT_DELETE + " LIMIT #{offset}, #{limit}";
/**
* 统计数据量
@ -107,6 +107,9 @@ public interface BaseMapper<T, P> {
@UpdateProvider(type = SQLProvider.class, method = "delete")
void delete(P id);
@UpdateProvider(type = SQLProvider.class, method = "deleteAllByExample")
void deleteAllByExample(T t);
/**
* 销毁(物理删除)
*