...
|
...
|
@@ -47,18 +47,18 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper { |
|
|
public int selectCountByCodition(PageBean page) {
|
|
|
StringBuffer command=new StringBuffer();
|
|
|
command.append("SELECT COUNT(hostIp) FROM " + InfluxDBContants.ZOOKEEPER_ALARM) ;
|
|
|
String hostIp=(String)page.getParams().get("hostIP");
|
|
|
String hostIp=(String)page.getParams().get("hostIp");
|
|
|
int flag=0;
|
|
|
if(StringUtils.isNotBlank(hostIp)){
|
|
|
flag=1;
|
|
|
command.append("where hostIp='"+hostIp+"'");
|
|
|
command.append(" where hostIp='"+hostIp+"'");
|
|
|
}
|
|
|
String time=(String)page.getParams().get("time");
|
|
|
if(StringUtils.isNotBlank(time)){
|
|
|
String recordTime=(String)page.getParams().get("recordTime");
|
|
|
if(StringUtils.isNotBlank(recordTime)){
|
|
|
if(flag==1){
|
|
|
command.append(" and time>'"+time+"'");
|
|
|
command.append(" and time>'"+recordTime+"'");
|
|
|
}else{
|
|
|
command.append(" where time>'"+time+"'");
|
|
|
command.append(" where time>'"+recordTime+"'");
|
|
|
}
|
|
|
}
|
|
|
String isLive=(String)page.getParams().get("isLive");
|
...
|
...
|
@@ -66,7 +66,7 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper { |
|
|
if(flag==1){
|
|
|
command.append(" and isLive="+isLive);
|
|
|
}else{
|
|
|
command.append("where and isLive="+isLive);
|
|
|
command.append(" where isLive="+isLive);
|
|
|
}
|
|
|
}
|
|
|
InfluxDBModel influxDBModel= inluxDBSingle.getInfluxDBByName(InfluxDBContants.ALARM);
|
...
|
...
|
@@ -78,18 +78,18 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper { |
|
|
public List<List<Object>> selectZkInfosByCodition(PageBean page) {
|
|
|
StringBuffer command=new StringBuffer();
|
|
|
command.append("SELECT hostIp,isLive,time FROM " + InfluxDBContants.ZOOKEEPER_ALARM) ;
|
|
|
String hostIp=(String)page.getParams().get("hostIP");
|
|
|
String hostIp=(String)page.getParams().get("hostIp");
|
|
|
int flag=0;
|
|
|
if(StringUtils.isNotBlank(hostIp)){
|
|
|
flag=1;
|
|
|
command.append("where hostIp='"+hostIp+"'");
|
|
|
command.append(" where hostIp='"+hostIp+"'");
|
|
|
}
|
|
|
String time=(String)page.getParams().get("time");
|
|
|
if(StringUtils.isNotBlank(time)){
|
|
|
String recordTime=(String)page.getParams().get("recordTime");
|
|
|
if(StringUtils.isNotBlank(recordTime)){
|
|
|
if(flag==1){
|
|
|
command.append(" and time>'"+time+"'");
|
|
|
command.append(" and time>'"+recordTime+"'");
|
|
|
}else{
|
|
|
command.append(" where time>'"+time+"'");
|
|
|
command.append(" where time>'"+recordTime+"'");
|
|
|
}
|
|
|
}
|
|
|
String isLive=(String)page.getParams().get("isLive");
|
...
|
...
|
@@ -97,7 +97,7 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper { |
|
|
if(flag==1){
|
|
|
command.append(" and isLive="+isLive);
|
|
|
}else{
|
|
|
command.append("where and isLive="+isLive);
|
|
|
command.append(" where isLive="+isLive);
|
|
|
}
|
|
|
}
|
|
|
command.append(" ORDER BY time DESC LIMIT " + page.getPageSize() + " OFFSET " + page.getStartIndex());
|
...
|
...
|
|