package com.rf.psychological.wxpay.model;

import com.rf.psychological.base.model.BaseEntity;
import lombok.*;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @Description:订单信息
 * @Author: zsf
 * @Date: 2022/6/21
 */
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper=false)
@Table(name = "t_order_info")
@org.hibernate.annotations.Table(appliesTo = "t_order_info", comment = "订单信息表")
@DynamicUpdate(value = true)
public class OrderInfo extends BaseEntity {

    @Column(name = "title", columnDefinition = "varchar(100) comment '订单标题'")
    private String title;//订单标题

    @Column(name = "order_no", columnDefinition = "varchar(50) comment '商户订单编号'")
    private String orderNo;//商户订单编号

    @Column(name = "user_id", columnDefinition = "varchar(36) comment '用户id'")
    private String userId;//用户id

    @Column(name = "product_id", columnDefinition = "varchar(36) comment '量表产品id'")
    private String productId;//量表id

    @Column(name = "result_id", columnDefinition = "varchar(36) comment '报告结果id'")
    private String resultId;//报告结果id

    @Column(name = "total_fee", columnDefinition = "int(11) comment '订单金额(分)'")
    private Integer totalFee;//订单金额(分)

    @Column(name = "code_url", columnDefinition = "text comment '订单二维码连接,小程序支付时未调起小程序所需参数'")
    private String codeUrl;//订单二维码连接

    @Column(name = "order_status", columnDefinition = "varchar(20) comment '订单状态'")
    private String orderStatus;//订单状态

    @Column(name = "trade_type", columnDefinition = "varchar(20) comment '交易类型'")
    private String tradeType;//交易类型

    @Column(name = "create_time", columnDefinition = "varchar(20) comment '创建时间'")
    private String createTime;//创建时间

    @Column(name = "update_time", columnDefinition = "varchar(20) comment '更新时间'")
    private String updateTime;//更新时间

    @Transient
    private String desc;
}
