package com.liquidnet.service.kylin.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;
import java.io.Serializable;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 订单状态
 * </p>
 *
 * @author liquidnet
 * @since 2021-05-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class KylinOrderTicketStatus implements Serializable,Cloneable  {

    private static final long serialVersionUID = 1L;

    @TableId(value = "mid", type = IdType.AUTO)
    private Integer mid;

    /**
     * order_ticket_status_id
     */
    private String orderTicketStatusId;

    /**
     * 订单id
     */
    private String orderId;

    /**
     * 快递方式 1寄付 2到付
     */
    private Integer expressType;

    /**
     * 是否学生票 1是 2否
     */
    private Integer isStudent;

    /**
     *
     */
    private Integer transferStatus;

    /**
     * 订单状态:0待付款，1已付款，2已关闭，3正在退款，4已退款, 5待关闭 6部分退款
     */
    private Integer status;

    /**
     * 支付状态:0未支付 1已支付 2支付失败
     */
    private Integer payStatus;

    /**
     * 创建时间
     */
    private LocalDateTime createdAt;

    /**
     * 修改时间
     */
    private LocalDateTime updatedAt;

    /**
     * 获取 添加 数据库参数
     *
     * @return
     */
    public Object[] getAddObject() {
        return new Object[]{
                orderTicketStatusId, orderId, expressType, isStudent, transferStatus, status, payStatus, createdAt, updatedAt
        };
    }

    /**
     * 获取 支付回调 数据库参数
     *
     * @return
     */
    public Object[] getSynOrderObject(LocalDateTime updateTime,LocalDateTime createTime) {
        return new Object[]{
                status, payStatus, updatedAt, orderId,updateTime,createTime
        };
    }

    /**
     * 获取 支付回调 数据库参数
     *
     * @return
     */
    public Object[] getCloseOrderObject() {
        return new Object[]{
                status, updatedAt, orderId
        };
    }

    private static final KylinOrderTicketStatus obj = new KylinOrderTicketStatus();
    public static KylinOrderTicketStatus getNew() {
        try {
            return (KylinOrderTicketStatus) obj.clone();
        } catch (CloneNotSupportedException e) {
            return new KylinOrderTicketStatus();
        }
    }
}
