add BaseMapper.listAll

This commit is contained in:
Timi
2025-11-04 14:58:49 +08:00
parent e08a50a9b2
commit 9bcf17a118
2 changed files with 13 additions and 0 deletions

View File

@ -76,6 +76,16 @@ public class SQLProvider {
return sql.append(" LIMIT %s, %s".formatted(offset, limit)).toString();
}
public String listAll(ProviderContext context) {
EntityMeta meta = getEntityMeta(context);
StringBuilder sql = new StringBuilder();
sql.append("SELECT * FROM %s WHERE 1 = 1".formatted(meta.table));
if (meta.canDelete) {
sql.append(BaseMapper.NOT_DELETE);
}
return sql.toString();
}
/**
* 插入
* <p><i>不实现 {@link Creatable} 也允许调用是合理的,某些数据属于关联数据,不参与主创建过程</i></p>