|
@@ -333,10 +333,10 @@ INT CDataImpl::QueryUnReportLogInfo(std::vector<STLog> &vtdata)
|
|
|
return nRow;
|
|
return nRow;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-BOOL CDataImpl::InsertMidInfo(STMid &data)
|
|
|
|
|
|
|
+INT CDataImpl::InsertMidInfo(STMid &data)
|
|
|
{
|
|
{
|
|
|
if(m_psqlite3 == NULL)
|
|
if(m_psqlite3 == NULL)
|
|
|
- return FALSE;
|
|
|
|
|
|
|
+ return -1;
|
|
|
|
|
|
|
|
std::string strInsert = "INSERT INTO mid(bid, number, pid, ctype, version, purl, psize, pmd5)VALUES ('";
|
|
std::string strInsert = "INSERT INTO mid(bid, number, pid, ctype, version, purl, psize, pmd5)VALUES ('";
|
|
|
strInsert.append(data.order);
|
|
strInsert.append(data.order);
|
|
@@ -362,17 +362,16 @@ BOOL CDataImpl::InsertMidInfo(STMid &data)
|
|
|
{
|
|
{
|
|
|
//Global::WriteTextLog(_T("InsertContactsType:%s"), psqlite_error);
|
|
//Global::WriteTextLog(_T("InsertContactsType:%s"), psqlite_error);
|
|
|
FREE_MSG2
|
|
FREE_MSG2
|
|
|
- return FALSE;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return TRUE;
|
|
|
|
|
|
|
+ return sqlite_error;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-BOOL CDataImpl::InsertKeyInfo(STKeys &data)
|
|
|
|
|
|
|
+INT CDataImpl::InsertKeyInfo(STKeys &data)
|
|
|
{
|
|
{
|
|
|
if(m_psqlite3 == NULL)
|
|
if(m_psqlite3 == NULL)
|
|
|
- return FALSE;
|
|
|
|
|
|
|
+ return -1;
|
|
|
|
|
|
|
|
std::string strInsert = "INSERT INTO keys(sn, keys) VALUES ('";
|
|
std::string strInsert = "INSERT INTO keys(sn, keys) VALUES ('";
|
|
|
strInsert.append(data.sn);
|
|
strInsert.append(data.sn);
|
|
@@ -385,16 +384,15 @@ BOOL CDataImpl::InsertKeyInfo(STKeys &data)
|
|
|
{
|
|
{
|
|
|
//Global::WriteTextLog(_T("InsertContactsInfo:%s"), psqlite_error);
|
|
//Global::WriteTextLog(_T("InsertContactsInfo:%s"), psqlite_error);
|
|
|
FREE_MSG2
|
|
FREE_MSG2
|
|
|
- return FALSE;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return TRUE;
|
|
|
|
|
|
|
+ return sqlite_error;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-BOOL CDataImpl::InsertLogInfo(STLog &data)
|
|
|
|
|
|
|
+INT CDataImpl::InsertLogInfo(STLog &data)
|
|
|
{
|
|
{
|
|
|
if(m_psqlite3 == NULL)
|
|
if(m_psqlite3 == NULL)
|
|
|
- return FALSE;
|
|
|
|
|
|
|
+ return -1;
|
|
|
|
|
|
|
|
std::string strInsert = "INSERT INTO log(type, sn, content, report_date, report_status) VALUES ('";
|
|
std::string strInsert = "INSERT INTO log(type, sn, content, report_date, report_status) VALUES ('";
|
|
|
strInsert.append(data.type);
|
|
strInsert.append(data.type);
|
|
@@ -413,20 +411,22 @@ BOOL CDataImpl::InsertLogInfo(STLog &data)
|
|
|
{
|
|
{
|
|
|
//Global::WriteTextLog(_T("InsertContactsInfo:%s"), psqlite_error);
|
|
//Global::WriteTextLog(_T("InsertContactsInfo:%s"), psqlite_error);
|
|
|
FREE_MSG2
|
|
FREE_MSG2
|
|
|
- return FALSE;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return TRUE;
|
|
|
|
|
|
|
+ return sqlite_error;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
INT CDataImpl::BatchInsertKeyInfo(std::vector<STKeys> &vtdata)
|
|
INT CDataImpl::BatchInsertKeyInfo(std::vector<STKeys> &vtdata)
|
|
|
{
|
|
{
|
|
|
|
|
+ if(m_psqlite3 == NULL)
|
|
|
|
|
+ return -1;
|
|
|
|
|
+
|
|
|
char* psqlite_error = NULL;
|
|
char* psqlite_error = NULL;
|
|
|
INT nRet = sqlite3_exec(m_psqlite3, "begin;", 0, 0, &psqlite_error);
|
|
INT nRet = sqlite3_exec(m_psqlite3, "begin;", 0, 0, &psqlite_error);
|
|
|
if ( nRet != SQLITE_OK )
|
|
if ( nRet != SQLITE_OK )
|
|
|
{
|
|
{
|
|
|
FREE_MSG2
|
|
FREE_MSG2
|
|
|
- return -1;
|
|
|
|
|
|
|
+ return nRet;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
sqlite3_stmt *stmt;
|
|
sqlite3_stmt *stmt;
|
|
@@ -447,17 +447,18 @@ INT CDataImpl::BatchInsertKeyInfo(std::vector<STKeys> &vtdata)
|
|
|
{
|
|
{
|
|
|
// »Ø¹öÊÂÎñ;
|
|
// »Ø¹öÊÂÎñ;
|
|
|
nRet = sqlite3_exec(m_psqlite3, "rollback;", 0, 0, &psqlite_error);
|
|
nRet = sqlite3_exec(m_psqlite3, "rollback;", 0, 0, &psqlite_error);
|
|
|
- return -1;
|
|
|
|
|
|
|
+ FREE_MSG2
|
|
|
|
|
+ return nRet;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
nRet = sqlite3_exec(m_psqlite3, "commit;", 0, 0, &psqlite_error);
|
|
nRet = sqlite3_exec(m_psqlite3, "commit;", 0, 0, &psqlite_error);
|
|
|
if ( nRet != SQLITE_OK )
|
|
if ( nRet != SQLITE_OK )
|
|
|
{
|
|
{
|
|
|
FREE_MSG2
|
|
FREE_MSG2
|
|
|
- return -1;
|
|
|
|
|
|
|
+ return nRet;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return vtdata.size();
|
|
|
|
|
|
|
+ return SQLITE_OK;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
BOOL CDataImpl::UpdateMidInfo(STMid &data)
|
|
BOOL CDataImpl::UpdateMidInfo(STMid &data)
|