add
yj
2024-12-05 b9900893177c78fc559223521fe839aa21000017
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.dobbinsoft.fw.support.context;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 
/**
 * ClassName: QueryContext
 * Description: 查询上下文
 *
 * @author: e-weichaozheng
 * @date: 2021-04-21
 */
public class QueryContext {
 
    public static ThreadLocal<QueryWrapper> tl = new ThreadLocal<>();
 
    public static void set(QueryWrapper wrapper) {
        tl.set(wrapper);
    }
 
    public static QueryWrapper get() {
        return tl.get();
    }
 
    public static void clear() {
        tl.remove();
    }
 
}