@@ -203,9 +203,12 @@ namespace TimedUpload.QuartzJobs
sqlMeterHis += ",开度,运行模式,手动开度设定值,压力量程设定,常用压力设定,阀门调整间隔";
}
sqlMeterHis +=" from " + tablename;
- if (uploadHis.ContainsKey(meterCode))
+ if (uploadHis.ContainsKey(meterCode)) // 添加是否在线的判断
{
- sqlMeterHis += " where 采集时间 > '" + uploadHis[meterCode] + "'";
+ sqlMeterHis += " where 设备状态 = '全部正常' AND 通讯状态 = '全部正常' AND 采集时间 > '" + uploadHis[meterCode] + "'";
+ }
+ else { // 添加是否在线的判断
+ sqlMeterHis += "WHERE 设备状态 = '全部正常' AND 通讯状态 = '全部正常'"
sqlMeterHis += " order by 采集时间";
DataTable dtMeterHis = dbHelper.Fill(sqlMeterHis);