zhangzengfei
2024-09-05 da38fef02e9d37703bc1f68ffbe2c4efd434df86
db/models.go
@@ -43,6 +43,7 @@
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"` //最高楼层号
}
@@ -78,18 +79,19 @@
}
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"`                      //最后出现时间
   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
   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"`
@@ -139,7 +141,6 @@
}
type CaptureInfo struct {
   OrgId           string          `json:"orgId"` //派出所Id
   DocumentNumber  string          `json:"documentNumber"`
   CaptureDays     int             `json:"captureDays"`     //抓拍天数
   OvernightStays  int             `json:"overnightStays"`  //过夜天数
@@ -154,3 +155,18 @@
   CaptureAddress string `json:"captureAddress"`
   Direction      string `json:"direction"`
}
type PublicHouse struct {
   ID              int    `gorm:"primaryKey;autoIncrement" json:"id"`                        // 主键ID
   CommunityID     string `gorm:"column:community_id;type:varchar(255)" json:"community_id"` // 小区ID
   Applicant       string `gorm:"column:applicant;type:varchar(255)" json:"applicant"`       // 申请人
   IdCard          string `gorm:"column:id_card;type:varchar(50)" json:"id_card"`            // 证件编号
   PhoneNumber     string `gorm:"column:phone_number;type:varchar(20)" json:"phone_number"`  // 联系电话
   Address         string `gorm:"column:address;type:varchar(255)" json:"address"`           // 房屋地址
   ApplicationTime string `gorm:"column:application_time" json:"application_time"`           // 申请时间
   EndTime         string `gorm:"column:end_time" json:"end_time"`                           // 结束时间
}
func (PublicHouse) TableName() string {
   return "public_house"
}