package com.tievd.jyz.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.tievd.cube.commons.annotations.Dict;
import com.tievd.jyz.constants.SystemConstant;
import com.tievd.jyz.plugin.S3DataParse;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.sql.Timestamp;
/**
*
* 巡查事件表
*
*
* @author
* @since 2023-08-15
*/
@Data
@Accessors(chain = true)
@TableName("t_patrol_event")
@Schema(name = "PatrolEvent", description = "巡查事件表")
@S3DataParse
public class PatrolEvent extends Model {
private static final long serialVersionUID = 1L;
@Schema(description = "主键")
@TableId("id")
private Long id;
@Schema(description = "所属巡查记录id")
@TableField("record_id")
private Long recordId;
@Schema(description = "ai分析结果 1合规 2异常")
@TableField("event_type")
private Byte eventType;
@Schema(description = "区域 1卸油区 2加油区 3便利店")
@TableField("event_address")
@Dict(SystemConstant.DICT_INSTALL_ADDRESS)
private Byte eventAddress;
@Schema(description = "事件时间")
@TableField("event_time")
private Timestamp eventTime;
@Schema(description = "算法类型")
@TableField("algorithm_code")
private String algorithmCode;
@Schema(description = "算法类型名")
@TableField("algorithm_name")
private String algorithmName;
@Schema(description = "得分")
@TableField("score")
private Byte score;
@Schema(description = "执行人数")
@TableField("person_count")
private Byte personCount;
@Schema(description = "视频设备code")
@TableField("camera_code")
private String cameraCode;
@Schema(description = "视频设备名称")
@TableField("camera_name")
private String cameraName;
@Schema(description = "设备id")
@TableField("device_id")
private Long deviceId;
@Schema(description = "网关设备名称")
@TableField("device_name")
private String deviceName;
@Schema(description = "机构代码")
@TableField("org_code")
private String orgCode;
@Schema(description = "机构")
@TableField("org_name")
private String orgName;
@Schema(description = "告警图片唯一标识")
@TableField("img_uid")
private String imgUid;
@Schema(description = "关联图片")
@TableField("img_path")
@S3DataParse
private String imgPath;
@Schema(description = "关联视频")
@TableField("video_path")
@S3DataParse
private String videoPath;
@Schema(description = "审核用户id")
@TableField("audit_user")
private String auditUser;
@Schema(description = "审核结果1合格,2不合格, 0未处理")
@TableField("audit_result")
@Dict(SystemConstant.DICT_AUDIT_RESULT)
private Byte auditResult;
@Schema(description = "审核意见")
@TableField("audit_comment")
private String auditComment;
@Schema(description = "审核时间")
@TableField("audit_time")
private Timestamp auditTime;
@Schema(description = "创建时间")
@TableField("create_time")
private Timestamp createTime;
public PatrolEvent setEventTimefAbsent(Timestamp eventTime) {
if (this.eventTime == null) {
this.eventTime = eventTime;
}
return this;
}
public PatrolEvent setImgUidIfAbsent(String imgUid) {
if (this.imgPath == null || this.imgPath == "") {
this.imgUid = imgUid;
}
return this;
}
@Override
public Serializable pkVal() {
return this.id;
}
}