Newer
Older
huludao / src / main / java / com / newfiber / api / pc / model / entity / ProSiteWarnEntity.java
package com.newfiber.api.pc.model.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.newfiber.api.core.base.BaseDomain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
 * @author : zhangjun
 * @Project_name:newfiber_haimian_cihu
 * @date:2020/4/23 17:43
 * @email:505724729@qq.com
 * @description:警戒线配置表
 * @Exception: throw {todo}
 */
@Data
@TableName("pro_site_warn")
public class ProSiteWarnEntity extends BaseDomain {
    private static final long serialVersionUID = 1L;

    /** 主键 */
    @ApiModelProperty(value = "主键")
    @JsonSerialize(using= ToStringSerializer.class)
    @TableId(type = IdType.AUTO)
    private Long id;
    /** 站点编号 */
    @ApiModelProperty(value = "站点编号")
    private String siteNo;
    /** 因子ASC码 */
    @ApiModelProperty(value = "因子ASC码")
    private String factorsAscii;
    /** 因子名称 */
    @ApiModelProperty(value = "因子名称")
    private String factorsName;
    /** 警戒线值 */
    @ApiModelProperty(value = "警戒线值")
    private BigDecimal warnValue;
    /** 警戒等级(1:预警,2:报警) */
    @ApiModelProperty(value = "警戒等级(1:预警,2:报警)")
    private Integer warnType;
    /** 警戒等级描述(1:预警,2:报警) */
    @ApiModelProperty(value = "警戒等级描述(1:预警,2:报警)")
    private String warnTypeDesc;
    /** 比较方式(>,<,=) */
    @ApiModelProperty(value = "比较方式(>,<,=)")
    private String compareWay;
    /** 比较方式描述(大于,小于,等于) */
    @ApiModelProperty(value = "比较方式描述(大于,小于,等于)")
    private String compareWayDesc;
    /** 创建时间 */
    @ApiModelProperty(value = "创建时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @TableField(exist = false)
    private String factorsUnit;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ProSiteWarnEntity that = (ProSiteWarnEntity) o;
        return siteNo.equals(that.siteNo) && warnType.equals(that.warnType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(siteNo, warnType);
    }
}