device_running_record.go 1.2 KB
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
}