|
@@ -1475,7 +1475,7 @@ string convertWhere(string mo, string mp, string starttime, string endtime, stri
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!type.empty()) {
|
|
if (!type.empty()) {
|
|
|
- wh += fmt::format(" AND a.type = {}", type);
|
|
|
|
|
|
|
+ wh += fmt::format(" AND type = {}", type);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!no.empty()) {
|
|
if (!no.empty()) {
|
|
@@ -1927,6 +1927,14 @@ int DealGetResistData(const httplib::Request& req, const string token, char** js
|
|
|
for (auto it = dtStartDate; it < odtEnd;)
|
|
for (auto it = dtStartDate; it < odtEnd;)
|
|
|
{
|
|
{
|
|
|
sprintf_s(tablename, 50, "rm_resistance_%04d%02d%02d", it.GetYear(), it.GetMonth(), it.GetDay());
|
|
sprintf_s(tablename, 50, "rm_resistance_%04d%02d%02d", it.GetYear(), it.GetMonth(), it.GetDay());
|
|
|
|
|
+
|
|
|
|
|
+ CString sqlTable = fmt::format("SELECT top 1 imei FROM {}", tablename).c_str();
|
|
|
|
|
+ BOOL ret = CDBConnectPool::Instance()->DBExecuteSQL(sqlTable);
|
|
|
|
|
+ if (TRUE != ret) {
|
|
|
|
|
+ it += COleDateTimeSpan(1, 0, 0, 0);
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (num == 0)
|
|
if (num == 0)
|
|
|
{
|
|
{
|
|
|
sql += fmt::format("SELECT [acquisitiontime],[data0],[data1],[data2] "\
|
|
sql += fmt::format("SELECT [acquisitiontime],[data0],[data1],[data2] "\
|
|
@@ -2015,7 +2023,7 @@ int DealGetResistData(const httplib::Request& req, const string token, char** js
|
|
|
}
|
|
}
|
|
|
time_t tm = ctTime.GetTime() * 1000 + ts.fraction / 1000000;
|
|
time_t tm = ctTime.GetTime() * 1000 + ts.fraction / 1000000;
|
|
|
|
|
|
|
|
-#ifdef SHOW_DATA
|
|
|
|
|
|
|
+//#ifdef SHOW_DATA
|
|
|
{
|
|
{
|
|
|
auto item = yyjson_mut_arr(doc);
|
|
auto item = yyjson_mut_arr(doc);
|
|
|
yyjson_mut_arr_add_val(points1, item);
|
|
yyjson_mut_arr_add_val(points1, item);
|
|
@@ -2034,7 +2042,7 @@ int DealGetResistData(const httplib::Request& req, const string token, char** js
|
|
|
yyjson_mut_arr_add_uint(doc, item, tm);
|
|
yyjson_mut_arr_add_uint(doc, item, tm);
|
|
|
yyjson_mut_arr_add_int(doc, item, sdata2);
|
|
yyjson_mut_arr_add_int(doc, item, sdata2);
|
|
|
}
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
|
+//#endif
|
|
|
|
|
|
|
|
nCount++;
|
|
nCount++;
|
|
|
|
|
|
|
@@ -2082,7 +2090,7 @@ int DealGetResistData(const httplib::Request& req, const string token, char** js
|
|
|
}
|
|
}
|
|
|
tm = ctTime.GetTime() * 1000 + ts.fraction / 1000000;
|
|
tm = ctTime.GetTime() * 1000 + ts.fraction / 1000000;
|
|
|
|
|
|
|
|
-#ifdef SHOW_DATA
|
|
|
|
|
|
|
+//#ifdef SHOW_DATA
|
|
|
if (abs(lastdata0 - sdata0) > nThreshold)
|
|
if (abs(lastdata0 - sdata0) > nThreshold)
|
|
|
{
|
|
{
|
|
|
auto item = yyjson_mut_arr(doc);
|
|
auto item = yyjson_mut_arr(doc);
|
|
@@ -2107,7 +2115,7 @@ int DealGetResistData(const httplib::Request& req, const string token, char** js
|
|
|
yyjson_mut_arr_add_int(doc, item, sdata2);
|
|
yyjson_mut_arr_add_int(doc, item, sdata2);
|
|
|
lastdata2 = sdata2;
|
|
lastdata2 = sdata2;
|
|
|
}
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
|
+//#endif
|
|
|
|
|
|
|
|
nCount++;
|
|
nCount++;
|
|
|
|
|
|
|
@@ -2153,14 +2161,14 @@ int DealGetResistData(const httplib::Request& req, const string token, char** js
|
|
|
sprintf_s(tablename, 50, "rm_move_%04d%02d", it.GetYear(), it.GetMonth());
|
|
sprintf_s(tablename, 50, "rm_move_%04d%02d", it.GetYear(), it.GetMonth());
|
|
|
if (num == 0)
|
|
if (num == 0)
|
|
|
{
|
|
{
|
|
|
- sql = fmt::format("SELECT show_time, curr_val, show_val, posi,type,sunroof FROM {} \
|
|
|
|
|
|
|
+ sql = fmt::format("SELECT show_time, curr_val, show_val, posi,type,sunroof,mark FROM {} \
|
|
|
WHERE mo = '{}' AND mp = '{}' AND show_time >= '{}' AND show_time <= '{}' ",
|
|
WHERE mo = '{}' AND mp = '{}' AND show_time >= '{}' AND show_time <= '{}' ",
|
|
|
tablename, mo, mp, starttime, endtime).c_str();
|
|
tablename, mo, mp, starttime, endtime).c_str();
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
sql += fmt::format(" UNION ALL "\
|
|
sql += fmt::format(" UNION ALL "\
|
|
|
- "SELECT show_time, curr_val, show_val, posi, type,sunroof FROM {} \
|
|
|
|
|
|
|
+ "SELECT show_time, curr_val, show_val, posi, type,sunroof,mark FROM {} \
|
|
|
WHERE mo = '{}' AND mp = '{}' AND show_time >= '{}' AND show_time <= '{}' ",
|
|
WHERE mo = '{}' AND mp = '{}' AND show_time >= '{}' AND show_time <= '{}' ",
|
|
|
tablename, mo, mp, starttime, endtime).c_str();
|
|
tablename, mo, mp, starttime, endtime).c_str();
|
|
|
}
|
|
}
|
|
@@ -2180,6 +2188,7 @@ int DealGetResistData(const httplib::Request& req, const string token, char** js
|
|
|
eDaoChaPosi posi;
|
|
eDaoChaPosi posi;
|
|
|
ePowerName pn;
|
|
ePowerName pn;
|
|
|
uint8_t sunroof;
|
|
uint8_t sunroof;
|
|
|
|
|
+ char mark[255];
|
|
|
|
|
|
|
|
int nCol = 1;
|
|
int nCol = 1;
|
|
|
stmt.BindTimeStampCol(nCol++, &ts);
|
|
stmt.BindTimeStampCol(nCol++, &ts);
|
|
@@ -2188,6 +2197,7 @@ int DealGetResistData(const httplib::Request& req, const string token, char** js
|
|
|
stmt.BindTinyIntCol(nCol++, (BYTE*)&posi);
|
|
stmt.BindTinyIntCol(nCol++, (BYTE*)&posi);
|
|
|
stmt.BindTinyIntCol(nCol++, (BYTE*)&pn);
|
|
stmt.BindTinyIntCol(nCol++, (BYTE*)&pn);
|
|
|
stmt.BindTinyIntCol(nCol++, &sunroof);
|
|
stmt.BindTinyIntCol(nCol++, &sunroof);
|
|
|
|
|
+ stmt.BindCharCol(nCol++, mark, sizeof(mark));
|
|
|
|
|
|
|
|
do
|
|
do
|
|
|
{
|
|
{
|
|
@@ -2196,6 +2206,9 @@ int DealGetResistData(const httplib::Request& req, const string token, char** js
|
|
|
|
|
|
|
|
auto obj = yyjson_mut_obj(doc);
|
|
auto obj = yyjson_mut_obj(doc);
|
|
|
|
|
|
|
|
|
|
+ if ( strcmp(mark, "Ëø±ÕÁ¦:0")==0)
|
|
|
|
|
+ continue;
|
|
|
|
|
+
|
|
|
switch (posi)
|
|
switch (posi)
|
|
|
{
|
|
{
|
|
|
case eDaoChaPosi::DCP_FIX:
|
|
case eDaoChaPosi::DCP_FIX:
|