...
|
...
|
@@ -35,6 +35,8 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi |
|
|
"startup_status",
|
|
|
"com_status",
|
|
|
"values",
|
|
|
"count",
|
|
|
"latest_update_time",
|
|
|
}
|
|
|
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
|
|
|
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
|
...
|
...
|
@@ -59,6 +61,8 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi |
|
|
&deviceCollection.StartupStatus,
|
|
|
&deviceCollection.ComStatus,
|
|
|
&deviceCollection.Values,
|
|
|
&deviceCollection.Count,
|
|
|
&deviceCollection.LatestUpdateTime,
|
|
|
),
|
|
|
fmt.Sprintf("INSERT INTO manufacture.device_collections (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
|
|
|
deviceCollection.DeviceCollectionId,
|
...
|
...
|
@@ -69,6 +73,8 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi |
|
|
deviceCollection.StartupStatus,
|
|
|
deviceCollection.ComStatus,
|
|
|
deviceCollection.Values,
|
|
|
deviceCollection.Count,
|
|
|
deviceCollection.LatestUpdateTime,
|
|
|
); err != nil {
|
|
|
return deviceCollection, err
|
|
|
}
|
...
|
...
|
@@ -83,6 +89,8 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi |
|
|
&deviceCollection.StartupStatus,
|
|
|
&deviceCollection.ComStatus,
|
|
|
&deviceCollection.Values,
|
|
|
&deviceCollection.Count,
|
|
|
&deviceCollection.LatestUpdateTime,
|
|
|
),
|
|
|
fmt.Sprintf("UPDATE manufacture.device_collections SET %s WHERE device_collection_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
|
|
|
//deviceCollection.DeviceCollectionId,
|
...
|
...
|
@@ -93,6 +101,8 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi |
|
|
deviceCollection.StartupStatus,
|
|
|
deviceCollection.ComStatus,
|
|
|
deviceCollection.Values,
|
|
|
deviceCollection.Count,
|
|
|
deviceCollection.LatestUpdateTime,
|
|
|
deviceCollection.Identify(),
|
|
|
); err != nil {
|
|
|
return deviceCollection, err
|
...
|
...
|
|