| | |
| | | OperationDetails struct { |
| | | WmsModel |
| | | |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | OperationId int `json:"OperationId" gorm:"type:int;not null;comment:操作记录id"` //操作id |
| | | |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | OperationId int `json:"OperationId" gorm:"type:int;not null;comment:操作记录id"` //操作id |
| | | ProductId int `json:"productId" gorm:"type:int;not null;comment:产品id"` //产品id |
| | | ProductName string `json:"productName" gorm:"type:varchar(255);not null;comment:产品名称"` //产品名称 |
| | | Quantity decimal.Decimal `json:"quantity" gorm:"type:decimal(20,2);not null;comment:数量"` //数量 |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *OperationDetailsSearch) SetOperationId(operationId int) *OperationDetailsSearch { |
| | | slf.OperationId = operationId |
| | | return slf |
| | | } |
| | | |
| | | func (slf *OperationDetailsSearch) build() *gorm.DB { |
| | | var db = slf.Orm.Model(&OperationDetails{}) |
| | | |
| | |
| | | db = db.Where("product_name like ?", fmt.Sprintf("%%%v%%", slf.Keyword)) |
| | | } |
| | | |
| | | if slf.OperationId != 0 { |
| | | db = db.Where("operation_id = ?", slf.OperationId) |
| | | } |
| | | |
| | | return db |
| | | } |
| | | |