package com.rf.psychological.wxpay.model;

import com.rf.psychological.base.model.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicUpdate;

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

/**
 * @Description:量表和认知任务促销价格表
 * @Author: zsf
 * @Date: 2022/6/29
 */
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper=false)
@Table(name = "t_promotion_info")
@org.hibernate.annotations.Table(appliesTo = "t_promotion_info", comment = "量表和认知任务促销价格表")
@DynamicUpdate(value = true)
public class PromotionInfo extends BaseEntity {

    @Column(name = "subject_id", columnDefinition = "varchar(36) comment '量表/认知任务id'")
    private  String subjectId;//量表/认知任务id
    @Column(name = "name", columnDefinition = "varchar(255) comment '量表/认知任务名称'")
    private  String name;//量表/认知任务名称

    @Column(name = "price", columnDefinition = "DECIMAL(20,2) comment '价格'")
    private  double price;//价格

    @Column(name = "promotion_end_time", columnDefinition = "DATETIME(6) comment '促销结束时间'")
    private String promotionEndTime;//促销结束时间

    @Column(name = "promotion_price", columnDefinition = "DECIMAL(20,2) comment '促销价格'")
    private  double promotionPrice;//促销价格

    @Column(name = "promotion_start_time", columnDefinition = "DATETIME(6) comment '促销开始时间'")
    private Date promotionStartTime;//促销开始时间


    @Column(name = "promotion_num", columnDefinition = "int comment '促销数量'")
    private  int promotionNum=0;

    @Column(name = "promotionType", columnDefinition = "varchar(10) comment '促销类型：0->没有促销使用原价;1->使用促销价；2->限时购'")
    private  String promotion_type;//促销类型：0->没有促销使用原价;1->使用促销价；2->限时购

    @Column(name = "type", columnDefinition = "varchar(10) comment '类型：0-量表；1-认知任务'")
    private  String type;//量表类型

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

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

    @Column(name = "flag", columnDefinition = "varchar(50) comment '量表或认知任务唯一标识'")
    private String flag;

    @Transient
    private int residueNum;
}
