package com.bohuikeji.delivery.backstage.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.bohuikeji.frame.module.admin.annotation.TableQueryField;
import com.bohuikeji.frame.module.admin.base.EntityBase;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.bohuikeji.frame.module.admin.annotation.TableShowField;
import com.bohuikeji.frame.module.admin.annotation.TableNewField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 仓库信息表
 * </p>
 *
 * @author 10552
 * @since 2019-08-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="TWarehouse对象", description="仓库信息表")
@TableName("t_warehouse")
public class TWarehouse extends EntityBase<TWarehouse> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "仓库id")
    @TableId(value = "warehouse_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField(show = false)
    private Integer warehouseId;

    @ApiModelProperty(value = "仓库名称")
    @TableField("warehouse_name")
    @TableQueryField
    @TableShowField(value = "仓库名称")
    @TableNewField
    private String warehouseName;

    @ApiModelProperty(value = "货架数量")
    @TableField("shelves_quantity")
    @TableShowField("货架数量")
    @TableNewField
    @TableQueryField
    private Integer shelvesQuantity;

    @ApiModelProperty(value = "使用数量")
    @TableField("use_quantity")
    @TableShowField("使用数量")
    @TableNewField
    @TableQueryField
    private Integer useQuantity;

    @ApiModelProperty(value = "剩余数量")
    @TableField("residual_quantity")
    @TableShowField("剩余数量")
    @TableNewField
    private Integer residualQuantity=shelvesQuantity-useQuantity;

    @ApiModelProperty(value = "仓库状态")
    @TableField("warehouse_status")
    @TableShowField("仓库状态")
    @TableNewField
    @TableQueryField
    private String warehouseStatus;

    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    @TableShowField("更新时间")
    @TableNewField
    private LocalDateTime updateTime;


}
