From b6e8fdb6f9bb50d29aeb29aa62b19a75c9a1ef9d Mon Sep 17 00:00:00 2001 From: hdw <496960745@qq.com> Date: 星期五, 02 十一月 2018 17:31:23 +0800 Subject: [PATCH] Merge branch 'dev_lxw' of https://whychdw@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw --- gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java | 172 +++++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 130 insertions(+), 42 deletions(-) diff --git a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java index b8f1bb6..76b6021 100644 --- a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java +++ b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java @@ -68,10 +68,10 @@ } binf.setBattGroupId(maxb); String sql = "insert into db_battinf.tb_battinf(" + - "StationId,StationName,StationName1,StationName2,StationName3,StationName4,StationIp,FBSDeviceId,FbsDeviceIp,FbsDeviceIp_YM,FbsDeviceIp_WG," + "StationId,StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,FbsDeviceIp,FbsDeviceIp_YM,FbsDeviceIp_WG," + "FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" + ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,DisCurrMax,station_phone" + - ") values('"+binf.getStationId()+"','"+binf.getStationName()+"','"+binf.getStationName1()+"','"+binf.getStationName2()+"','"+binf.getStationName3()+"','"+binf.getStationName4()+ + ") values('"+binf.getStationId()+"','"+binf.getStationName()+"','"+binf.getStationName1()+"','"+binf.getStationName2()+"','"+binf.getStationName3()+"','"+binf.getStationName4()+"','"+binf.getStationName5()+ "','"+binf.getStationIp()+"',"+binf.getFBSDeviceId()+",'"+binf.getFbsDeviceIp()+"','"+binf.getFbsDeviceIp_YM()+"','"+binf.getFbsDeviceIp_WG()+"','"+binf.getFBSDeviceName()+"',"+binf.getGroupIndexInFBSDevice()+ ","+binf.getBattGroupId()+","+binf.getBattGroupNum()+",'"+binf.getBattGroupName()+"',"+binf.getFloatVolLevel()+","+binf.getOfflineVolLevel()+","+binf.getBattFloatCurrent()+ ","+binf.getMonCount()+","+binf.getMonCapStd()+","+binf.getMonVolStd()+","+binf.getMonResStd()+","+binf.getMonSerStd()+","+binf.getMonVolLowToAvg()+ @@ -114,7 +114,7 @@ binf.setStationId(String.valueOf(maxs)); } } - String sql = "update db_battinf.tb_battinf set StationId='"+binf.getStationId()+"',StationName='"+binf.getStationName()+"',StationName1='"+binf.getStationName1()+"',StationName2='"+binf.getStationName2()+"',StationName3='"+binf.getStationName3()+"',StationName4='"+binf.getStationName4()+"',StationIp='"+binf.getStationIp()+"',FBSDeviceId="+binf.getFBSDeviceId()+",FbsDeviceIp='"+binf.getFbsDeviceIp()+"'," + String sql = "update db_battinf.tb_battinf set StationId='"+binf.getStationId()+"',StationName='"+binf.getStationName()+"',StationName1='"+binf.getStationName1()+"',StationName2='"+binf.getStationName2()+"',StationName3='"+binf.getStationName3()+"',StationName4='"+binf.getStationName4()+"',StationName5='"+binf.getStationName5()+"',StationIp='"+binf.getStationIp()+"',FBSDeviceId="+binf.getFBSDeviceId()+",FbsDeviceIp='"+binf.getFbsDeviceIp()+"'," + "FBSDeviceName='"+binf.getFBSDeviceName()+"',GroupIndexInFBSDevice="+binf.getGroupIndexInFBSDevice()+",BattGroupNum="+binf.getBattGroupNum()+",BattGroupName='"+binf.getBattGroupName()+"',FloatVolLevel="+binf.getFloatVolLevel()+",OfflineVolLevel="+binf.getOfflineVolLevel()+",BattFloatCurrent="+binf.getBattFloatCurrent()+"," + "MonCount="+binf.getMonCount()+",MonCapStd="+binf.getMonCapStd()+",monVolStd="+binf.getMonVolStd()+",monResStd="+binf.getMonResStd()+",MonSerStd="+binf.getMonSerStd()+",MonVolLowToAvg="+binf.getMonVolLowToAvg()+",BattProducer='"+binf.getBattProducer()+"',BattModel='"+binf.getBattModel()+"',BattProductDate='"+DAOHelper.sdf.format(binf.getBattProductDate())+"',BattInUseDate='"+DAOHelper.sdf.format(binf.getBattInUseDate())+"', " +" Load_curr="+binf.getLoad_curr()+",DisCurrMax="+binf.getDisCurrMax()+",station_phone='"+binf.getStation_phone()+"' where battgroupId="+binf.getBattGroupId(); @@ -166,14 +166,14 @@ Page page=bmd.getPage(); Connection conn= DBUtil.getConn(); String numberSql=" SELECT FOUND_ROWS() number"; - String sql="select SQL_CALC_FOUND_ROWS distinct(StationId),StationName1,StationName2,StationName3,StationName4,StationIp,FBSDeviceId,FbsDeviceIp_YM,FbsDeviceIp_WG,FbsDeviceIp," + String sql="select SQL_CALC_FOUND_ROWS distinct(StationId),StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,FbsDeviceIp_YM,FbsDeviceIp_WG,FbsDeviceIp," + "FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" + ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,DisCurrMax,station_phone " + " From db_battinf.tb_battinf " + - " Where StationName like ? and StationName1 like ? and StationName2 like ? " + + " Where StationName like ? and StationName1 like ? and StationName2 like ? and StationName5 like ? " + " order by StationId " + " limit ?,?"; - List<BattInf> list=DAOHelper.executeQueryLimit(sql,conn, new Object[]{"%"+binf.getStationName()+"%","%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()},new CallBack() { + List<BattInf> list=DAOHelper.executeQueryLimit(sql,conn, new Object[]{"%"+binf.getStationName()+"%","%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName5()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()},new CallBack() { public List getResults(ResultSet rs) { List list = new ArrayList<BattInf>(); @@ -187,6 +187,7 @@ binf.setStationName2(rs.getString("stationName2")); binf.setStationName3(rs.getString("stationName3")); binf.setStationName4(rs.getString("stationName4")); + binf.setStationName5(rs.getString("stationName5")); binf.setStationIp(rs.getString("stationIp")); binf.setFBSDeviceId(rs.getInt("fBSDeviceId")); @@ -386,11 +387,11 @@ return list; } - //5.3娣诲姞閫夊彇鐢垫睜缁勬垨鑰呮満鎴挎垨鑰呯淮鎶ゅ尯 + //5.3娣诲姞閫夊彇鐢垫睜缁勬垨鑰呮満鎴挎垨鑰呯淮鎶ゅ尯鎴栬�呭叏鍖哄幙 public List serchBatt(Object obj) { BattInf binf=(BattInf) obj; String sql=""; - String baseSql="select distinct(battgroupid),stationid,stationname,stationname1,battgroupname from db_battinf.tb_battinf " + + String baseSql="select distinct(battgroupid),stationid,stationname,stationname1,stationname2,stationname5,battgroupname from db_battinf.tb_battinf " + "where "; //鐢ㄤ簬缁存姢鍖� String station1SqlT=" stationname1!=? ";//鍏ㄩ儴 @@ -407,6 +408,14 @@ baseSql+=station2SqlT; }else{ baseSql+=station2SqlF; + } + //鐢ㄤ簬鍖哄幙 + String station5SqlT=" and stationname5!=? ";//鍏ㄩ儴 + String station5SqlF=" and stationname5=? "; + if(binf.getStationName5().equals("")){ + baseSql+=station5SqlT; + }else{ + baseSql+=station5SqlF; } //鐢ㄤ簬鏈烘埧绔欑偣 String stationSqlT=" and stationname!=? ";//鍏ㄩ儴 @@ -427,7 +436,7 @@ String endSql=" order by stationid "; sql=baseSql+endSql; //System.out.println(sql); - List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationName1(),binf.getStationName2(),binf.getStationName(),binf.getBattGroupId()}, new CallBack() { + List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationName1(),binf.getStationName2(),binf.getStationName5(),binf.getStationName(),binf.getBattGroupId()}, new CallBack() { public List getResults(ResultSet rs) { List list=new ArrayList(); @@ -438,6 +447,8 @@ binf.setStationId(rs.getString("StationId")); binf.setStationName(rs.getString("stationName")); binf.setStationName1(rs.getString("stationName1")); + binf.setStationName2(rs.getString("stationName2")); + binf.setStationName5(rs.getString("stationName5")); binf.setBattGroupName(rs.getString("battGroupName")); list.add(binf); } @@ -1464,7 +1475,7 @@ Connection conn=DBUtil.getConn(); String numberSql=" SELECT FOUND_ROWS() number"; String sql=""; - String baseSql="select SQL_CALC_FOUND_ROWS distinct(db_battinf.tb_battinf.BattgroupId),db_battinf.tb_battinf.stationid,StationName1,StationName,stationip,BattGroupName,BattGroupName1,battgroupnum,moncount,moncapstd,monvolstd,battproducer,battproductdate,battinusedate " + String baseSql="select SQL_CALC_FOUND_ROWS distinct(db_battinf.tb_battinf.BattgroupId),db_battinf.tb_battinf.stationid,StationName1,StationName2,StationName5,StationName,stationip,BattGroupName,BattGroupName1,battgroupnum,moncount,moncapstd,monvolstd,battproducer,battproductdate,battinusedate " + " from db_battinf.tb_battinf " + " where "; //閫夊彇钃勭數姹犵粍鏉′欢 @@ -1482,14 +1493,14 @@ " and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " + " and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " + " and db_user.tb_user_inf.uid=? " + - " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ? )"; + " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ? and db_battinf.tb_battinf.stationname5 like ? )"; baseSql+=userSql; String endSql=" order by StationName1 asc,db_battinf.tb_battinf.BattgroupId asc "; sql=baseSql+endSql; String limitSql=" limit ?,? "; sql+=limitSql; //System.out.println(sql); - List<BattInf> list = DAOHelper.executeQueryLimit(sql,conn,new Object[] {binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, + List<BattInf> list = DAOHelper.executeQueryLimit(sql,conn,new Object[] {binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName5()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() { public List getResults(ResultSet rs) { List list=new ArrayList(); @@ -1500,6 +1511,8 @@ binf.setStationId(rs.getString("stationId")); binf.setStationName(rs.getString("stationName")); binf.setStationName1(rs.getString("stationName1")); + binf.setStationName2(rs.getString("stationName2")); + binf.setStationName5(rs.getString("stationName5")); binf.setStationIp(rs.getString("stationIp")); binf.setBattGroupName(rs.getString("battGroupName")); binf.setBattGroupName1(rs.getString("battGroupName1")); @@ -1665,7 +1678,7 @@ Connection conn=DBUtil.getConn(); String numberSql=" SELECT FOUND_ROWS() number"; String sql=""; - String baseSql=" select SQL_CALC_FOUND_ROWS distinct(db_battinf.tb_battinf.BattgroupId),db_battinf.tb_battinf.stationid,StationName1,StationName,stationip,BattGroupName,BattGroupName1,moncount,moncapstd,monvolstd,battproducer,battproductdate,battinusedate " + + String baseSql=" select SQL_CALC_FOUND_ROWS distinct(db_battinf.tb_battinf.BattgroupId),db_battinf.tb_battinf.stationid,StationName1,StationName2,StationName5,StationName,stationip,BattGroupName,BattGroupName1,moncount,moncapstd,monvolstd,battproducer,battproductdate,battinusedate " + " from db_battinf.tb_battinf " + " where "; //閫夊彇钃勭數姹犵粍鏉′欢 @@ -1683,7 +1696,7 @@ " and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " + " and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " + " and db_user.tb_user_inf.uid=? " + - " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ?)"; + " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ? and db_battinf.tb_battinf.stationname5 like ?) "; baseSql+=userSql; //鎺掑簭 String endSql=" order by db_battinf.tb_battinf.battgroupid asc "; @@ -1693,7 +1706,7 @@ sql=baseSql+endSql+limitSql; //System.out.println(sql); List<BattInf> list=DAOHelper.executeQueryLimit(sql,conn, new Object[]{ - binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%", + binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName5()+"%", (page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() { public List getResults(ResultSet rs) { @@ -1705,6 +1718,8 @@ binf.setBattGroupId(rs.getInt("battGroupId")); binf.setStationId(rs.getString("stationId")); binf.setStationName1(rs.getString("stationName1")); + binf.setStationName2(rs.getString("stationName2")); + binf.setStationName5(rs.getString("stationName5")); binf.setStationName(rs.getString("stationName")); binf.setStationIp(rs.getString("stationIp")); binf.setBattGroupName(rs.getString("battGroupName")); @@ -1884,7 +1899,7 @@ Page page =bmd.getPage(); Batttestdata_inf tinf=bmd.getTdata(); String sql=""; - String baseSql=" select distinct(db_battinf.tb_battinf.BattgroupId),StationName1,StationName,stationip,BattGroupName,BattGroupName1,moncount,moncapstd,monvolstd,battproducer,battproductdate,battinusedate " + + String baseSql=" select distinct(db_battinf.tb_battinf.BattgroupId),StationName1,StationName2,StationName5,StationName,stationip,BattGroupName,BattGroupName1,moncount,moncapstd,monvolstd,battproducer,battproductdate,battinusedate " + " ,db_batt_testdata.tb_batttestdata_inf.test_record_count,test_starttime " + "from db_battinf.tb_battinf,db_batt_testdata.tb_batttestdata_inf " + " where db_battinf.tb_battinf.battgroupid=db_batt_testdata.tb_batttestdata_inf.battgroupid " + @@ -1904,7 +1919,7 @@ " and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " + " and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " + " and db_user.tb_user_inf.uid=? " + - " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ?)"; + " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ? and db_battinf.tb_battinf.stationname5 like ?)"; baseSql+=userSql; //鍏呯數鏀剧數閫夋嫨 String test_typeA="";//鍏ㄩ儴 @@ -1940,7 +1955,7 @@ //System.out.println(sql); List<BattInf> list=DAOHelper.executeQuery(sql,DBUtil.getConn(), new Object[]{ tinf.getRecord_time(),tinf.getRecord_time1() - ,binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%" + ,binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName5()+"%" }, new CallBack() { public List getResults(ResultSet rs) { @@ -1951,6 +1966,8 @@ BattInf binf=new BattInf(); binf.setBattGroupId(rs.getInt("battGroupId")); binf.setStationName1(rs.getString("stationName1")); + binf.setStationName2(rs.getString("stationName2")); + binf.setStationName2(rs.getString("stationName5")); binf.setStationName(rs.getString("stationName")); binf.setStationIp(rs.getString("stationIp")); binf.setBattGroupName(rs.getString("battGroupName")); @@ -3407,16 +3424,75 @@ } ); return list; } - //鏌ヨ绠$悊鐨勬満鎴�(宸︿晶瀵艰埅绗笁灞傦紝鏌ユ墍鏈夌殑鏈烘埧,num涓瓨鏀緐id) - public List serchStationName3(Object obj){ + //鏌ヨ绠$悊鐨勫幙/鍖�(宸︿晶瀵艰埅绗笁灞傦紝鏌ユ墍鏈夌殑鍘�/鍖�) + public List serchStationName5(Object obj){ BattInf binf=(BattInf) obj; - String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,stationid,fbsdeviceid,FBSDeviceName " + + String sql="select DISTINCT stationName5,StationName1,StationName2 " + " FROM db_battinf.tb_battinf " + " where StationId in(" + " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id and db_user.tb_user_battgroup_baojigroup_usr.uId=?" + " ) and StationName1 like ? and StationName2 like ? " + " ORDER BY CONVERT( StationName USING gbk ) COLLATE gbk_chinese_ci ASC "; + //System.out.println(sql); List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%"},new CallBack() { + + public List getResults(ResultSet rs) { + List list=new ArrayList(); + try { + while(rs.next()){ + BattInf batt = new BattInf(); + batt.setStationName1(rs.getString("stationName1")); + batt.setStationName2(rs.getString("stationName2")); + batt.setStationName5(rs.getString("stationName5")); + list.add(batt); + } + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return list; + } + } ); + return list; + } + //鏌ヨ绠$悊鐨勫幙/鍖�(宸︿晶瀵艰埅绗笁灞傦紝鏌ユ墍鏈夌殑鍘�/鍖�) + public List serchStationName5_all(Object obj){ + BattInf binf=(BattInf) obj; + String sql="select DISTINCT stationName5,StationName1,StationName2 " + + " FROM db_battinf.tb_battinf " + + " where StationName1 like ? and StationName2 like ? " + + " ORDER BY CONVERT( StationName USING gbk ) COLLATE gbk_chinese_ci ASC "; + List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%"},new CallBack() { + + public List getResults(ResultSet rs) { + List list=new ArrayList(); + try { + while(rs.next()){ + BattInf batt = new BattInf(); + batt.setStationName1(rs.getString("stationName1")); + batt.setStationName2(rs.getString("stationName2")); + batt.setStationName5(rs.getString("stationName5")); + list.add(batt); + } + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return list; + } + } ); + return list; + } + //鏌ヨ绠$悊鐨勬満鎴�(宸︿晶瀵艰埅绗洓灞傦紝鏌ユ墍鏈夌殑鏈烘埧,num涓瓨鏀緐id) + public List serchStationName3(Object obj){ + BattInf binf=(BattInf) obj; + String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,StationName5,stationid,fbsdeviceid,FBSDeviceName " + + " FROM db_battinf.tb_battinf " + + " where StationId in(" + + " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id and db_user.tb_user_battgroup_baojigroup_usr.uId=?" + + " ) and StationName1 like ? and StationName2 like ? and StationName5 like ? " + + " ORDER BY CONVERT( StationName USING gbk ) COLLATE gbk_chinese_ci ASC "; + List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName5()+"%"},new CallBack() { public List getResults(ResultSet rs) { List list=new ArrayList(); @@ -3427,6 +3503,7 @@ batt.setStationName1(rs.getString("stationName1")); batt.setStationName2(rs.getString("stationName2")); batt.setStationName3(rs.getString("stationName3")); + batt.setStationName5(rs.getString("stationName5")); batt.setStationId(rs.getString("stationId")); batt.setFBSDeviceName(rs.getString("fBSDeviceName")); batt.setFBSDeviceId(rs.getInt("fBSDeviceId")); @@ -3441,14 +3518,14 @@ } ); return list; } - //鏌ヨ绠$悊鐨勬満鎴�(宸︿晶瀵艰埅绗笁灞傦紝鏌ユ墍鏈夌殑鏈烘埧) + //鏌ヨ绠$悊鐨勬満鎴�(宸︿晶瀵艰埅绗洓灞傦紝鏌ユ墍鏈夌殑鏈烘埧) public List serchStationName3_all(Object obj){ BattInf binf=(BattInf) obj; - String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,stationid,fbsdeviceid,FBSDeviceName " + + String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,StationName5,stationid,fbsdeviceid,FBSDeviceName " + " FROM db_battinf.tb_battinf " + - " where StationName1 like ? and StationName2 like ? " + + " where StationName1 like ? and StationName2 like ? and StationName5 like ? " + " ORDER BY CONVERT( StationName USING gbk ) COLLATE gbk_chinese_ci ASC "; - List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%"},new CallBack() { + List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName5()+"%"},new CallBack() { public List getResults(ResultSet rs) { List list=new ArrayList(); @@ -3459,6 +3536,7 @@ batt.setStationName1(rs.getString("stationName1")); batt.setStationName2(rs.getString("stationName2")); batt.setStationName3(rs.getString("stationName3")); + batt.setStationName5(rs.getString("stationName5")); batt.setStationId(rs.getString("stationId")); batt.setFBSDeviceName(rs.getString("fBSDeviceName")); batt.setFBSDeviceId(rs.getInt("fBSDeviceId")); @@ -3475,11 +3553,11 @@ } - //鏍规嵁鏈烘埧id鏌ヨ鏈烘埧涓嬬殑鐢垫睜缁勪俊鎭�(宸︿晶瀵艰埅绗洓灞�,鏍规嵁鏈烘埧鏌ヨ涓嬮潰鐨勭數姹犵粍,num涓瓨鏀緐id) + //鏍规嵁鏈烘埧id鏌ヨ鏈烘埧涓嬬殑鐢垫睜缁勪俊鎭�(宸︿晶瀵艰埅绗簲灞�,鏍规嵁鏈烘埧鏌ヨ涓嬮潰鐨勭數姹犵粍,num涓瓨鏀緐id) public List serchBattByStation(Object obj){ BattInf binf=(BattInf) obj; - String sql="select DISTINCT StationName,StationName1,StationName2,StationId,StationIP,FBSDeviceId,BattGroupName,BattGroupName1,BattGroupName2,MonCount,battgroupId,MonCapStd,MonVolStd,MonResStd,MonSerStd,BattProducer,BattInUseDate,GroupIndexInFBSDevice,Load_curr,DisCurrMax " + - "from db_battinf.tb_battinf where StationName1 like ? and StationName2 like ? and StationName like ? "; + String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,StationName5,StationId,stationid_ex,StationIP,FBSDeviceId,BattGroupName,BattGroupName1,BattGroupName2,MonCount,battgroupId,MonCapStd,MonVolStd,MonResStd,MonSerStd,BattProducer,BattInUseDate,GroupIndexInFBSDevice,Load_curr,DisCurrMax " + + "from db_battinf.tb_battinf where StationName1 like ? and StationName2 like ? and StationName like ? and StationName5 like ? "; //鏈烘埧id String idSqlT=" and Stationid like ? "; sql+=idSqlT; @@ -3492,7 +3570,7 @@ String orderSql=" ORDER BY StationName1,battgroupId "; sql+=orderSql; //System.out.println(sql); - List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName()+"%","%"+binf.getStationId()+"%",binf.getNum()},new CallBack() { + List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName5()+"%","%"+binf.getStationId()+"%",binf.getNum()},new CallBack() { public List getResults(ResultSet rs) { List list = new ArrayList(); @@ -3502,7 +3580,10 @@ batt.setStationName(rs.getString("stationName")); batt.setStationName1(rs.getString("stationName1")); batt.setStationName2(rs.getString("stationName2")); + batt.setStationName3(rs.getString("stationName3")); + batt.setStationName5(rs.getString("stationName5")); batt.setStationId(rs.getString("StationId")); + batt.setStationId_ex(rs.getString("stationId_ex")); batt.setStationIp(rs.getString("StationIP")); batt.setBattGroupName(rs.getString("BattGroupName").trim()); batt.setBattGroupName1(rs.getString("BattGroupName1").trim()); @@ -3529,11 +3610,11 @@ }); return list; } - //鏍规嵁鏈烘埧id鏌ヨ鏈烘埧涓嬬殑鐢垫睜缁勪俊鎭�(宸︿晶瀵艰埅绗洓灞�,鏍规嵁鏈烘埧鏌ヨ涓嬮潰鐨勭數姹犵粍,num涓瓨鏀緐id) + //鏍规嵁鏈烘埧id鏌ヨ鏈烘埧涓嬬殑鐢垫睜缁勪俊鎭�(宸︿晶瀵艰埅绗簲灞�,鏍规嵁鏈烘埧鏌ヨ涓嬮潰鐨勭數姹犵粍,num涓瓨鏀緐id) public List serchBattByStation_all(Object obj){ BattInf binf=(BattInf) obj; - String sql="select DISTINCT StationName,StationId,StationIP,FBSDeviceId,BattGroupName,BattGroupName1,BattGroupName2,MonCount,battgroupId,MonCapStd,MonVolStd,MonResStd,MonSerStd,BattProducer,BattInUseDate,GroupIndexInFBSDevice " + - "from db_battinf.tb_battinf where StationName1 like ? and StationName2 like ? and StationName like ? "; + String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationId,StationIP,FBSDeviceId,BattGroupName,BattGroupName1,BattGroupName2,MonCount,battgroupId,MonCapStd,MonVolStd,MonResStd,MonSerStd,BattProducer,BattInUseDate,GroupIndexInFBSDevice " + + "from db_battinf.tb_battinf where StationName1 like ? and StationName2 like ? and StationName like ? and StationName5 like ? "; //鏈烘埧id String idSqlT=" and Stationid like ? "; sql+=idSqlT; @@ -3546,7 +3627,7 @@ String orderSql=" ORDER BY StationName1,battgroupId "; sql+=orderSql; //System.out.println(sql); - List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName()+"%","%"+binf.getStationId()+"%"},new CallBack() { + List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName5()+"%","%"+binf.getStationId()+"%"},new CallBack() { public List getResults(ResultSet rs) { List list = new ArrayList(); @@ -3554,6 +3635,10 @@ while (rs.next()) { BattInf batt = new BattInf(); batt.setStationName(rs.getString("stationName")); + batt.setStationName1(rs.getString("stationName1")); + batt.setStationName2(rs.getString("stationName2")); + batt.setStationName3(rs.getString("stationName3")); + batt.setStationName5(rs.getString("stationName5")); batt.setStationId(rs.getString("StationId")); batt.setStationIp(rs.getString("StationIP")); batt.setBattGroupName(rs.getString("BattGroupName").trim()); @@ -3667,12 +3752,12 @@ //鐢垫睜閰嶇粍绠$悊(閲嶈) public List serchMakeGroup(Object obj){ BattInf binf=(BattInf) obj; - String sql="SELECT distinct BattGroupId,battgroupname,stationid,stationname1,stationname2,stationname,stationname3,BattProducer,MonVolStd,MonCapStd,monCount " + + String sql="SELECT distinct BattGroupId,battgroupname,stationid,stationname1,stationname2,stationname5,stationname,stationname3,BattProducer,MonVolStd,MonCapStd,monCount " + " ,battinf_re.old_stationname,old_battgroupname,old_battproducer,old_stationid,old_battgroupid,old_monum,new_stationname,new_battgroupname,new_battproducer,new_stationid,new_battgroupid,new_monum,rebuild_time,rebuild_uid,rebuild_address,rebuild_clear_type " + " from db_battinf.tb_battinf " + " left outer join (select * from db_battinf.tb_battinf_rebuild where tb_battinf_rebuild.rebuild_clear_type=1 ) as battinf_re " + " on BattGroupId=battinf_re.new_battgroupid or BattGroupId=battinf_re.old_battgroupid " + - " where stationname2 like ? "; + " where stationname2 like ? and stationname5 like ? "; //鐢ㄦ埛绠$悊 String userSql=" and StationId in(" + " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id and db_user.tb_user_battgroup_baojigroup_usr.uId=?" + @@ -3686,7 +3771,7 @@ }else{ sql+=producerSqlF; } - List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%",binf.getNum()}, new CallBack() { + List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%","%"+binf.getStationName5()+"%",binf.getNum()}, new CallBack() { public List getResults(ResultSet rs) { List<BattInf> list=new ArrayList(); @@ -3701,6 +3786,7 @@ binf.setStationName1(rs.getString("stationName1")); binf.setStationName2(rs.getString("stationName2")); binf.setStationName3(rs.getString("stationName3")); + binf.setStationName5(rs.getString("stationName5")); binf.setBattProducer(rs.getString("battProducer")); binf.setMonVolStd(rs.getFloat("monVolStd")); binf.setMonCapStd(rs.getFloat("monCapStd")); @@ -3747,18 +3833,18 @@ //鐢垫睜閰嶇粍绠$悊(閲嶈) public List serchGroupByInfor(Object obj){ BattInf binf=(BattInf) obj; - String sql="SELECT distinct BattGroupId,battgroupname,stationid,stationname1,stationname2,stationname,stationname3,BattProducer,MonVolStd,MonCapStd,monCount " + + String sql="SELECT distinct BattGroupId,battgroupname,stationid,stationname1,stationname2,stationname,stationname3,stationname5,BattProducer,MonVolStd,MonCapStd,monCount " + " ,battinf_re.old_stationname,old_battgroupname,old_battproducer,old_stationid,old_battgroupid,old_monum,new_stationname,new_battgroupname,new_battproducer,new_stationid,new_battgroupid,new_monum,rebuild_time,rebuild_uid,rebuild_address,rebuild_clear_type " + " from db_battinf.tb_battinf " + " left outer join (select * from db_battinf.tb_battinf_rebuild where tb_battinf_rebuild.rebuild_clear_type=1 ) as battinf_re " + " on BattGroupId=battinf_re.new_battgroupid or BattGroupId=battinf_re.old_battgroupid " + - " where stationname1 like ? and stationname2 like ? and stationname3 like ? and battgroupname like ? and battgroupid=? "; + " where stationname1 like ? and stationname2 like ? and stationname3 like ? and stationname5 like ? and battgroupname like ? and battgroupid=? "; //鐢ㄦ埛绠$悊 String userSql=" and StationId in(" + " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id and db_user.tb_user_battgroup_baojigroup_usr.uId=?" + " ) "; sql+=userSql; - List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getBattGroupName()+"%",binf.getBattGroupId(),binf.getNum()}, new CallBack() { + List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationName5()+"%","%"+binf.getBattGroupName()+"%",binf.getBattGroupId(),binf.getNum()}, new CallBack() { public List getResults(ResultSet rs) { List<BattInf> list=new ArrayList(); @@ -3773,6 +3859,7 @@ binf.setStationName1(rs.getString("stationName1")); binf.setStationName2(rs.getString("stationName2")); binf.setStationName3(rs.getString("stationName3")); + binf.setStationName5(rs.getString("stationName5")); binf.setBattProducer(rs.getString("battProducer")); binf.setMonVolStd(rs.getFloat("monVolStd")); binf.setMonCapStd(rs.getFloat("monCapStd")); @@ -3857,10 +3944,11 @@ //List<BattInf> list=biml.serchGroupAssess(bmd); //List<BattInf> list=biml.serchMakeGroup(binf); //List<BattInf> list=biml.serchGroupByInfor(binf); - List<BattInf> list=biml.searchInform1(bmd); - for (BattInf b : list) { + //List<BattInf> list=biml.searchInform1(bmd); + List<BattInf> list=biml.serchStationName5(binf); + /*for (BattInf b : list) { System.out.println(b); - } + }*/ System.out.println(list.size()); } -- Gitblit v1.9.1