package com.yihu.jw.entity.order;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;

/**
 * 业务订单表
 */
@Entity
@Table(name = "base_business_order_pay")
@SequenceGenerator(name="id_generated", sequenceName="SEQ_BASE_BUSINESS_ORDER_PAY")
public class BusinessOrderDO extends IntegerIdentityEntity {

    private String patient;//居民code
    private String patientName;//居民名字
    private String orderNo;//订单号
    /**
     *  互联网医院-订单类型订单类型：目前只能1表示图文，3表示视频大类细分如下：专家咨询：1图文咨询 |2电话咨询|3视频咨询|4免费义诊图文诊室：1图文复诊视频诊室：3视频复诊| 5社区协同
     *  医养项目 订单类型 1 新生儿托幼
     */
    private Integer orderType;
    /**
     * 互联网医院- 1：专家咨询|2：图文诊室|3：视频诊室|4处方结算|5就诊卡充值)
     * 医养项目 订单分类 orderType=1 时 1招生，2 课程，3 上门辅导托幼) 4 生活照料
     */
    private String orderCategory;
    private String relationCode;//业务关联code
    private String relationName;//业务关联名称
    private String description;//支付备注
    private String remark;//病人描述
    private Integer payType;//支付类型1微信2支付宝3易联众支付
    private Double payPrice;//支付金额
    private Date payTime;//支付时间
    private String doctor;//医生code
    //医养支付状态 0待支付、1已支付、2已取消、3申请退款中、4已售后
    private Integer status;//0待支付1支付成功2支付失败3取消
    private String pcCallbackUrl;//Pc端查看当前订单的会话信息
    private String appCallbackUrl;//App端查看当前订单的会话信息
    private Integer uploadStatus;//上传状态1上传0未上传
    private Date createTime;
    private String createUser;
    private String createUserName;
    private Date updateTime;
    private String updateUser;
    private String updateUserName;
    private String ykOrderNo;
    private String ykOrderId;
    private String traceNo;//支付平台的订单号
    private Long lastPayTime;//订单截至支付日期 13位时间戳
    private String historyOrder;
    @Column(name = "history_order")
    public String getHistoryOrder() {
        return historyOrder;
    }

    public void setHistoryOrder(String historyOrder) {
        this.historyOrder = historyOrder;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time", nullable = false, length = 0,updatable = false)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Column(name = "create_user",updatable = false)
    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    @Column(name = "create_user_name",updatable = false)
    public String getCreateUserName() {
        return createUserName;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "update_time", nullable = false, length = 0)
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Column(name = "update_user")
    public String getUpdateUser() {
        return updateUser;
    }


    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    @Column(name = "update_user_name")
    public String getUpdateUserName() {
        return updateUserName;
    }

    public void setUpdateUserName(String updateUserName) {
        this.updateUserName = updateUserName;
    }

    @Column(name = "order_no")
    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {

        this.orderNo = orderNo;
    }

    @Column(name = "order_type")
    public Integer getOrderType() {
        return orderType;
    }

    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }

    @Column(name = "relation_code")
    public String getRelationCode() {
        return relationCode;
    }

    public void setRelationCode(String relationCode) {
        this.relationCode = relationCode;
    }

    @Column(name = "relation_name")
    public String getRelationName() {
        return relationName;
    }

    public void setRelationName(String relationName) {
        this.relationName = relationName;
    }

    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Column(name = "pay_type")
    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    @Column(name = "pay_price")
    public Double getPayPrice() {
        return payPrice;
    }

    public void setPayPrice(Double payPrice) {
        this.payPrice = payPrice;
    }

    @Column(name = "description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }


    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }

    public void setPatient(String patient) {
        this.patient = patient;
    }

    @Column(name = "patient_name")
    public String getPatientName() {
        return patientName;
    }

    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "pay_time")
    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    @Column(name = "doctor")
    public String getDoctor() {
        return doctor;
    }

    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }

    @Column(name = "order_category")
    public String getOrderCategory() {
        return orderCategory;
    }

    public void setOrderCategory(String orderCategory) {
        this.orderCategory = orderCategory;
    }

    @Column(name = "pc_callback_url")
    public String getPcCallbackUrl() {
        return pcCallbackUrl;
    }

    public void setPcCallbackUrl(String pcCallbackUrl) {
        this.pcCallbackUrl = pcCallbackUrl;
    }

    @Column(name = "app_callback_url")
    public String getAppCallbackUrl() {
        return appCallbackUrl;
    }

    public void setAppCallbackUrl(String appCallbackUrl) {
        this.appCallbackUrl = appCallbackUrl;
    }

    @Column(name = "upload_status")
    public Integer getUploadStatus() {
        return uploadStatus;
    }

    public void setUploadStatus(Integer uploadStatus) {
        this.uploadStatus = uploadStatus;
    }

    @Column(name = "remark")
    public String getRematk() {
        return remark;
    }

    public void setRematk(String remark) {
        this.remark = remark;
    }

    @Column(name = "yk_order_no")
    public String getYkOrderNo() {
        return ykOrderNo;
    }

    public void setYkOrderNo(String ykOrderNo) {
        this.ykOrderNo = ykOrderNo;
    }

    @Column(name = "yk_order_id")
    public String getYkOrderId() {
        return ykOrderId;
    }

    public void setYkOrderId(String ykOrderId) {
        this.ykOrderId = ykOrderId;
    }

    @Column(name = "trace_no")
    public String getTraceNo() {
        return traceNo;
    }

    public void setTraceNo(String traceNo) {
        this.traceNo = traceNo;
    }

    public Long getLastPayTime() {
        return lastPayTime;
    }

    public void setLastPayTime(Long lastPayTime) {
        this.lastPayTime = lastPayTime;
    }
}
