package thyyxxk.webserver.entity.datamodify;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import thyyxxk.webserver.utils.StringUtil;

@Data
public class GetDropdownBox {
    private String code;
    private String name;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String pyCode;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String wCode;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String DCode;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String ybCode;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String deptName;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String codeRs;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String siCaty;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String siCatyName;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String empTitName;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String parentCode;

    public String getCode() {
        if (StringUtil.isBlank(code)) {
            return code;
        }
        return code.trim();
    }

    public String getName() {
        if (StringUtil.isBlank(name)) {
            return name;
        }
        return name.trim();
    }

    public String getPyCode() {
        if (StringUtil.isBlank(pyCode)) {
            return pyCode;
        }
        return pyCode.trim();
    }

    public String getWCode() {
        if (StringUtil.isBlank(wCode)) {
            return wCode;
        }
        return wCode.trim();
    }

    public String getValue() {
        return getCode();
    }

    public String getLabel() {
        return getName();
    }
}
