#ifndef  _SqlExecute_H__
#define  _SqlExecute_H__
/*
	\author: zym
	\brief :
	\version 1.0
	\note
	\CopyRight:zym
*/
#include <QSqlDatabase>
#include <QMap>
#include <QThread>
#include <QSqlQuery>
#include <QSharedPointer>
#include <QSqlRecord>
#include <QMutex>
#include <QMutexLocker>
#include <QSqlError>
 
    class SqlExecute :public QObject
	{
		Q_OBJECT
	public:
        SqlExecute(QObject * parent = NULL);
        virtual ~SqlExecute();
		static void  init(QString sDriver, QString sUser, QString sPasswd, QString sDBFile);
		static bool  exeRead(QString sql, QList<QVariantMap> &list); 
		static bool  exeRead(QString sql, QList<QList<QVariant>> &list, QStringList sResuleSeq); 
		static bool  exeWrite(QString sql);
		static void  destroyConn();
		static QSqlDatabase getDataBase();
	private:
		bool  saveSql(QString sqlAction);
		QList<QVariantMap> getValues(QSharedPointer<QSqlQuery> sqlQuery, int page, int pageNum);
	};
 
#endif // SqlExecute_h__
