|
@@ -35,7 +35,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi |
|
@@ -35,7 +35,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi |
35
|
"startup_status",
|
35
|
"startup_status",
|
36
|
"com_status",
|
36
|
"com_status",
|
37
|
"values",
|
37
|
"values",
|
38
|
- "count",
|
38
|
+ "product_count",
|
39
|
"latest_update_time",
|
39
|
"latest_update_time",
|
40
|
}
|
40
|
}
|
41
|
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
|
41
|
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
|
|
@@ -61,7 +61,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi |
|
@@ -61,7 +61,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi |
61
|
&deviceCollection.StartupStatus,
|
61
|
&deviceCollection.StartupStatus,
|
62
|
&deviceCollection.ComStatus,
|
62
|
&deviceCollection.ComStatus,
|
63
|
&deviceCollection.Values,
|
63
|
&deviceCollection.Values,
|
64
|
- &deviceCollection.Count,
|
64
|
+ &deviceCollection.ProductCount,
|
65
|
&deviceCollection.LatestUpdateTime,
|
65
|
&deviceCollection.LatestUpdateTime,
|
66
|
),
|
66
|
),
|
67
|
fmt.Sprintf("INSERT INTO manufacture.device_collections (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
|
67
|
fmt.Sprintf("INSERT INTO manufacture.device_collections (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
|
|
@@ -73,7 +73,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi |
|
@@ -73,7 +73,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi |
73
|
deviceCollection.StartupStatus,
|
73
|
deviceCollection.StartupStatus,
|
74
|
deviceCollection.ComStatus,
|
74
|
deviceCollection.ComStatus,
|
75
|
deviceCollection.Values,
|
75
|
deviceCollection.Values,
|
76
|
- deviceCollection.Count,
|
76
|
+ deviceCollection.ProductCount,
|
77
|
deviceCollection.LatestUpdateTime,
|
77
|
deviceCollection.LatestUpdateTime,
|
78
|
); err != nil {
|
78
|
); err != nil {
|
79
|
return deviceCollection, err
|
79
|
return deviceCollection, err
|
|
@@ -89,7 +89,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi |
|
@@ -89,7 +89,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi |
89
|
&deviceCollection.StartupStatus,
|
89
|
&deviceCollection.StartupStatus,
|
90
|
&deviceCollection.ComStatus,
|
90
|
&deviceCollection.ComStatus,
|
91
|
&deviceCollection.Values,
|
91
|
&deviceCollection.Values,
|
92
|
- &deviceCollection.Count,
|
92
|
+ &deviceCollection.ProductCount,
|
93
|
&deviceCollection.LatestUpdateTime,
|
93
|
&deviceCollection.LatestUpdateTime,
|
94
|
),
|
94
|
),
|
95
|
fmt.Sprintf("UPDATE manufacture.device_collections SET %s WHERE device_collection_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
|
95
|
fmt.Sprintf("UPDATE manufacture.device_collections SET %s WHERE device_collection_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
|
|
@@ -101,7 +101,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi |
|
@@ -101,7 +101,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi |
101
|
deviceCollection.StartupStatus,
|
101
|
deviceCollection.StartupStatus,
|
102
|
deviceCollection.ComStatus,
|
102
|
deviceCollection.ComStatus,
|
103
|
deviceCollection.Values,
|
103
|
deviceCollection.Values,
|
104
|
- deviceCollection.Count,
|
104
|
+ deviceCollection.ProductCount,
|
105
|
deviceCollection.LatestUpdateTime,
|
105
|
deviceCollection.LatestUpdateTime,
|
106
|
deviceCollection.Identify(),
|
106
|
deviceCollection.Identify(),
|
107
|
); err != nil {
|
107
|
); err != nil {
|