| | |
| | | type ( |
| | | Contract struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | ContractName string `json:"contractName" gorm:"column:contract_name;type:varchar(255);comment:合同名称"` |
| | | ClientId int `json:"clientId" gorm:"column:client_id;type:int;comment:客户id"` |
| | | Client Client `json:"client" gorm:"foreignKey:ClientId"` |
| | | MemberId int `json:"memberId" gorm:"column:member_id;type:int;comment:负责人id"` |
| | |
| | | ServiceContractStatus ServiceContractStatus `json:"serviceContractStatus" gorm:"foreignKey:StatusId;references:Id"` |
| | | File string `json:"file" gorm:"column:file;type:varchar(255);comment:合同文件"` |
| | | CreatedAt *CustomTime `json:"created_at" gorm:"column:created_at;type:datetime;comment:创建时间"` |
| | | CodeStandID string `json:"codeStandID" gorm:"column:code_stand_id;type:varchar(255);comment:编码id"` |
| | | gormModel |
| | | } |
| | | |
| | |
| | | db = db.Where(key+"= ?", v) |
| | | } |
| | | case int: |
| | | if key == "member_id" { |
| | | db = db.Where(key+"= ?", v) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | slf.Orm = slf.Orm.Where("id in (?)", ids) |
| | | return slf |
| | | } |
| | | func (slf *ContractSearch) UpdateByMap(data map[string]interface{}) error { |
| | | var db = slf.build() |
| | | return db.Updates(data).Error |
| | | } |