package com.cn.domain; // 定义类的包名

import java.sql.Timestamp; // 导入Timestamp类，用于处理日期和时间

/**
 * 车次信息的实体类
 * @ClassName: Train
 * @Description: 车次信息的实体类
 * @author: ljy
 * @date: 2019年9月1日 下午1:23:31
 */
public class Train {
    // 序号
    private Integer trainId;
    // 车次
    private String trainNumber;
    // 起始站
    private String startStation;
    // 终点站
    private String endStation;
    // 开车时间
    private String startTime;
    // 到站时间
    private String endTime;
    // 车票价格
    private Integer price;
    // 座位数量
    private Integer seatNumber;
    // 添加日期
    private Timestamp addTime;

    // 获取序号
    public Integer getTrainId() {
        return trainId;
    }

    // 设置序号
    public void setTrainId(Integer trainId) {
        this.trainId = trainId;
    }

    // 获取车次
    public String getTrainNumber() {
        return trainNumber;
    }

    // 设置车次
    public void setTrainNumber(String trainNumber) {
        this.trainNumber = trainNumber;
    }

    // 获取起始站
    public String getStartStation() {
        return startStation;
    }

    // 设置起始站
    public void setStartStation(String startStation) {
        this.startStation = startStation;
    }

    // 获取终点站
    public String getEndStation() {
        return endStation;
    }

    // 设置终点站
    public void setEndStation(String endStation) {
        this.endStation = endStation;
    }

    // 获取开车时间
    public String getStartTime() {
        return startTime;
    }

    // 设置开车时间
    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    // 获取到站时间
    public String getEndTime() {
        return endTime;
    }

    // 设置到站时间
    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    // 获取车票价格
    public Integer getPrice() {
        return price;
    }

    // 设置车票价格
    public void setPrice(Integer price) {
        this.price = price;
    }

    // 获取座位数量
    public Integer getSeatNumber() {
        return seatNumber;
    }

    // 设置座位数量
    public void setSeatNumber(Integer seatNumber) {
        this.seatNumber = seatNumber;
    }

    // 获取添加日期
    public Timestamp getAddTime() {
        return addTime;
    }

    // 设置添加日期
    public void setAddTime(Timestamp addTime) {
        this.addTime = addTime;
    }

    // 构造函数，包含所有属性
    public Train(Integer trainId, String trainNumber, String startStation, String endStation, String startTime,
            String endTime, Integer price, Integer seatNumber, Timestamp addTime) {
        this.trainId = trainId;
        this.trainNumber = trainNumber;
        this.startStation = startStation;
        this.endStation = endStation;
        this.startTime = startTime;
        this.endTime = endTime;
        this.price = price;
        this.seatNumber = seatNumber;
        this.addTime = addTime;
    }

    // 构造函数，不包含trainId
    public Train(String trainNumber, String startStation, String endStation, String startTime, String endTime,
            Integer price, Integer seatNumber, Timestamp addTime) {
        this.trainNumber = trainNumber;
        this.startStation = startStation;
        this.endStation = endStation;
        this.startTime = startTime;
        this.endTime = endTime;
        this.price = price;
        this.seatNumber = seatNumber;
        this.addTime = addTime;
    }

    // 无参构造函数
    public Train() {
    }

    // 返回Train对象的字符串表示形式
    @Override
    public String toString() {
        return "Train [trainId=" + trainId + ", trainNumber=" + trainNumber + ", startStation=" + startStation
                + ", endStation=" + endStation + ", startTime=" + startTime + ", endTime=" + endTime + ", price="
                + price + ", seatNumber=" + seatNumber + ", addTime=" + addTime + "]";
    }
}
