Authored by simba

update

... ... @@ -54,7 +54,7 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper {
command.append("where hostIp='"+hostIp+"'");
}
String time=(String)page.getParams().get("time");
if(StringUtils.isNotBlank(hostIp)){
if(StringUtils.isNotBlank(time)){
if(flag==1){
command.append(" and time>'"+time+"'");
}else{
... ... @@ -62,11 +62,11 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper {
}
}
String isLive=(String)page.getParams().get("isLive");
if(StringUtils.isNotBlank(hostIp)){
if(StringUtils.isNotBlank(isLive)){
if(flag==1){
command.append(" and time="+isLive);
command.append(" and isLive="+isLive);
}else{
command.append("where and time="+isLive);
command.append("where and isLive="+isLive);
}
}
InfluxDBModel influxDBModel= inluxDBSingle.getInfluxDBByName(InfluxDBContants.ALARM);
... ... @@ -77,7 +77,7 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper {
@Override
public List<List<Object>> selectZkInfosByCodition(PageBean page) {
StringBuffer command=new StringBuffer();
command.append("SELECT hostIp,isLive,time FROM "+InfluxDBContants.ZOOKEEPER_ALARM) ;
command.append("SELECT hostIp,isLive,time FROM " + InfluxDBContants.ZOOKEEPER_ALARM) ;
String hostIp=(String)page.getParams().get("hostIP");
int flag=0;
if(StringUtils.isNotBlank(hostIp)){
... ... @@ -85,7 +85,7 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper {
command.append("where hostIp='"+hostIp+"'");
}
String time=(String)page.getParams().get("time");
if(StringUtils.isNotBlank(hostIp)){
if(StringUtils.isNotBlank(time)){
if(flag==1){
command.append(" and time>'"+time+"'");
}else{
... ... @@ -93,11 +93,11 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper {
}
}
String isLive=(String)page.getParams().get("isLive");
if(StringUtils.isNotBlank(hostIp)){
if(StringUtils.isNotBlank(isLive)){
if(flag==1){
command.append(" and time="+isLive);
command.append(" and isLive="+isLive);
}else{
command.append("where and time="+isLive);
command.append("where and isLive="+isLive);
}
}
command.append(" ORDER BY time DESC LIMIT " + page.getPageSize() + " OFFSET " + page.getStartIndex());
... ...
... ... @@ -13,4 +13,6 @@ public class ZkInfoReq extends PageRequest {
private String recordTime;
private int isLive;
}
... ...