From eec8a33340e2f3ae8bc09362e3912c88a8d59b27 Mon Sep 17 00:00:00 2001
From: hdw <496960745@qq.com>
Date: 星期三, 31 十月 2018 10:59:18 +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 |  270 +++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 236 insertions(+), 34 deletions(-)

diff --git a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
index a3e889b..6c4d8ba 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
@@ -43,7 +43,7 @@
 import com.fgkj.services.User_logService;
 
 public class BattInfImpl implements BaseDAO, CallBack {
-    //娣诲姞鏂扮殑鐢垫睜缁�(澶氫釜)
+	//娣诲姞鏂扮殑鐢垫睜缁�(澶氫釜)
 	public boolean add(Object obj) {
 		List<BattInf> list=(List<BattInf>) obj;
 		ArrayList<String> sql_str=new ArrayList();
@@ -68,14 +68,14 @@
 				}
 				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" +
-						") values('"+binf.getStationId()+"','"+binf.getStationName()+"','"+binf.getStationName1()+"','"+binf.getStationName2()+"','"+binf.getStationName3()+"','"+binf.getStationName4()+
+						",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()+"','"+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()+
-						",'"+binf.getBattProducer()+"','"+binf.getBattModel()+"','"+DAOHelper.sdf.format(binf.getBattProductDate())+"','"+DAOHelper.sdf.format(binf.getBattInUseDate())+"')";
+						",'"+binf.getBattProducer()+"','"+binf.getBattModel()+"','"+DAOHelper.sdf.format(binf.getBattProductDate())+"','"+DAOHelper.sdf.format(binf.getBattInUseDate())+"',"+binf.getLoad_curr()+","+binf.getDisCurrMax()+",'"+binf.getStation_phone()+"')";
 				
 				if(binf.getStationId().equals(maxs)){
 					maxs++;
@@ -114,10 +114,10 @@
 						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())+"' "
-						 +" where battgroupId="+binf.getBattGroupId();
+						  "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();
 				sql_str.add(sql);
 				{
 					String msg="淇敼"+binf.getStationName()+"鏈烘埧"+binf.getBattGroupId()+"鐢垫睜缁勭殑淇℃伅";
@@ -159,21 +159,21 @@
 		Boolean bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
 		return bl;
 	}
-    //鏍规嵁缁存姢鍖哄拰鏈烘埧鍚嶇О鏌ヨ鐢垫睜缁勪俊鎭�
+    //鏍规嵁缁存姢鍖哄拰鏈烘埧鍚嶇О鏌ヨ鐢垫睜缁勪俊鎭�(鐢垫睜缁勪俊鎭厤缃�)
 	public List searchInform(Object obj){
 		Batt_Maint_Dealarm bmd=(Batt_Maint_Dealarm) obj;
 		BattInf binf=bmd.getBinf();
 		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 " +
+				 ",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"));
 						
@@ -211,7 +212,51 @@
 						binf.setBattModel(rs.getString("battModel"));
 						binf.setBattProductDate(rs.getDate("battProductDate"));
 						binf.setBattInUseDate(rs.getDate("battInUseDate"));
+						binf.setLoad_curr(rs.getFloat("load_curr"));
+                        binf.setDisCurrMax(rs.getFloat("disCurrMax"));
+                        binf.setStation_phone(rs.getString("station_phone"));
+						list.add(binf);
 
+					}
+				} catch (SQLException e) {
+					e.printStackTrace();
+				}		
+				return list;
+			}
+		});
+		//鍘绘帀limit鏉′欢鍚庣殑鎬绘暟
+		int number=LimitNumberFactory.GetLimtitNumber(conn, numberSql);
+		if(list!=null&&list.size()>0){
+			list.get(list.size()-1).setNum(number);
+		}
+		return list;
+	}
+	//鏍规嵁缁存姢鍖哄拰鏈烘埧鍚嶇О鏌ヨ鐢垫睜缁勪俊鎭�(鐢垫睜缁勪俊鎭厤缃�)
+	public List searchInform1(Object obj){
+		Batt_Maint_Dealarm bmd=(Batt_Maint_Dealarm) obj;
+		BattInf binf=bmd.getBinf();
+		Page page=bmd.getPage();
+		Connection conn= DBUtil.getConn();
+		String numberSql=" SELECT FOUND_ROWS() number";
+		String sql="select SQL_CALC_FOUND_ROWS distinct(StationId),StationId_ex,StationName1,StationName2,StationName3,StationName,FBSDeviceId  " +
+				 " From db_battinf.tb_battinf " +
+				 " limit ?,?";
+		List<BattInf> list=DAOHelper.executeQueryLimit(sql,conn, new Object[]{(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()},new CallBack() {
+			
+			public List getResults(ResultSet rs) {
+				List list = new ArrayList<BattInf>();
+				int id=0;
+				
+				try {
+					while (rs.next()) {
+						BattInf binf = new BattInf();
+						binf.setStationId(rs.getString("stationId"));
+						binf.setStationName1(rs.getString("stationName1"));
+						binf.setStationName2(rs.getString("stationName2"));
+						binf.setStationName3(rs.getString("stationName3"));
+						binf.setFBSDeviceId(rs.getInt("fBSDeviceId"));
+						binf.setStationName(rs.getString("stationName"));
+						binf.setStationId_ex(rs.getString("stationId_ex"));
 						list.add(binf);
 
 					}
@@ -3363,16 +3408,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.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;
+	}
+	//鏌ヨ绠$悊鐨勬満鎴�(宸︿晶瀵艰埅绗洓灞傦紝鏌ユ墍鏈夌殑鏈烘埧,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();
@@ -3383,6 +3487,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"));
@@ -3397,14 +3502,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();
@@ -3415,6 +3520,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"));
@@ -3431,11 +3537,11 @@
 	}
    
 	
-	//鏍规嵁鏈烘埧id鏌ヨ鏈烘埧涓嬬殑鐢垫睜缁勪俊鎭�(宸︿晶瀵艰埅绗洓灞�,鏍规嵁鏈烘埧鏌ヨ涓嬮潰鐨勭數姹犵粍,num涓瓨鏀緐id)
+	//鏍规嵁鏈烘埧id鏌ヨ鏈烘埧涓嬬殑鐢垫睜缁勪俊鎭�(宸︿晶瀵艰埅绗簲灞�,鏍规嵁鏈烘埧鏌ヨ涓嬮潰鐨勭數姹犵粍,num涓瓨鏀緐id)
 	public List serchBattByStation(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,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;
@@ -3448,7 +3554,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();
@@ -3456,7 +3562,12 @@
 					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.setStationId_ex(rs.getString("stationId_ex"));
 						batt.setStationIp(rs.getString("StationIP"));
 						batt.setBattGroupName(rs.getString("BattGroupName").trim());
 						batt.setBattGroupName1(rs.getString("BattGroupName1").trim());
@@ -3471,6 +3582,8 @@
 						batt.setBattProducer(rs.getString("BattProducer"));
 						batt.setBattInUseDate(rs.getDate("BattInUseDate"));
 						batt.setGroupIndexInFBSDevice(rs.getInt("groupIndexInFBSDevice"));
+						batt.setLoad_curr(rs.getFloat("load_curr"));
+						batt.setDisCurrMax(rs.getFloat("disCurrMax"));
 						list.add(batt);
 					}
 				} catch (SQLException e) {
@@ -3481,11 +3594,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;
@@ -3498,7 +3611,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();
@@ -3506,6 +3619,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());
@@ -3624,7 +3741,12 @@
 				" 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 ?  ";
+		//鐢ㄦ埛绠$悊
+		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;
 		//閫変腑鍝佺墝涓�鑷�
 		String producerSqlT=" order by BattProducer,MonCapStd,MonVolStd,BattGroupId ";//涓�鑷�
 		String producerSqlF=" order by MonCapStd,MonVolStd,BattGroupId ";//涓嶄竴鑷�
@@ -3633,7 +3755,7 @@
 		}else{
 			sql+=producerSqlF;
 		}
-		List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%"}, new CallBack() {
+		List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%",binf.getNum()}, new CallBack() {
 			
 			public List getResults(ResultSet rs) {
 				List<BattInf> list=new ArrayList();
@@ -3691,15 +3813,92 @@
 		});
 		return list;
 	}
+	//鐢垫睜閰嶇粍绠$悊(閲嶈)
+	public List serchGroupByInfor(Object obj){
+		BattInf binf=(BattInf) obj;
+		String sql="SELECT distinct BattGroupId,battgroupname,stationid,stationname1,stationname2,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 stationname1 like ? and stationname2 like ? and stationname3 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() {
+			
+			public List getResults(ResultSet rs) {
+				List<BattInf> list=new ArrayList();
+				int battgroupid=0;
+				try {
+					while(rs.next()){
+						BattInf binf=new BattInf();
+						binf.setBattGroupId(rs.getInt("battGroupId"));
+						binf.setBattGroupName(rs.getString("battGroupName"));
+						binf.setStationId(rs.getString("stationId"));
+						binf.setStationName(rs.getString("stationName"));
+						binf.setStationName1(rs.getString("stationName1"));
+						binf.setStationName2(rs.getString("stationName2"));
+						binf.setStationName3(rs.getString("stationName3"));
+						binf.setBattProducer(rs.getString("battProducer"));
+						binf.setMonVolStd(rs.getFloat("monVolStd"));
+						binf.setMonCapStd(rs.getFloat("monCapStd"));
+						binf.setMonCount(rs.getInt("monCount"));
+						
+						BattInf_Rebuild brinf=new BattInf_Rebuild();
+						brinf.setNew_battgroupid(rs.getInt("new_battgroupid"));
+						brinf.setNew_battgroupname(rs.getString("new_battgroupname"));
+						brinf.setNew_battproducer(rs.getString("new_battproducer"));
+						brinf.setNew_monum(rs.getInt("new_monum"));
+						brinf.setNew_stationid(rs.getString("new_stationid"));
+						brinf.setNew_stationname(rs.getString("new_stationname"));
+						brinf.setOld_battgroupid(rs.getInt("old_battgroupid"));
+						brinf.setOld_battgroupname(rs.getString("old_battgroupname"));
+						brinf.setOld_battproducer(rs.getString("old_battproducer"));
+						brinf.setOld_monum(rs.getInt("old_monum"));
+						brinf.setOld_stationid(rs.getString("old_stationid"));
+						brinf.setOld_stationname(rs.getString("old_stationname"));
+						brinf.setRebuild_address(rs.getString("rebuild_address"));
+						brinf.setRebuild_clear_type(rs.getInt("rebuild_clear_type"));
+						brinf.setRebuild_time(rs.getTimestamp("rebuild_time"));
+						brinf.setRebuild_uid(rs.getInt("rebuild_uid"));
+						
+                        if(binf.getBattGroupId()==battgroupid){
+							((ArrayList)list.get(list.size()-1).getObj()).add(brinf);
+							continue;
+						}
+						List listr=new ArrayList();
+						listr.add(brinf);
+						binf.setObj(listr);
+						battgroupid=binf.getBattGroupId();
+						
+						list.add(binf);
+					}
+				} catch (SQLException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+				return list;
+			}
+		});
+		return list;
+	}
+	
+	
 	public static void main(String[] args) throws ParseException {
 		//new BattInfImpl().searchAll();
 		
 		BattInfImpl biml = new BattInfImpl();
 		BattInf binf = new BattInf();
-		binf.setBattGroupId(1000967);
+		binf.setNum(1002);
+		binf.setBattGroupId(1000001);
 		binf.setStationName("");
 		binf.setStationName1("");
 		binf.setStationName2("");
+		binf.setStationName3("");
+		binf.setBattGroupName("");
 		binf.setBattProducer("1");
 		User_inf uinf=new User_inf();
 		uinf.setUId(1002);
@@ -3725,10 +3924,13 @@
 		//List<BattInf> list = biml.serchByConditionNew(bmd);
 		//List<BattInf> list=biml.serchByTestType(bmd);
 		//List<BattInf> list=biml.serchGroupAssess(bmd);
-		List<BattInf> list=biml.serchMakeGroup(binf);
-		for (BattInf b : list) {
+		//List<BattInf> list=biml.serchMakeGroup(binf);
+		//List<BattInf> list=biml.serchGroupByInfor(binf);
+		//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