package cn.pluss.platform.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 商户设备订单退款图片表
 * </p>
 *
 * @author crystal
 * @since 2022-03-31
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@NoArgsConstructor
@TableName("tb_pluss_merc_device_refund_image")
public class MercDeviceRefundImage implements Serializable {

    private static final long serialVersionUID = 1L;

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


    /**
     * 用户ID
     */
    @TableField("userId")
    private Long userId;


    /**
     * 图片url
     */
    @TableField("picUrl")
    private String picUrl;


    /**
     * 设备详情表ID
     */
    @TableField("detailId")
    private Long detailId;


    /**
     * 订单号
     */
    @TableField("orderNo")
    private String orderNo;


    /**
     * 创建时间
     */
    @TableField(value = "createTime", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 创建时间 开始时间
     */
    @TableField(exist = false, condition = "createTime &gt; #{%s}")
    private Date createTimeStart;

    /**
     * 创建时间 截止时间
     */
    @TableField(exist = false, condition = "createTime &lt; #{%s}")
    private Date createTimeEnd;

    public MercDeviceRefundImage(MercOrderDetail detail, String picUrl) {
        this.userId = detail.getUserId();
        this.picUrl = picUrl;
        this.detailId = detail.getId();
        this.orderNo = detail.getOrderNo();
    }
}