liusuyi
2026-06-01 a2e7e8ff9cfaa69b001d483710bddbda50d55c91
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
package com.ard.qs.api.domain;
 
import com.ard.common.core.utils.DateUtils;
import com.ard.common.core.web.domain.BaseEntity;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
 
/**
 * 区域
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class QsRegion extends BaseEntity implements Comparable<QsRegion> {
    /**
     * 数据库自增ID
     */
    private int id;
 
    /**
     * 区域国标编号
     */
    private String deviceId;
 
    /**
     * 区域名称
     */
    private String name;
 
    /**
     * 父区域国标ID
     */
    private Integer parentId;
 
    /**
     * 父区域国标ID
     */
    private String parentDeviceId;
 
    @Override
    public int compareTo(@NotNull QsRegion qsRegion) {
        return Integer.compare(Integer.parseInt(this.deviceId), Integer.parseInt(qsRegion.getDeviceId()));
    }
 
    public static QsRegion getInstance(String commonRegionDeviceId, String commonRegionName, String commonRegionParentId) {
        QsRegion region = new QsRegion();
        region.setDeviceId(commonRegionDeviceId);
        region.setName(commonRegionName);
        region.setParentDeviceId(commonRegionParentId);
        region.setCreateTime(DateUtils.getNowDate());
        region.setUpdateTime(DateUtils.getNowDate());
        return region;
    }
}