TTInfo.java 4.53 KB
package com.bsth.entity.schedule;

import com.bsth.entity.Line;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import javax.persistence.*;
import java.util.Date;

/**
 * 时刻表信息
 */
@Entity
@Table(name="bsth_c_s_ttinfo")
@NamedEntityGraphs({
        @NamedEntityGraph(name = "ttInfo_xl", attributeNodes = {
                @NamedAttributeNode("xl"),
                @NamedAttributeNode("createBy"),
                @NamedAttributeNode("updateBy")
        })
})
@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
public class TTInfo extends BEntity {

    /** 主键Id */
    @Id
    @GeneratedValue
    private Long id;

    /** 线路关联 */
    @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
    private Line xl;

    /** 时刻表名称 */
    @Column(nullable = false)
    private String name;
    /** 线路方向(TODO:上下行,上行,下行,这个以后用枚举还是字典再议,现在先用文字) */
    @Column(nullable = false)
    private String xlDir;
    /** 启用日期 */
    @Column(nullable = false)
    private Date qyrq;
    /** 是否启用调度模版 */
    @Column(nullable = false)
    private Boolean isEnableDisTemplate;
    /** 是否删除(标记) */
    @Column(nullable = false)
    private Boolean isCancel = false;

    /** 模版类型(TODO:时刻表,间隔式,这个以后用枚举还是字典再议,现在先用文字) */
    private String templateType;

    // TODO:还有很多判定条件,这里先不放

    /** 路牌数(这两个字段暂时不用) */
    private int lpCount;
    /** 圈数(这两个字段暂时不倒) */
    private int loopCount;

    // TODO:原系统里的分别在,圈后圈进场,意思不知道,再议

    /** 常规有效日(1-7表示星期一到星期日,多个用逗号隔开) */
    private String rule_days;
    /** 特殊有效日期(格式:2001-01-01,多个用逗号隔开) */
    private String special_days;

    public TTInfo() {}
    public TTInfo(Object id, Object xlid, Object name, Object nds, Object sds) {
        if (id != null) {
            this.id = Long.parseLong(id.toString());
        }
        if (xlid != null) {
            this.xl = new Line();
            this.xl.setId(Integer.valueOf(xlid.toString()));
        }
        if (name != null) {
            this.name = String.valueOf(name);
        }
        if (nds != null) {
            this.rule_days = String.valueOf(nds);
        }
        if (sds != null) {
            this.special_days = String.valueOf(sds);
        }
    }

    public Long getId() {
        return id;
    }

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

    public Line getXl() {
        return xl;
    }

    public void setXl(Line xl) {
        this.xl = xl;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getXlDir() {
        return xlDir;
    }

    public void setXlDir(String xlDir) {
        this.xlDir = xlDir;
    }

    public Date getQyrq() {
        return qyrq;
    }

    public void setQyrq(Date qyrq) {
        this.qyrq = qyrq;
    }

    public String getTemplateType() {
        return templateType;
    }

    public void setTemplateType(String templateType) {
        this.templateType = templateType;
    }

    public Boolean getIsEnableDisTemplate() {
        return isEnableDisTemplate;
    }

    public void setIsEnableDisTemplate(Boolean isEnableDisTemplate) {
        this.isEnableDisTemplate = isEnableDisTemplate;
    }

    public int getLpCount() {
        return lpCount;
    }

    public void setLpCount(int lpCount) {
        this.lpCount = lpCount;
    }

    public int getLoopCount() {
        return loopCount;
    }

    public void setLoopCount(int loopCount) {
        this.loopCount = loopCount;
    }

    public String getRule_days() {
        return rule_days;
    }

    public void setRule_days(String rule_days) {
        this.rule_days = rule_days;
    }

    public String getSpecial_days() {
        return special_days;
    }

    public void setSpecial_days(String special_days) {
        this.special_days = special_days;
    }

    public Boolean getIsCancel() {
        return isCancel;
    }

    public void setIsCancel(Boolean isCancel) {
        this.isCancel = isCancel;
    }
}