| | |
| | | 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 |
| | | OrderManage OrderManage `gorm:"foreignKey:OrderId"` |
| | | 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"` |
| | | 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 |
| | | Product Product `gorm:"foreignKey:ProductId"` |
| | |
| | | FaultType FaultType `gorm:"foreignKey:FaultTypeId"` |
| | | SeverityId int `gorm:"column:severity_id;type:int;not null;default:0;comment:严重程度id" json:"severity"` // 严重程度id |
| | | Severity Severity `gorm:"foreignKey:SeverityId"` |
| | | ServiceOrderStatusId int `gorm:"column:service_order_status_id;type:int;not null;default:0;comment:服务单状态id" json:"status"` // 处理状态 |
| | | ServiceOrderStatusId int `gorm:"column:service_order_status_id;type:int;not null;default:0;comment:服务单状态id" json:"serviceOrderStatusId"` // 处理状态 |
| | | ServiceOrderStatus ServiceOrderStatus `gorm:"foreignKey:ServiceOrderStatusId"` |
| | | ExpectTime string `gorm:"column:expect_time;type:varchar(255);not null;default:'';comment:希望处理时间" json:"expectTime"` // 希望处理时间 |
| | | RealTime string `gorm:"column:real_time;type:varchar(255);not null;default:'';comment:实际处理时间" json:"realTime"` // 实际处理时间 |
| | |
| | | var db = slf.Orm.Model(&ServiceOrder{}) |
| | | 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. |
| | |
| | | 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 |