#ifndef DATABASETHREAD_H
#define DATABASETHREAD_H

#include <QThread>
#include <QDateTime>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QVariant>
#include <QStringList>
#include <QList>


class DatabaseThread : public QThread
{
    Q_OBJECT
public:
    explicit DatabaseThread(QObject *parent = nullptr);
    void appendSql(QString sql);
    void run();
    void check_devicelist();
    void stop();
signals:
    void AlarmReport(QString addr, quint64 insertid, QString type, QString time);
    void SqlLog(QString log);
    void MqttInfo(QString ip,QString port,QString name,QString passwd);
public slots:

private:
    int hour;
    QSqlDatabase db;
    QStringList sqlList;
    bool keep;
};

#endif // DATABASETHREAD_H
