| | |
| | | ServiceNumber string `gorm:"column:service_number;type:varchar(255);not null;default:'';comment:服务单编号" json:"serviceNumber"` // 服务单编号 |
| | | ClientId int `gorm:"column:client_id;type:int;not null;default:0;comment:客户id" json:"clientId"` // 客户id |
| | | Client Client `gorm:"foreignKey:ClientId"` |
| | | ContractId int `gorm:"column:contract_id;type:int;not null;default:0;comment:合同id" json:"contractId"` // 合同id |
| | | Contract Contract `gorm:"foreignKey:ContractId"` |
| | | OrderId int `gorm:"column:order_id;type:int;not null;default:0;comment:销售订单id" json:"orderId"` // 销售订单id |
| | | ServiceContractId int `gorm:"column:contract_id;type:int;not null;default:0;comment:服务合同id" json:"serviceContractId"` // 服务合同id |
| | | ServiceContract ServiceContract `gorm:"foreignKey:ServiceContractId"` |
| | | SalesDetailsId int `gorm:"column:order_id;type:int;not null;default:0;comment:销售订单id" json:"salesDetailsId"` // 销售明细id |
| | | SalesDetails SalesDetails `gorm:"foreignKey:SalesDetailsId"` |
| | | OrderManage OrderManage `gorm:"foreignKey:OrderId"` |
| | | Subject string `gorm:"column:subject;type:varchar(255);not null;default:'';comment:主题" json:"subject"` // 主题 |
| | | ProductId int `gorm:"column:product_id;type:int;not null;default:0;comment:产品id" json:"productId"` // 产品id |
| | |
| | | if slf.Id != 0 { |
| | | db = db.Where("id = ?", slf.Id) |
| | | } |
| | | if slf.ServiceContractId != 0 { |
| | | db = db.Where("service_contract_id = ?", slf.ServiceContractId) |
| | | } |
| | | if slf.SalesDetailsId != 0 { |
| | | db = db.Where("sales_details_id = ?", slf.SalesDetailsId) |
| | | } |
| | | if slf.Preload { |
| | | db = db. |
| | | Preload("Client"). |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceOrderSearch) SetServiceContractId(id int) *ServiceOrderSearch { |
| | | slf.ServiceContractId = id |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceOrderSearch) SetSalesDetailsId(id int) *ServiceOrderSearch { |
| | | slf.SalesDetailsId = id |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ServiceOrderSearch) SetPage(page, size int) *ServiceOrderSearch { |
| | | slf.PageNum, slf.PageSize = page, size |
| | | return slf |