package cn.pluss.platform.entity;

import com.alibaba.fastjson.annotation.JSONField;
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 lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_pluss_merc_order_express")
public class MercOrderExpress {

    public final static String EXPRESS_TYPE_HAIR = "01";

    public final static String EXPRESS_TYPE_COLLECT = "02";

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

    @TableField("orderNo")
    private String orderNo;

    @TableField("logistNo")
    private String logistNo;

    @TableField("expressNo")
    private String expressNo;

    @TableField("type")
    private String type;

    /**
     * 物流状态 00:待发货 01:已接单 02：已揽收 03：已收入  04：已发出 05：已打包 06：派件中 07：自提柜入库 08：已签收 90：揽收失败 99：签收失败
     */
    @TableField("status")
    private String status;

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

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

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


    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 更新时间 开始时间
     */
    @TableField(exist = false, condition = "updateTime &gt; #{%s}")
    private Date updateTimeStart;

    /**
     * 更新时间 截止时间
     */
    @TableField(exist = false, condition = "updateTime &lt; #{%s}")
    private Date updateTimeEnd;

}
