package cn.estsh.i3plus.pojo.platform.bean;

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @Description : 短信模板
 * @Reference :
 * @Author : yunhao
 * @CreateDate : 2020-12-13 16:11
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "SYS_SMS_TEMPLATE")
@ApiModel(value = "短信模板", description = "短信模板")
public class SysSmsTemplate extends BaseBean {

    private static final long serialVersionUID = -3879367761511016412L;

    /**
     * 模板名称
     */
    @Column(name = "TEMPLATE_NAME")
    @ApiModelProperty(value = "模板名称")
    private String templateName;

    /**
     * 模板代码
     */
    @Column(name = "TEMPLATE_CODE")
    @ApiModelProperty(value = "模板代码")
    private String templateCode;

    /**
     * 模板代码
     */
    @Column(name = "SUPPLIER_TEMPLATE_CODE")
    @ApiModelProperty(value = "供应商模板代码")
    private String supplierTemplateCode;

    /**
     * 模板类型
     */
    @AnnoOutputColumn
    @Column(name = "TEMPLATE_TYPE")
    @ApiModelProperty(value = "模板类型")
    private Integer templateType;

    /**
     * 供应商类型
     */
    @AnnoOutputColumn(refClass = ImppEnumUtil.SMS_SUPPLIER.class)
    @Column(name = "SUPPLIER_TYPE")
    @ApiModelProperty(value = "供应商类型")
    private Integer supplierType;

    public String getSupplierTypeTxt() {
        return supplierType == null ? null : ImppEnumUtil.SMS_SUPPLIER.valueOfDescription(supplierType);
    }

    /**
     * 模板状态
     */
    @Column(name = "TEMPLATE_STATUS")
    @ApiModelProperty(value = "模板状态")
    @AnnoOutputColumn(refClass = ImppEnumUtil.SMS_TEMPLATE_STATUS.class)
    private Integer templateStatus;

    public String getTemplateStatusTxt() {
        return templateStatus == null ? null : ImppEnumUtil.SMS_TEMPLATE_STATUS.valueOfDescription(templateStatus);
    }

    /**
     * 模板内容
     */
    @Column(name = "TEMPLATE_CONTENT")
    @ApiModelProperty(value = "模板内容")
    private String templateContent;

    /**
     * 模板描述
     */
    @Column(name = "TEMPLATE_DESC")
    @ApiModelProperty(value = "模板描述")
    private String templateDesc;


    /**
     * 是否修改模板内容
     */
    @Transient
    @ApiModelProperty(value = "是否修改模板内容")
    private Integer isModifyContent;

    /**
     * 审批备注
     */
    @Transient
    @ApiModelProperty(value = "审批备注")
    private String reason;

}
