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));
|
}
|
|
}
|
}
|