package com.sdtool.common.entity.system;

import com.sdtool.common.entity.base.BaseEntity;
import com.sweetfish.util.Comment;
import org.rex.db.RColumn;

/**
 * Created by jlutt on 2018-07-04.
 * 个人的导入导出任务结果
 *
 * @author jlutt
 */
@SuppressWarnings("unused")
public class TaskQueue extends BaseEntity {

    @Comment("id自增")
    private long id;

    @Comment("用户id")
    @RColumn("userid")
    private long userId;

    @Comment("导出类别")
    @RColumn("taskname")
    private String taskName;

    @Comment("查询起始时间")
    @RColumn("querybegindate")
    private String queryBeginDate;

    @Comment("查询截止时间")
    @RColumn("queryenddate")
    private String queryEndDate;

    @Comment("查询内容")
    @RColumn("querycontent")
    private String queryContent;

    @Comment("错误信息")
    @RColumn("errormsg")
    private String errorMsg;

    @Comment("文件名称")
    @RColumn("filename")
    private String fileName;

    @Comment("文件链接")
    @RColumn("fileurl")
    private String fileURL;

    @Comment("外网文件链接")
    @RColumn("webfileurl")
    private String webFileURL;

    public TaskQueue() {
    }


    private TaskQueue(Builder builder) {
        setUserId(builder.userId);
        setTaskName(builder.taskName);
        setQueryBeginDate(builder.queryBeginDate);
        setQueryEndDate(builder.queryEndDate);
        setQueryContent(builder.queryContent);
        setErrorMsg(builder.errorMsg);
        setFileName(builder.fileName);
        setFileURL(builder.fileURL);
        setWebFileURL(builder.webFileURL);
    }

    public static Builder newBuilder() {
        return new Builder();
    }


    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getQueryBeginDate() {
        return queryBeginDate;
    }

    public void setQueryBeginDate(String queryBeginDate) {
        this.queryBeginDate = queryBeginDate;
    }

    public String getQueryEndDate() {
        return queryEndDate;
    }

    public void setQueryEndDate(String queryEndDate) {
        this.queryEndDate = queryEndDate;
    }

    public String getQueryContent() {
        return queryContent;
    }

    public void setQueryContent(String queryContent) {
        this.queryContent = queryContent;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFileURL() {
        return fileURL;
    }

    public void setFileURL(String fileURL) {
        this.fileURL = fileURL;
    }

    public String getWebFileURL() {
        return webFileURL;
    }

    public void setWebFileURL(String webFileURL) {
        this.webFileURL = webFileURL;
    }

    public static final class Builder {
        private long userId;
        private String taskName;
        private String queryBeginDate;
        private String queryEndDate;
        private String queryContent;
        private String errorMsg;
        private String fileName;
        private String fileURL;
        private String webFileURL;

        private Builder() {
        }

        public Builder userId(long val) {
            userId = val;
            return this;
        }

        public Builder taskName(String val) {
            taskName = val;
            return this;
        }

        public Builder queryBeginDate(String val) {
            queryBeginDate = val;
            return this;
        }

        public Builder queryEndDate(String val) {
            queryEndDate = val;
            return this;
        }

        public Builder queryContent(String val) {
            queryContent = val;
            return this;
        }

        public Builder errorMsg(String val) {
            errorMsg = val;
            return this;
        }

        public Builder fileName(String val) {
            fileName = val;
            return this;
        }

        public Builder fileURL(String val) {
            fileURL = val;
            return this;
        }

        public Builder webFileURL(String val) {
            webFileURL = val;
            return this;
        }

        public TaskQueue build() {
            return new TaskQueue(this);
        }
    }
}
