This commit is contained in:
2025-12-27 11:44:50 +08:00
commit ccd43fac1f
1193 changed files with 384161 additions and 0 deletions
@@ -0,0 +1,22 @@
#jpa
### 查询条件
使用Persist Object存查询条件
```java
QuestInfoPO po = new QuestInfoPO();
po.setCreatorId(StringUtils.isBlank(creatorId) ? null : creatorId);
po.setCreatedBy(StringUtils.isBlank(creatorName) ? null : creatorName);
po.setName(StringUtils.isBlank(questName) ? null : questName);
po.setStatus(status);
```
### 过滤规则
使用ExampleMatch指定过滤规则,matcher的properties使用的是表字段名
```java
ExampleMatcher matcher = ExampleMatcher.matching()
.withMatcher("creator_id", match -> match.exact())
.withMatcher("created_by", match -> match.contains())
.withMatcher("name", match -> match.contains())
.withMatcher("status", match -> match.exact())
.withIgnoreNullValues();
```
### 排除空条件
使用withIgnoreNullValues()排除po中的null条件