package com.qmth.distributed.print.business.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.distributed.print.business.enums.TemplateTypeEnum;
import com.qmth.teachcloud.common.base.BaseEntity;
import com.qmth.teachcloud.common.enums.ClassifyEnum;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 通用模板
 * </p>
 *
 * @author xf
 * @since 2021-03-23
 */
@TableName("basic_template")
public class BasicTemplate extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "学校id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField("school_id")
    private Long schoolId;

    @ApiModelProperty(value = "机构id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "org_id", updateStrategy = FieldStrategy.IGNORED)
    private Long orgId;

    /**
     * 模板名称
     */
    private String name;
    /**
     * 模板类型：GENERIC-通卡模板，VARIABLE-变量印品模板，ORDINARY-普通印品模板
     */
    private TemplateTypeEnum type;
    /**
     * template_type值为VARIABLE、ORDINARY时，不为空。
     * SIGN-签到表，PACKAGE-卷袋贴，CHECK_IN-登记表
     */
    private ClassifyEnum classify;
    /**
     * 模板附件ID（保存到附件表ID）
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField("attachment_id")
    private Long attachmentId;
    /**
     * 0-禁用，1-启用
     */
    private Boolean enable = true;
    /**
     * 备注
     */
    private String remark;

    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(exist = false)
    private Long[] orgIds;

    @TableField(exist = false)
    private String url;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(Long schoolId) {
        this.schoolId = schoolId;
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public TemplateTypeEnum getType() {
        return type;
    }

    public void setType(TemplateTypeEnum type) {
        this.type = type;
    }

    public ClassifyEnum getClassify() {
        return classify;
    }

    public void setClassify(ClassifyEnum classify) {
        this.classify = classify;
    }

    public Long getAttachmentId() {
        return attachmentId;
    }

    public void setAttachmentId(Long attachmentId) {
        this.attachmentId = attachmentId;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Long[] getOrgIds() {
        return orgIds;
    }

    public void setOrgIds(Long[] orgIds) {
        this.orgIds = orgIds;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }
}
