This commit is contained in:
zhangsheng 2025-04-10 15:51:47 +08:00
parent ad4b206a0d
commit 6162e2152e
2 changed files with 16 additions and 16 deletions

View File

@ -899,7 +899,7 @@ std::string JsonData::JsonCmd_Cgi_62(Param_62 &param){
if (nSize > 0) {
char szTableName[100] = {0x00}, whereCon[256] = {0x00},selectCon[100] = {0x00};
if (param.mMode == 1){
sprintf(selectCon," dataNodeNo,channelID,timeStamp,sendMsg,nodeResend ");
sprintf(selectCon," dataNodeNo,channelID,timeStamp,sendMsg,sendMsg,nodeResend ");
sprintf(szTableName,"t_data_%s",param.MeasurementID.c_str());
}else{
sprintf(selectCon," * ");
@ -908,14 +908,14 @@ std::string JsonData::JsonCmd_Cgi_62(Param_62 &param){
if(param.straxis == ""){
if (param.mMode == 1){
sprintf(whereCon, " channelID like '%%%s%%' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str());
sprintf(whereCon, " channelID like '%s-X' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str());
}else{
sprintf(whereCon, " data_nodeno like '%%%s%%' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str());
}
}
else{
if (param.mMode == 1){
sprintf(whereCon, " channelID = '%s-%s' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str());
sprintf(whereCon, " channelID = '%s-X' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str());
}else{
sprintf(whereCon, " data_nodeno = '%s-%s' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str());
}
@ -951,15 +951,15 @@ std::string JsonData::JsonCmd_Cgi_62(Param_62 &param){
if(param.straxis == "")
{
if (param.mMode == 1){
sprintf(whereCon, " channelID like '%%%s%%' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
sprintf(whereCon, " channelID like '%s-X' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
}else{
sprintf(whereCon, " data_nodeno like '%%%s%%' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
}
}else{
if (param.mMode == 1){
sprintf(whereCon, " channelID = '%s-%s' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
sprintf(whereCon, " channelID = '%s-X' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
}else{
sprintf(whereCon, "data_nodeno = %s-%s' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
sprintf(whereCon, "data_nodeno = '%s-%s' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
}
}
array_t vecRes;

View File

@ -1092,11 +1092,11 @@ int Uart::FindRecvPackage(int bytesRead, char *mUartRecvBuf, char *head) {
strChannelID = strMeasurementID + "-Z";
wave_error_z = true;
}
if(scheduler::instance().WaveError(wave_shortAddr) < 0){
zlog_error(zct, "WaveError error ShortAddr :%s", strShortAddr.c_str());
sprintf(insertSql, "'%s','%s','%s',%d,'%d','%s' ", strChannelID.c_str(),strShortAddr.c_str(),localtimestamp,bytesRead,0,error_msg.c_str());
sqlite_db_ctrl::instance().InsertData(" receive_wave_status ", insertSql);
}
zlog_error(zct, "WaveError error ShortAddr :%s", strShortAddr.c_str());
sprintf(insertSql, "'%s','%s','%s',%d,'%d','%s' ", strChannelID.c_str(),strShortAddr.c_str(),localtimestamp,bytesRead,0,error_msg.c_str());
sqlite_db_ctrl::instance().InsertData(" receive_wave_status ", insertSql);
JsonData jd;
jd.JsonCmd_32(strMeasurementID,1,1,strChannelID,error_msg);
@ -1134,11 +1134,11 @@ int Uart::FindRecvPackage(int bytesRead, char *mUartRecvBuf, char *head) {
strChannelID = strMeasurementID + "-Z";
wave_error_z = true;
}
if(scheduler::instance().WaveError(wave_shortAddr) < 0){
zlog_error(zct, "WaveError error ShortAddr :%s", strShortAddr.c_str());
sprintf(insertSql, "'%s','%s','%s',%d,'%d','%s' ", strChannelID.c_str(),strShortAddr.c_str(),localtimestamp,bytesRead,0,error_msg.c_str());
sqlite_db_ctrl::instance().InsertData(" receive_wave_status ", insertSql);
}
zlog_error(zct, "WaveError error ShortAddr :%s", strShortAddr.c_str());
sprintf(insertSql, "'%s','%s','%s',%d,'%d','%s' ", strChannelID.c_str(),strShortAddr.c_str(),localtimestamp,bytesRead,0,error_msg.c_str());
sqlite_db_ctrl::instance().InsertData(" receive_wave_status ", insertSql);
JsonData jd;
jd.JsonCmd_32(strMeasurementID,1,1,strChannelID,error_msg);
continue;