| 1234567891011121314151617181920212223242526 |
- package dao
- import (
- "server/global"
- "time"
- )
- type Vehicle struct {
- global.GVA_MODEL
- PlateNumber string `gorm:"size:20;not null;uniqueIndex" json:"plate_number"` // 车牌号
- RFIDTag string `gorm:"size:40;column:rfid_tag" json:"rfid_tag"` // 电子标签
- VehicleTypeID uint `gorm:"not null" json:"vehicle_type_id"` // 车辆类型ID
- VehicleType *VehicleType `gorm:"foreignKey:VehicleTypeID" json:"vehicle_type"` // 车辆类型关联
- VehicleBrand string `gorm:"size:50" json:"vehicle_brand"` // 车辆品牌
- VehicleColor string `gorm:"size:20" json:"vehicle_color"` // 车辆颜色
- OwnerId *uint `json:"owner_id"` // 车主id,可为空(临时车辆)
- Owner *Owner `gorm:"foreignKey:OwnerId" json:"owner"`
- LastEntryTime *time.Time `json:"last_entry_time" gorm:"default:null"` // 最近入场时间
- LastExitTime *time.Time `json:"last_exit_time" gorm:"default:null"` // 最近出场时间
- TotalStayTime int64 `json:"total_stay_time" gorm:"default:null"` // 总停留时间
- TotalFee float64 `json:"total_fee"` // 总费用
- }
- func (Vehicle) TableName() string {
- return "vehicle"
- }
|