| | |
| | | type ( |
| | | FileTemplateAttachment struct { |
| | | WmsModel |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Category constvar.FileTemplateCategory `json:"category" gorm:"type:int(11);comment:模版种类"` |
| | | WarehouseId int `json:"warehouseId" gorm:"type:int(11);comment:仓库id"` |
| | | Name string `json:"name" gorm:"type:varchar(63);comment:模版名称"` |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Category constvar.FileTemplateCategory `json:"category" gorm:"type:int(11);comment:模版种类"` |
| | | Name string `json:"name" gorm:"type:varchar(63);comment:模版名称"` |
| | | //AttachmentId uint `json:"attachmentId" gorm:"comment:附件表外键"` |
| | | //Attachment Attachment `json:"attachment" gorm:"foreignKey:AttachmentId;references:Id"` |
| | | TableInfo string `json:"tableInfo" gorm:"type:varchar(31);comment:表名"` |
| | |
| | | slf.Order = order |
| | | return slf |
| | | } |
| | | func (slf *FileTemplateAttachmentSearch) SetWarehouseId(warehouseId int) *FileTemplateAttachmentSearch { |
| | | slf.WarehouseId = warehouseId |
| | | return slf |
| | | } |
| | | |
| | | func (slf *FileTemplateAttachmentSearch) SetID(id int) *FileTemplateAttachmentSearch { |
| | | slf.Id = id |
| | |
| | | |
| | | if slf.Id != 0 { |
| | | db = db.Where("id = ?", slf.Id) |
| | | } |
| | | if slf.WarehouseId != 0 { |
| | | db = db.Where("warehouse_id = ?", slf.Id) |
| | | } |
| | | if slf.Order != "" { |
| | | db = db.Order(slf.Order) |