From c51674f412a53fc9eb6a9453fc3ac4a6ffd89a1d Mon Sep 17 00:00:00 2001
From: 81041 <81041@192.168.10.31>
Date: 星期三, 31 十月 2018 10:37:00 +0800
Subject: [PATCH] 电池充放电数据管理加省市结果

---
 gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java |   35 ++++++++++++++---------------------
 1 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
index ec264df..6c4d8ba 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"));
 						
@@ -3410,12 +3411,13 @@
 	//鏌ヨ绠$悊鐨勫幙/鍖�(宸︿晶瀵艰埅绗笁灞傦紝鏌ユ墍鏈夌殑鍘�/鍖�)
 	public List serchStationName5(Object obj){
 		BattInf binf=(BattInf) obj;
-		String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,stationName5,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) {
@@ -3423,14 +3425,9 @@
 					try {
 						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.setFBSDeviceName(rs.getString("fBSDeviceName"));
-							batt.setFBSDeviceId(rs.getInt("fBSDeviceId"));
 							list.add(batt);
 						}
 					} catch (SQLException e) {
@@ -3445,7 +3442,7 @@
 	//鏌ヨ绠$悊鐨勫幙/鍖�(宸︿晶瀵艰埅绗笁灞傦紝鏌ユ墍鏈夌殑鍘�/鍖�)
 	public List serchStationName5_all(Object obj){
 		BattInf binf=(BattInf) obj;
-		String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,stationName5,stationid,fbsdeviceid,FBSDeviceName  " +
+		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 ";
@@ -3456,14 +3453,9 @@
 					try {
 						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.setFBSDeviceName(rs.getString("fBSDeviceName"));
-							batt.setFBSDeviceId(rs.getInt("fBSDeviceId"));
 							list.add(batt);
 						}
 					} catch (SQLException e) {
@@ -3934,10 +3926,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