| | |
| | | LocationIds []int |
| | | ProductIds []string |
| | | Ids []int |
| | | Query string |
| | | } |
| | | |
| | | LocationProductAmountWithOperation struct { |
| | |
| | | OperationId int `json:"operationId" gorm:"column:operation_id"` |
| | | Status constvar.OperationStatus `json:"status" gorm:"status"` |
| | | BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"base_operation_type"` |
| | | Weight decimal.Decimal `gorm:"type:decimal(20,3);comment:重量" json:"weight"` //重量 |
| | | } |
| | | ) |
| | | |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *LocationProductAmountSearch) SetQuery(query string) *LocationProductAmountSearch { |
| | | slf.Query = query |
| | | return slf |
| | | } |
| | | |
| | | func (slf *LocationProductAmountSearch) build() *gorm.DB { |
| | | var db = slf.Orm.Model(&LocationProductAmount{}) |
| | | |
| | |
| | | db = db.Where("id in (?)", slf.Ids) |
| | | } |
| | | |
| | | if slf.Query != "" { |
| | | db = db.Where(slf.Query) |
| | | } |
| | | |
| | | return db |
| | | } |
| | | |