Browse Source

Merge branch 'dev-zyj' of usky-cloud-paas/data-writer into master

James 1 year ago
parent
commit
ae7ab2dd06

+ 3 - 2
ytDataWriteProcess/databaseeventthread.cpp

@@ -1,11 +1,12 @@
 #include "databaseeventthread.h"
 
-#define HostName "172.17.35.51"
+//#define HostName "172.17.35.51"
 //#define HostName "124.71.140.20"
+#define HostName "172.16.120.165"
 #define HostPort 3306
 #define UserName "usky"
 #define PassWord "Yt#75Usky"
-#define DatabaseName "usky-park"
+#define DatabaseName "usky-data"
 
 DatabaseEventThread::DatabaseEventThread(QObject *parent) : QThread(parent)
 {

+ 3 - 2
ytDataWriteProcess/databasethread.cpp

@@ -1,11 +1,12 @@
 #include "databasethread.h"
 
-#define HostName "172.17.35.51"
+//#define HostName "172.17.35.51"
 //#define HostName "124.71.140.20"
+#define HostName "172.16.120.165"
 #define HostPort 3306
 #define UserName "usky"
 #define PassWord "Yt#75Usky"
-#define DatabaseName "usky-park"
+#define DatabaseName "usky-data"
 
 DatabaseThread::DatabaseThread(QObject *parent) : QThread(parent)
 {

+ 1 - 1
ytDataWriteProcess/dealmqttthread.cpp

@@ -63,7 +63,7 @@ void DealMqttThread::run()
                                        .arg(deviceId).arg(deviceCode).arg(devType).arg(iter.key()).arg(iter.value().toString()).arg(dataTime).arg(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss")));
 
                         }
-                        sql.append(sql1.left(sql1.length()-1).append(";"));
+                        sql.append(sql1.left(sql1.length()-1).append(" ON DUPLICATE KEY UPDATE  attribute_data = values(attribute_data),insert_time = values(insert_time);"));
                         emit dmqSql(sql);
                     }