| | |
| | | package db |
| | | |
| | | import ( |
| | | "time" |
| | | type BuildingType int |
| | | |
| | | const ( |
| | | BuildingTypeResidential BuildingType = 1 //住宅楼 |
| | | BuildingTypeMixedUse BuildingType = 2 //商住楼 |
| | | BuildingTypePublicRental BuildingType = 3 //公租房 |
| | | BuildingTypeLowIncome BuildingType = 4 //廉租房 |
| | | BuildingTypeOldResidential BuildingType = 5 //老旧小区 |
| | | BuildingTypeOffice BuildingType = 6 //写字楼 |
| | | ) |
| | | |
| | | type PersonnelStatusRule struct { |
| | | ID int `gorm:"column:id"` |
| | | Name string `gorm:"column:name"` |
| | | DetectionCountStart int `gorm:"column:detectionCountStart"` |
| | | DetectionCountEnd int `gorm:"column:detectionCountEnd"` |
| | | DetectionDaysStart int `gorm:"column:detectionDaysStart"` |
| | | DetectionDaysEnd int `gorm:"column:detectionDaysEnd"` |
| | | Status string `gorm:"column:status"` |
| | | } |
| | | const ( |
| | | StatusStranger int = 1 |
| | | StatusVisitor int = 2 |
| | | StatusResident int = 3 |
| | | ) |
| | | |
| | | type AlarmRule struct { |
| | | RuleId string `json:"ruleId"` |
| | |
| | | TargetType string `json:"targetType"` |
| | | Floor string `json:"floor"` |
| | | } |
| | | |
| | | type BuildingType int |
| | | |
| | | const ( |
| | | BuildingTypeResidential BuildingType = 1 //住宅楼 |
| | | BuildingTypeMixedUse BuildingType = 2 //商住楼 |
| | | BuildingTypePublicRental BuildingType = 3 //公租房 |
| | | BuildingTypeLowIncome BuildingType = 4 //廉租房 |
| | | BuildingTypeOldResidential BuildingType = 5 //老旧小区 |
| | | BuildingTypeOffice BuildingType = 6 //写字楼 |
| | | ) |
| | | |
| | | type Device struct { |
| | | DeviceCode string `gorm:"column:deviceCode" json:"deviceCode" example:"J83762"` //设备编码 |
| | | AreaID string `json:"areaID" gorm:"index;column:communityID;type:varchar(299);"` //常住小区 domain unit ID |
| | | BuildingType BuildingType `gorm:"column:building_type;type:tinyint(1);not null;default:0" json:"buildingType"` //楼宇类型 |
| | | MaxBuildingFloor int `gorm:"column:max_building_floor;type:tinyint(1);not null;default:0" json:"maxBuildingFloor"` //最高楼层号 |
| | | } |
| | | |
| | | type Task struct { |
| | | Id int `gorm:"column:id"` |
| | | Name string `gorm:"name"` |
| | | } |
| | | |
| | | func (Task) TableName() string { |
| | | return "task" |
| | | } |
| | | |
| | | type MoveInout struct { |
| | | //RecordId int `gorm:"column:record_id"` |
| | | DocumentNumber string `gorm:"column:document_number"` |
| | | CommunityID string `gorm:"column:community_id"` |
| | | MoveInDate time.Time `gorm:"column:move_in_date"` |
| | | MoveOutDate *time.Time `gorm:"column:move_out_date"` |
| | | Status string `gorm:"column:status"` |
| | | MoveType string `gorm:"column:move_type"` |
| | | } |
| | | |
| | | func (MoveInout) TableName() string { |
| | | return "move_inout" |
| | | } |
| | | |
| | | type Resident struct { |
| | | CommunityId string `gorm:"column:community_id"` |
| | | DocumentNumber string `gorm:"column:document_number"` |
| | | LastAppearanceTime int64 `gorm:"column:last_appearance_time"` |
| | | CreateAt string `gorm:"column:create_at"` |
| | | } |
| | | |
| | | type PersonStatus struct { |
| | | Id uint `gorm:"column:id;primary_key;auto_increment;not null;"` |
| | | OrgId string `gorm:"column:org_id;type:varchar(299);not null;default:''"` // 派出所id |
| | | CommunityID string `gorm:"uniqueIndex:idx_document_number_community_id;index:community_id_last_appearance_time;column:community_id;type:varchar(299);not null;default:''"` // 小区id |
| | | DocumentNumber string `gorm:"uniqueIndex:idx_document_number_community_id;column:document_number;type:varchar(299);not null;default:''"` // 档案编号 |
| | | DaysAppeared int `gorm:"column:days_appeared;type:int(11);not null;default:0" json:"daysAppeared"` // 出现天数 |
| | | Count int `gorm:"column:count;type:int;not null;default:0"` // 抓拍次数 |
| | | Status string `gorm:"column:status;type:varchar(255);not null;default:''"` //标签 |
| | | LastAppearanceTime int64 `gorm:"index:community_id_last_appearance_time;column:last_appearance_time;type:int;not null;default:0" json:"lastAppearanceTime"` //最后出现时间 |
| | | LastAppearanceStatusTime int64 `gorm:"column:last_appearance_status_time"` |
| | | LastLocation string `gorm:"column:last_location;type:varchar(255);not null;default:''" json:"lastLocation"` //最后出现地点 |
| | | FrequentAddress string `gorm:"column:frequent_address;type:varchar(255);not null;default:''" json:"frequentAddress"` //常出现地点 |
| | | CreatedAt time.Time |
| | | UpdatedAt time.Time |
| | | ////OrgId string `gorm:"column:org_id"` |
| | | //CommunityID string `gorm:"column:communityID"` |
| | | //DocumentNumber string `gorm:"column:documentNumber"` |
| | | //Status string `gorm:"column:status"` |
| | | //FrequentAddress string `gorm:"column:frequentAddress"` |
| | | } |
| | | |
| | | func (PersonStatus) TableName() string { |
| | | return "snapshot_count_summary" |
| | | } |
| | | |
| | | type LabelManage struct { |
| | | Id int `gorm:"id"` |
| | | Name string `gorm:"name"` |
| | | ValidDays int `gorm:"valid_days"` |
| | | } |
| | | |
| | | func (LabelManage) TableName() string { |
| | | return "label_manage" |
| | | } |
| | | |
| | | type Identity struct { |
| | | CreatedAt time.Time |
| | | UpdatedAt time.Time |
| | | CommunityID string `gorm:"column:community_id"` |
| | | DocumentNumber string `gorm:"column:dbtablepersons_id"` |
| | | LabelId int `gorm:"column:label_id"` |
| | | ExpireTime int64 `gorm:"column:expire_time"` |
| | | } |
| | | |
| | | func (Identity) TableName() string { |
| | | return "dbtablepersons_label" |
| | | } |
| | | |
| | | // |
| | | //type ModelMatix struct { |
| | | // CommunityID string |
| | | // DocumentNumber string |
| | | // CaptureDate string |
| | | // Status string |
| | | // FrequentAddress string |
| | | //} |
| | | |
| | | type StatusPersonMapping struct { |
| | | Status string |