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

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * @Description : 推送信息配置
 * @Reference :
 * @Author : gcj
 * @CreateDate : 2020-01-06 15:58
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "WMS_PUSH_CONFIG")
@Api("推送配置")
public class WmsPushConfig extends BaseBean{

    private static final long serialVersionUID = 2701710669030092153L;
    @ApiParam("推送名称")
    @Column(name = "PUSH_NAME")
    private String pushName;

    @ApiParam("规则表达式")
    @Column(name = "QUARTZ_CRON")
    private String quartzCron;

    @ApiParam("末次执行时间")
    @Column(name = "LAST_EXE_TIME")
    private String lastExeTime;

    @ApiParam("下次执行时间")
    @Column(name = "NEXT_EXE_TIME")
    private String nextExeTime;

    @ApiParam("序号")
    @Column(name = "SERIAL_NUMBER")
    private Integer serialNumber;

    @Lob
    @ApiParam("查询Hql")
    @Column(name = "HQL_STR", columnDefinition = "TEXT")
    private String hqlStr;

    @Lob
    @ApiParam("查询Sql")
    @Column(name = "SQL_STR", columnDefinition = "TEXT")
    private String sqlStr;

    @ApiParam("数据获取脚本编号")
    @Column(name = "SCRIPT_NO")
    private String scriptNo;

    @ApiParam("脚本入参")
    @Column(name = "SCRIPT_PARAM")
    private String scriptParam;

    @ApiParam("附件脚本编号")
    @Column(name = "ATTACH_SCRIPT_NO")
    private String attachScriptNo;

    @Lob
    @ApiParam("标题模板")
    @Column(name = "TITLE_TEMPLATE", columnDefinition = "TEXT")
    private String titleTemplate;

    @Lob
    @ApiParam("消息体模板")
    @Column(name = "CONTENT_TEMPLATE", columnDefinition = "TEXT")
    private String contentTemplate;

    @ApiParam("推送类型")
    @Column(name = "PUSH_TYPE")
    private Integer pushType;

    @ApiParam("描述")
    @Column(name = "REMARK")
    private String remark;

    @ApiParam("推送地址")
    @Column(name ="PATH_URL")
    private String pathUrl;

    @ApiParam("头标签")
    @Column(name = "TITLE_LABEL")
    private String titleLabel;

    @ApiParam("内容标签")
    @Column(name = "CONTENT_LABEL")
    private String contentLabel;

    // 临时存储
    @ApiParam("附件的文件路径")
    @Transient
    private String attachFilePath;
}
