package com.cyksj.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.SearchBean;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author chan
 * @date 2022/12/6 4:07 PM
 */
@Getter
@Setter
@SearchBean(tables = "goods_don_stock s, goods_don_stock_record r ",
            where = "s.id = r.stock_id and r.is_undo is false"
)
public class GoodsDonStockRecord extends BaseEntity{

    @DbField("s.id")
    private Long stockId;

    @DbField("r.id")
    @TableField(exist = false)
    private Long recordId;

    @DbField("s.title")
    @TableField(exist = false)
    private String title;

    @DbField("r.then_total")
    private Integer thenTotal;

    /**
     * put
     * out
     * clean
     * refund
     * transport
     */
    @DbField("r.type")
    private String type;

    @DbField("r.num")
    private Integer num;

    @DbField("r.available")
    private Integer available;

    @DbField("r.price")
    private BigDecimal price;

    @DbField("r.remark")
    private String remark;

    @DbField("r.voucher")
    private String voucher;

    /**
     * 创建时间
     */
    @DbField("r.created_time")
    @TableField(exist = false)
    private Date recordCreatedTime;

    /**
     * 是否撤销 默认否
     */
    @DbField("r.is_undo")
    private Boolean isUndo;
}
