| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 | package modelimport (	"time"	"ulink-admin/pkg/base")type Car struct {	Id            int64     `excel:"name=主键id   " xorm:"pk autoincr    notnull    comment('主键id')" json:"id"  binding:"required"`                                     //主键id	CarNo         string    `excel:"name=车牌号   " xorm:"varchar(64)      comment('车牌号')" json:"carNo"  binding:"required"`                                             //车牌号	Color         string    `excel:"name=颜色   " xorm:"varchar(30)      comment('颜色')" json:"color"  `                                                                 //颜色	Owner         string    `excel:"name=车主   " xorm:"varchar(255)      comment('车主')" json:"owner"  binding:"required"`                                              //车主	CompanyId     int64     `excel:"name=现属公司   " xorm:"bigint(20)    notnull  default(0)  comment('现属公司')" json:"companyId"  binding:"required"`                     //现属公司	EngineNo      string    `excel:"name=发动机号   " xorm:"varchar(255)      comment('发动机号')" json:"engineNo"  `                                                         //发动机号	ChassisNo     string    `excel:"name=底盘号   " xorm:"varchar(255)      comment('底盘号')" json:"chassisNo"  `                                                          //底盘号	ProductDate   string    `excel:"name=出厂日期   " xorm:"varchar(255)      comment('出厂日期')" json:"productDate"  `                                                      //出厂日期	Cat           int64     `excel:"name=车辆类型   " xorm:"bigint(20)    notnull  default(2)  comment('车辆类型')" json:"cat"  binding:"required"`                           //车辆类型	State         int       `excel:"name=营业状态   ,format=1=正常,2=注销" xorm:"int(1)    notnull  default(2)  comment('营业状态')" json:"state"  binding:"required,oneof=1 2 "` //营业状态(1正常 2注销)	TransportNo   string    `excel:"name=运输证号   " xorm:"varchar(255)      comment('运输证号')" json:"transportNo"  `                                                      //运输证号	TransportDate string    `excel:"name=运输证发证日期   " xorm:"varchar(255)      comment('运输证发证日期')" json:"transportDate"  `                                              //运输证发证日期	Remark        string    `excel:"name=备注   " xorm:"text      comment('备注')" json:"remark"  `                                                                       //备注	CreateTime    time.Time `excel:"name=创建时间   " xorm:"datetime      comment('创建时间')" json:"createTime"  `                                                           //创建时间	CreateBy      string    `excel:"name=创建人   " xorm:"varchar(255)      comment('创建人')" json:"createBy"  `                                                           //创建人	UpdateTime    time.Time `excel:"name=更新时间   " xorm:"datetime      comment('更新时间')" json:"updateTime"  `                                                           //更新时间	UpdateBy      string    `excel:"name=更新人   " xorm:"varchar(255)      comment('更新人')" json:"updateBy"  `                                                           //更新人}func (this Car) TableName() string {	return "car"}func (this *Car) Key() int64 {	return this.Id}func (this *Car) Model() interface{} {	return this}func (this *Car) BeforeUpdate() {	user := base.GetCurUser()	if user != nil {		this.UpdateBy = user.Name	}	if user.ComponyId > 0 {		this.CompanyId = user.ComponyId	}}func (this *Car) BeforeInsert() {	user := base.GetCurUser()	if user != nil {		this.CreateBy = user.Name		this.UpdateBy = user.Name	}	if user.ComponyId > 0 {		this.CompanyId = user.ComponyId	}}
 |