This commit is contained in:
邹宗楠
2023-01-06 13:37:41 +08:00
parent 21bf72af71
commit a1584a6d72
4 changed files with 63 additions and 7 deletions

View File

@@ -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
}