sql="select ts as time,nm as monitorId,v as monitorValue from "+countTableName+"_count where nm in("+fieldSqlPart+") and ts>=? and ts <? ";
}
//日数据
if(tableType.equals("2")){
sql="select aaa.date as time , aaa.monitorId ,SUM( to_number ( aaa.monitorValue, '9999999999999999.99' ) )as monitorValue from (";
sql+="select to_char(to_timestamp(ts::INT8)::DATE,'YYYY-MM-DD') as date, ts as time,nm as monitorId,v as monitorValue from "+countTableName+"_count where nm in("+fieldSqlPart+") and ts>=? and ts <? ";
sql+=" )aaa group by aaa.date ,aaa.monitorId order by aaa.date asc";
}
//月数据
if(tableType.equals("3")){
sql="select aaa.date as time , aaa.monitorId ,SUM( to_number ( aaa.monitorValue, '9999999999999999.99' ) )as monitorValue from (";
sql+="select to_char(to_timestamp(ts::INT8)::DATE,'YYYY-MM') as date, ts as time,nm as monitorId,v as monitorValue from "+countTableName+"_count where nm in("+fieldSqlPart+") and ts>=? and ts <? ";
sql+=" )aaa group by aaa.date ,aaa.monitorId order by aaa.date asc";