peng
2026-03-24 ca41db25ab3da9ddd509b79fd783b60d2e66056f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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;
 
/**
 * <p>
 * 巡查事件表
 * </p>
 *
 * @author
 * @since 2023-08-15
 */
@Data
@Accessors(chain = true)
@TableName("t_patrol_event")
@Schema(name = "PatrolEvent", description = "巡查事件表")
@S3DataParse
public class PatrolEvent extends Model<PatrolEvent> {
 
    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;
    }
}