kimi42345
2020-03-17 6c6fdb4db59a2a2343e43ffd73a07f17b057c4fa
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.highdatas.mdm.pojo;
 
import com.highdatas.mdm.util.Constant;
import com.highdatas.mdm.util.DbUtils;
import lombok.Getter;
import lombok.Setter;
 
/**
 * @author kimi
 * @description
 * @date 2019-12-17 12:15
 */
 
 
public class Segment {
    @Getter @Setter
    private String name;
    @Getter @Setter
    private Object value;
    @Getter @Setter
    private String joinStr;
 
    public Segment(String name, Object value) {
        this.name = name;
        this.value = value;
        this.joinStr = Constant.EQUAL;
    }
 
    @Override
    public String toString() {
        if (name == null) {
            return super.toString();
        }
        if (value == null) {
            return Constant.WHERE_DEFAULT;
        }
        if (value instanceof String) {
            return DbUtils.StrJoin(name,joinStr,DbUtils.quotedStr(value));
        } else {
            return DbUtils.StrJoin(name,joinStr,String.valueOf(value));
        }
 
    }
}