package com.yida.data.common.core.entity.telephone;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

import lombok.Data;

/**
 * 亲情电话-充值订单 Entity
 *
 * @author zhanghaijun
 * @date 2021-08-10 17:00:48
 */
@Data
@TableName("edu_telephone_order")
public class EduTelephoneOrder {


    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField(value = "create_date", fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDate;

    @TableField(value = "create_id", fill = FieldFill.INSERT)
    private Long createId;

    @TableField(value = "update_date", fill = FieldFill.UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateDate;

    @TableField(value = "update_id", fill = FieldFill.UPDATE)
    private Long updateId;

    /**
     * 订单编号:snowflake算法原理生成
     */
    @TableField("order_no")
    private String orderNo;

    /**
     * 学生id
     */
    @TableField("student_id")
    private Long studentId;

    /**
     * 学生名称
     */
    @TableField("student_name")
    private String studentName;

    /**
     * 学生卡id
     */
    @TableField("card_id")
    private Long cardId;

    /**
     * 学生卡号
     */
    @TableField("card_no")
    private String cardNo;

    /**
     * 学校id
     */
    @TableField("school_id")
    private Long schoolId;

    /**
     * 学生卡号
     */
    @TableField("school_name")
    private String schoolName;
    /**
     * 充值金额
     */
    @TableField("money")
    private Double money;

    /**
     * 充值后余额
     */
    @TableField("after_balance")
    private Double afterBalance;
    /**
     * 订单状态：0：待付款\r\n1：付款中\r\n2：交易完成（正常支付成功）\r\n3：待退款\r\n4：交易关闭（a:超时未支付,b:退款成功
     */
    @TableField("order_status")
    private Integer orderStatus;

    /**
     * 支付人手机号
     */
    @TableField("pay_phone")
    private String payPhone;

    /**
     * 支付人关系
     */
    @TableField("pay_relation")
    private String payRelation;

    /**
     * 支付时间
     */
    @TableField("pay_date")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime payDate;
}