BrbiwsFtd9zDGZqB's recent timeline updates
BrbiwsFtd9zDGZqB

BrbiwsFtd9zDGZqB

V2EX member #327781, joined on 2018-07-08 22:05:46 +08:00
Per BrbiwsFtd9zDGZqB's settings, the topics list is hidden
Deals info, including closed deals, is not hidden
BrbiwsFtd9zDGZqB's recent replies
巧了, lz 你说的这个东西我实现过.
我理解你的问题关键点不在于 sql 拼接, 而是如何将 动态的 json 转换为查询逻辑, 因为 sql 拼接有很多方式, mybatis 也好 jpa 也好 都是在转换为查询逻辑之后的具体实现.

所以我最终的实现方式中使用了 visitor 模式去分片组织查询逻辑.

```json
{
"paginate": true,
"page": 1,
"size": 20,
"sort": [
{
"field": "createdDate",
"direction": "DESC"
}
],
"filter": {
"match": "ALL",
"rules": [
{
"field": "name",
"operator": "LK",
"value": "111"
},
{
"match": "ANY",
"rules": [
{
"field": "title",
"operator": "EQ",
"value": "111"
},
{
"field": "isbn",
"operator": "EQ",
"value": "1"
}
]
}
]
}
}
```

```sql
SELECT
*
FROM
book
WHERE
"name" LIKE ? ESCAPE''
AND ( title =? OR isbn =? )
ORDER BY
created_date DESC OFFSET ? ROWS FETCH FIRST ? ROWS ONLY
```
有印象, 但我也找不到了 😥
正常, 戒烟有五年了, 有时还会梦到.
viofo 119 mini
1. mybatis, 用 myabtis-plus 的 QueryWrapper, 动态拼接一下查询条件.
https://baomidou.com/pages/10c804

2. jpa, 看文档 4.8.2 那一节, Querydsl Web Support.
https://docs.spring.io/spring-data/jpa/docs/current/reference/html


实现后接口大概是这样: http://your.api/user?name=Alice&page=0&size=20&sort=age,asc
Mar 19, 2022
Replied to a topic by BrbiwsFtd9zDGZqB 分享发现 百度你想干什么
@dier #2
@deplivesb #3

老哥们用的什么屏蔽规则呀, 可不可以分享一下.
我订阅的规则没有屏蔽呢
从智能机出现开始一直用安卓, 也是各种折腾.
今年突发奇想换到了 iPhone.

总的来说, 真香. iPhone 真省心, 累了折腾不动了.

唯一的痛点就是没有通话录音
同 1 楼, 推荐 google 的 jib
啊这, 旧版不支持升级?
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   790 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 20:16 · PVG 04:16 · LAX 13:16 · JFK 16:16
♥ Do have faith in what you're doing.