package cn.pluss.platform.entity;

import cn.pluss.platform.config.mybatis.SqlConditionExtra;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

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

/**
 * <p>
 * 设备商品展示表
 * </p>
 *
 * @author Djh
 * @since 2020-11-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_pluss_device_goods")
public class DeviceGoods implements Serializable {

    private static final long serialVersionUID = 1L;

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


    /**
     * 设备商品code
     */
    @TableField("code")
    private String code;

    @TableField(exist = false)
    private String codeName;

    /**
     * 设备商品名称
     */
    @TableField(value = "name",whereStrategy = FieldStrategy.NOT_EMPTY,condition = SqlCondition.LIKE)
    private String name;


    @TableField("deviceLogo")
    private String deviceLogo;


    /**
     * 简介
     */
    @TableField("introDesc")
    private String introDesc;


    /**
     * 排序
     */
    @TableField("sort")
    private Integer sort;

    /**
     * 详情
     */
    @TableField("detail")
    private String detail;


    @TableField("tagId")
    private Integer tagId;

    @TableField(exist = false)
    private String tag;

    /**
     * 状态   是否显示  0 不显示  1 显示
     */
    @TableField(value = "status",whereStrategy = FieldStrategy.NOT_EMPTY)
    private Integer status;


    /**
     * 押金购买标识，1：可以押金购买
     */
    @TableField(value = "depositFlag")
    private String depositFlag;


    /**
     * 创建时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd hh:mm:ss")
    @TableField(value = "createTime", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 创建时间 开始时间
     */
    @TableField(select = false, value = "createTime", condition = SqlConditionExtra.GT)
    private Date createTimeStart;

    /**
     * 创建时间 截止时间
     */
    @TableField(select = false, value = "createTime", condition = SqlConditionExtra.LT)
    private Date createTimeEnd;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd hh:mm:ss")
    @TableField(value = "updateTime", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /**
     * 更新时间 开始时间
     */
    @TableField(select = false, value = "updateTime", condition = SqlConditionExtra.GT)
    private Date updateTimeStart;

    /**
     * 更新时间 截止时间
     */
    @TableField(select = false, value = "updateTime", condition = SqlConditionExtra.LT)
    private Date updateTimeEnd;

}