package com.keyware.shandan.mark.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.keyware.shandan.common.entity.BaseEntity;
import com.keyware.shandan.mark.constant.MarkInsertType;
import lombok.*;

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

/**
 * 置标类型
 *
 * @author GuoXin
 * @date 2022-05-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@TableName("MARK_TYPE")
public class MarkType extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 4959172649237803537L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 置标类型
     */
    @TableField(value = "MARK_TYPE", condition = SqlCondition.LIKE)
    private String markType;

    /**
     * 置标类型默认值
     */
    @TableField("MARK_DEFAULT")
    private String markDefault;

    /**
     * 入库方式:管理员录入，自动置标文件
     */
    @TableField("INSERT_TYPE")
    private MarkInsertType insertType;

    @TableField(exist = false)
    private String insertTypeStr;
    @TableField(exist = false)
    private String createUserStr;

    public MarkType(String markType, String markDefault) {
        this.markType = markType;
        this.markDefault = markDefault;
    }

    public String getInsertTypeStr(){
        return insertType == null ? "" : insertType.getDesc();
    }
}
