From 073931b000c34825565e7df7ba8ec1587e4d9865 Mon Sep 17 00:00:00 2001 From: wangyu <727842003@qq.com> Date: Thu, 17 Nov 2022 17:02:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8D=87=E7=BA=A70.0.5=EF=BC=8C?= =?UTF-8?q?=E5=B0=8F=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 95c0136..111631e 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,24 @@ public class FluentSqlConfig { } ``` +## 单表查询 +单表查询可以省略结果映射,程序自动使用主表实体进行自动映射 + +```java +class Test { + + public static void main(String[] args) { + // 单表查询所有字段 + List tenants = select().from(SaasTenant.class).list(); + // 单表查询指定字段,条件 年龄小于50 + List points = select(SaasTenant::getId, SaasTenant::getName).from(SaasTenant.class) + .matching(where(SaasTenant::getAge).lt(50)) + .list(); + } +} + +``` + ## 对比直接书写SQL 本小组件主要解决的是sql的书写问题,旨在用更加优雅的方式实现sql,并且不用再担心数据库方言(SQL Dialect)