Authored by simba

update

@@ -54,7 +54,7 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper { @@ -54,7 +54,7 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper {
54 command.append("where hostIp='"+hostIp+"'"); 54 command.append("where hostIp='"+hostIp+"'");
55 } 55 }
56 String time=(String)page.getParams().get("time"); 56 String time=(String)page.getParams().get("time");
57 - if(StringUtils.isNotBlank(hostIp)){ 57 + if(StringUtils.isNotBlank(time)){
58 if(flag==1){ 58 if(flag==1){
59 command.append(" and time>'"+time+"'"); 59 command.append(" and time>'"+time+"'");
60 }else{ 60 }else{
@@ -62,11 +62,11 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper { @@ -62,11 +62,11 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper {
62 } 62 }
63 } 63 }
64 String isLive=(String)page.getParams().get("isLive"); 64 String isLive=(String)page.getParams().get("isLive");
65 - if(StringUtils.isNotBlank(hostIp)){ 65 + if(StringUtils.isNotBlank(isLive)){
66 if(flag==1){ 66 if(flag==1){
67 - command.append(" and time="+isLive); 67 + command.append(" and isLive="+isLive);
68 }else{ 68 }else{
69 - command.append("where and time="+isLive); 69 + command.append("where and isLive="+isLive);
70 } 70 }
71 } 71 }
72 InfluxDBModel influxDBModel= inluxDBSingle.getInfluxDBByName(InfluxDBContants.ALARM); 72 InfluxDBModel influxDBModel= inluxDBSingle.getInfluxDBByName(InfluxDBContants.ALARM);
@@ -77,7 +77,7 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper { @@ -77,7 +77,7 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper {
77 @Override 77 @Override
78 public List<List<Object>> selectZkInfosByCodition(PageBean page) { 78 public List<List<Object>> selectZkInfosByCodition(PageBean page) {
79 StringBuffer command=new StringBuffer(); 79 StringBuffer command=new StringBuffer();
80 - command.append("SELECT hostIp,isLive,time FROM "+InfluxDBContants.ZOOKEEPER_ALARM) ; 80 + command.append("SELECT hostIp,isLive,time FROM " + InfluxDBContants.ZOOKEEPER_ALARM) ;
81 String hostIp=(String)page.getParams().get("hostIP"); 81 String hostIp=(String)page.getParams().get("hostIP");
82 int flag=0; 82 int flag=0;
83 if(StringUtils.isNotBlank(hostIp)){ 83 if(StringUtils.isNotBlank(hostIp)){
@@ -85,7 +85,7 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper { @@ -85,7 +85,7 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper {
85 command.append("where hostIp='"+hostIp+"'"); 85 command.append("where hostIp='"+hostIp+"'");
86 } 86 }
87 String time=(String)page.getParams().get("time"); 87 String time=(String)page.getParams().get("time");
88 - if(StringUtils.isNotBlank(hostIp)){ 88 + if(StringUtils.isNotBlank(time)){
89 if(flag==1){ 89 if(flag==1){
90 command.append(" and time>'"+time+"'"); 90 command.append(" and time>'"+time+"'");
91 }else{ 91 }else{
@@ -93,11 +93,11 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper { @@ -93,11 +93,11 @@ public class ZkMapper extends InfluxDBQuery implements IZkMapper {
93 } 93 }
94 } 94 }
95 String isLive=(String)page.getParams().get("isLive"); 95 String isLive=(String)page.getParams().get("isLive");
96 - if(StringUtils.isNotBlank(hostIp)){ 96 + if(StringUtils.isNotBlank(isLive)){
97 if(flag==1){ 97 if(flag==1){
98 - command.append(" and time="+isLive); 98 + command.append(" and isLive="+isLive);
99 }else{ 99 }else{
100 - command.append("where and time="+isLive); 100 + command.append("where and isLive="+isLive);
101 } 101 }
102 } 102 }
103 command.append(" ORDER BY time DESC LIMIT " + page.getPageSize() + " OFFSET " + page.getStartIndex()); 103 command.append(" ORDER BY time DESC LIMIT " + page.getPageSize() + " OFFSET " + page.getStartIndex());
@@ -13,4 +13,6 @@ public class ZkInfoReq extends PageRequest { @@ -13,4 +13,6 @@ public class ZkInfoReq extends PageRequest {
13 13
14 private String recordTime; 14 private String recordTime;
15 15
  16 + private int isLive;
  17 +
16 } 18 }