device_running_record.go
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package domain
import "time"
// 设备运行记录
type DeviceRunningRecord struct {
// 设备运行记录ID
DeviceRunningRecordId int `json:"deviceRunningRecordId"`
// 企业id
CompanyId int `json:"companyId"`
// 组织ID
OrgId int `json:"orgId"`
// 工作位置
WorkStation *WorkStation `json:"workStation"`
// 设备Id
DeviceId int `json:"deviceId"`
// 设备编号
DeviceCode string `json:"deviceCode"`
// 设备运行记录信息
DeviceRunningRecordInfo *DeviceRunningData `json:"deviceRunningRecordInfo"`
// 创建时间
CreatedAt time.Time `json:"createdAt"`
}
type DeviceRunningRecordRepository interface {
Save(deviceRunningRecord *DeviceRunningRecord) (*DeviceRunningRecord, error)
Remove(deviceRunningRecord *DeviceRunningRecord) (*DeviceRunningRecord, error)
FindOne(queryOptions map[string]interface{}) (*DeviceRunningRecord, error)
Find(queryOptions map[string]interface{}) (int64, []*DeviceRunningRecord, error)
}
func (deviceRunningRecord *DeviceRunningRecord) Identify() interface{} {
if deviceRunningRecord.DeviceRunningRecordId == 0 {
return nil
}
return deviceRunningRecord.DeviceRunningRecordId
}
func (deviceRunningRecord *DeviceRunningRecord) Update(data map[string]interface{}) error {
return nil
}