diff --git a/jsonparse/web_cmd_parse3.cpp b/jsonparse/web_cmd_parse3.cpp index c6d2f72..0f55857 100644 --- a/jsonparse/web_cmd_parse3.cpp +++ b/jsonparse/web_cmd_parse3.cpp @@ -1121,9 +1121,9 @@ std::string JsonData::JsonCmd_Cgi_65(Param_65 ¶m){ memset(count_sql,0,sizeof(count_sql)); snprintf(count_sql,sizeof(count_sql), "SELECT " - "COUNT(*) FILTER (WHERE channelID = '%s-X' and nodeResend = 0 AS recive_feature," - "COUNT(*) FILTER (WHERE channelID = '%s-X' and sendMsg = 1 and nodeResend = 0 ) AS send_feature " - "COUNT(*) FILTER (WHERE channelID = '%s-X' and nodeResend <> 0) AS send_feature " + "COUNT(*) FILTER (WHERE channelID = '%s-X' and nodeResend = 0 ) AS recive_feature," + "COUNT(*) FILTER (WHERE channelID = '%s-X' and sendMsg = 1 and nodeResend = 0 ) AS send_feature, " + "COUNT(*) FILTER (WHERE channelID = '%s-X' and nodeResend <> 0) AS resend_feature " "FROM ( " "SELECT * FROM %s " "WHERE timeStamp BETWEEN '%s' AND '%s');",MeasurementID.c_str(),MeasurementID.c_str(),MeasurementID.c_str(),szTableName,param.timeStart.c_str(),param.timeEnd.c_str()); @@ -1141,8 +1141,8 @@ std::string JsonData::JsonCmd_Cgi_65(Param_65 ¶m){ "SELECT " "COUNT(*) FILTER (WHERE data_nodeno = '%s-X') AS recive_x," "COUNT(*) FILTER (WHERE data_nodeno = '%s-Y') AS recive_y," - "COUNT(*) FILTER (WHERE data_nodeno = '%s-Z') AS recive_z " - "COUNT(*) FILTER (WHERE data_nodeno = '%s-Z' and resend is not null) AS resend_z " + "COUNT(*) FILTER (WHERE data_nodeno = '%s-Z') AS recive_z, " + "COUNT(*) FILTER (WHERE data_nodeno = '%s-Z' and resend is NOT NULL and resend <> '') AS resend_z " "FROM ( " "SELECT * FROM receive_wave_status " "WHERE error_code = 1 and timeStamp BETWEEN '%s' AND '%s');",MeasurementID.c_str(),MeasurementID.c_str(),MeasurementID.c_str(),MeasurementID.c_str(),param.timeStart.c_str(),param.timeEnd.c_str()); @@ -1195,15 +1195,14 @@ std::string JsonData::JsonCmd_Cgi_65(Param_65 ¶m){ iTem.append(0); iTem.append(0); iTem.append(0); - iTem.append(resend_feature); - iTem.append(resend_z); std::vector vRssi; boost::split(vRssi, vetRes[i][2], boost::is_any_of(","), boost::token_compress_on); if (vRssi.size() > 0 ){ iTem.append(atof(vRssi[0].c_str())/float(255)); iTem.append(atof(vRssi[1].c_str())/float(255)); } - + iTem.append(resend_feature); + iTem.append(resend_z); jsBody.append(iTem); }