1
This commit is contained in:
@@ -45,8 +45,21 @@ func CreateThingMap(thingId int64, vendorThingID, appOrgCode, err string, thingT
|
||||
return CreateEntity(GetDB(), thingMap)
|
||||
}
|
||||
|
||||
func UpdateThingMap(thingMap *model.ThingMap) error {
|
||||
_, err := UpdateEntity(GetDB(), thingMap, "ID")
|
||||
func UpdateThingMap(db *DaoDB, syncStatus int8, vendorThingId string, thingId int, vendorId int, vendorOrgCode string) error {
|
||||
sql := `
|
||||
UPDATE thing_map t1
|
||||
SET t1.sync_status = ?,t1.vendor_thing_id = ?
|
||||
WHERE t1.deleted_at = ? AND t1.thing_id = ? AND t1.vendor_id = ? AND t1.vendor_org_code = ?
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
syncStatus,
|
||||
vendorThingId,
|
||||
utils.DefaultTimeValue,
|
||||
thingId,
|
||||
vendorId,
|
||||
vendorOrgCode,
|
||||
}
|
||||
_, err := ExecuteSQL(db, sql, sqlParams...)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -65,7 +78,6 @@ func GetThingToTiktokMapList(db *DaoDB, vendorId int, thingId int64, vendorOrgCo
|
||||
}
|
||||
|
||||
err = GetRows(db, &cats, sql, sqlParams...)
|
||||
|
||||
return cats, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user