@@ -100,12 +100,12 @@ bool CDBModule_MQData::DBModule_MQData_Insert(XENGINE_DBMESSAGEQUEUE* pSt_DBInfo
100100 memset (tszSQLCoder, ' \0 ' , sizeof (tszSQLCoder));
101101
102102 DataBase_MySQL_Coder (xhDBSQL, pSt_DBInfo->tszMsgBuffer , tszSQLCoder, &pSt_DBInfo->nMsgLen );
103- __int64u nRet = _xstprintf (tszSQLStatement, _X (" INSERT INTO `%s` (tszUserName,tszQueueName,nQueueSerial,nQueueGetTime,tszQueueLeftTime,tszQueuePublishTime,tszQueueData,nDataType,tszQueueCreateTime) VALUES('%s','%s',%lld,%lld,'%s','%s','" ), pSt_DBInfo->tszQueueName , pSt_DBInfo->tszUserName , pSt_DBInfo->tszQueueName , pSt_DBInfo->nQueueSerial , pSt_DBInfo->nQueueGetTime , pSt_DBInfo->tszQueueLeftTime , pSt_DBInfo->tszQueuePublishTime );
103+ __int64u nRet = _xstprintf (tszSQLStatement, _X (" INSERT INTO `%s` (tszUserName,tszQueueName,nQueueSerial,nQueueGetTime,tszQueueLeftTime,tszQueuePublishTime,tszQueueData,nDataType,nDataAttr, tszQueueCreateTime) VALUES('%s','%s',%lld,%lld,'%s','%s','" ), pSt_DBInfo->tszQueueName , pSt_DBInfo->tszUserName , pSt_DBInfo->tszQueueName , pSt_DBInfo->nQueueSerial , pSt_DBInfo->nQueueGetTime , pSt_DBInfo->tszQueueLeftTime , pSt_DBInfo->tszQueuePublishTime );
104104 memcpy (tszSQLStatement + nRet, tszSQLCoder, pSt_DBInfo->nMsgLen );
105105 nRet += pSt_DBInfo->nMsgLen ;
106106
107107 memset (tszSQLCoder, ' \0 ' , sizeof (tszSQLCoder));
108- int nLen = _xstprintf (tszSQLCoder, _X (" ',%d,now())" ), pSt_DBInfo->byMsgType );
108+ int nLen = _xstprintf (tszSQLCoder, _X (" ',%d,%d, now())" ), pSt_DBInfo->byMsgType , pSt_DBInfo-> byMsgAttr );
109109 memcpy (tszSQLStatement + nRet, tszSQLCoder, nLen);
110110 nRet += nLen;
111111
@@ -199,7 +199,11 @@ bool CDBModule_MQData::DBModule_MQData_Query(XENGINE_DBMESSAGEQUEUE* pSt_DBInfo)
199199 }
200200 if (NULL != pptszResult[9 ])
201201 {
202- _tcsxcpy (pSt_DBInfo->tszQueueCreateTime , pptszResult[9 ]);
202+ pSt_DBInfo->byMsgAttr = _ttxoi (pptszResult[9 ]);
203+ }
204+ if (NULL != pptszResult[10 ])
205+ {
206+ _tcsxcpy (pSt_DBInfo->tszQueueCreateTime , pptszResult[10 ]);
203207 }
204208 DataBase_MySQL_FreeResult (xhDBSQL, xhTable);
205209 return true ;
@@ -240,7 +244,7 @@ bool CDBModule_MQData::DBModule_MQData_Modify(XENGINE_DBMESSAGEQUEUE* pSt_DBInfo
240244 nRet += pSt_DBInfo->nMsgLen ;
241245
242246 memset (tszSQLCoder, ' \0 ' , sizeof (tszSQLCoder));
243- int nLen = _xstprintf (tszSQLCoder, _X (" ',nDataType = %d WHERE tszUserName = '%s' AND tszQueueName = '%s' AND nQueueSerial = %lld" ), pSt_DBInfo->byMsgType , pSt_DBInfo->tszUserName , pSt_DBInfo->tszQueueName , pSt_DBInfo->nQueueSerial );
247+ int nLen = _xstprintf (tszSQLCoder, _X (" ',nDataType = %d,nDataAttr = %d WHERE tszUserName = '%s' AND tszQueueName = '%s' AND nQueueSerial = %lld" ), pSt_DBInfo->byMsgType , pSt_DBInfo-> byMsgAttr , pSt_DBInfo->tszUserName , pSt_DBInfo->tszQueueName , pSt_DBInfo->nQueueSerial );
244248 memcpy (tszSQLStatement + nRet, tszSQLCoder, nLen);
245249 nRet += nLen;
246250
@@ -359,7 +363,11 @@ bool CDBModule_MQData::DBModule_MQData_List(LPCXSTR lpszQueueName, __int64x nSer
359363 }
360364 if (NULL != pptszResult[9 ])
361365 {
362- _tcsxcpy ((*pppSt_DBMessage)[i]->tszQueueCreateTime , pptszResult[9 ]);
366+ (*pppSt_DBMessage)[i]->byMsgAttr = _ttxoi (pptszResult[9 ]);
367+ }
368+ if (NULL != pptszResult[10 ])
369+ {
370+ _tcsxcpy ((*pppSt_DBMessage)[i]->tszQueueCreateTime , pptszResult[10 ]);
363371 }
364372 }
365373 DataBase_MySQL_FreeResult (xhDBSQL, xhTable);
@@ -465,7 +473,11 @@ bool CDBModule_MQData::DBModule_MQData_GetSerial(LPCXSTR lpszName, __int64x* pIn
465473 }
466474 if (NULL != pptszResult[9 ])
467475 {
468- _tcsxcpy (pSt_DBStart->tszQueueCreateTime , pptszResult[9 ]);
476+ pSt_DBStart->byMsgAttr = _ttxoi (pptszResult[9 ]);
477+ }
478+ if (NULL != pptszResult[10 ])
479+ {
480+ _tcsxcpy (pSt_DBStart->tszQueueCreateTime , pptszResult[10 ]);
469481 }
470482 DataBase_MySQL_FreeResult (xhDBSQL, xhTable);
471483 }
@@ -526,7 +538,11 @@ bool CDBModule_MQData::DBModule_MQData_GetSerial(LPCXSTR lpszName, __int64x* pIn
526538 }
527539 if (NULL != pptszResult[9 ])
528540 {
529- _tcsxcpy (pSt_DBEnd->tszQueueCreateTime , pptszResult[9 ]);
541+ pSt_DBEnd->byMsgAttr = _ttxoi (pptszResult[9 ]);
542+ }
543+ if (NULL != pptszResult[10 ])
544+ {
545+ _tcsxcpy (pSt_DBEnd->tszQueueCreateTime , pptszResult[10 ]);
530546 }
531547 DataBase_MySQL_FreeResult (xhDBSQL, xhTable);
532548 }
@@ -592,6 +608,7 @@ bool CDBModule_MQData::DBModule_MQData_CreateTable(LPCXSTR lpszQueueName)
592608 " `tszQueuePublishTime` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '发布时间',"
593609 " `tszQueueData` longblob NOT NULL COMMENT '保存数据',"
594610 " `nDataType` tinyint NOT NULL COMMENT '数据类型',"
611+ " `nDataAttr` tinyint NULL DEFAULT NULL COMMENT '消息属性',"
595612 " `tszQueueCreateTime` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '插入时间',"
596613 " PRIMARY KEY (`ID`) USING BTREE"
597614 " ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;"
0 commit comments