From dd4a68a7cae09bd79df7aa3a18afce5639360cb1 Mon Sep 17 00:00:00 2001
From: 军 <军@hp-pc>
Date: 星期一, 08 十月 2018 17:39:00 +0800
Subject: [PATCH] 在BattTestData.java文件中添加启动自动建表的jar文件的方法

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

diff --git a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
index 5512cfa..4c076cd 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
@@ -29,6 +29,7 @@
 import com.fgkj.dto.Batt_Maint_Dealarm;
 import com.fgkj.dto.Batt_maint_inf;
 import com.fgkj.dto.Batt_maintenance_inf;
+import com.fgkj.dto.Batttestdata;
 import com.fgkj.dto.Batttestdata_inf;
 import com.fgkj.dto.Batttestdatastop;
 import com.fgkj.dto.Limit;
@@ -354,6 +355,14 @@
 		}else{
 			baseSql+=station1SqlF;
 		}
+		//鐢ㄤ簬缁存姢鍖�
+		String station2SqlT=" and stationname2!=? ";//鍏ㄩ儴
+		String station2SqlF=" and stationname2=? ";
+		if(binf.getStationName2().equals("")){
+			baseSql+=station2SqlT;
+		}else{
+			baseSql+=station2SqlF;
+		}
 		//鐢ㄤ簬鏈烘埧绔欑偣
 		String stationSqlT=" and stationname!=? ";//鍏ㄩ儴
 		String stationSqlF=" and stationname=? ";
@@ -373,7 +382,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.getStationName(),binf.getBattGroupId()}, new CallBack() {
+		List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationName1(),binf.getStationName2(),binf.getStationName(),binf.getBattGroupId()}, new CallBack() {
 			
 			public List getResults(ResultSet rs) {
 				List list=new ArrayList();
@@ -3470,6 +3479,48 @@
 		return nums;
 	}
     
+	
+	//鐢垫睜閰嶇粍绠$悊(閲嶈)
+	public List serchMakeGroup(Object obj){
+		BattInf binf=(BattInf) obj;
+		String sql="SELECT distinct BattGroupId,battgroupname,stationid,stationname1,stationname2,stationname,stationname3,BattProducer,MonVolStd,MonCapStd,monCount from db_battinf.tb_battinf where stationname2 like ? ";
+		//閫変腑鍝佺墝涓�鑷�
+		String producerSqlT=" order by BattProducer,MonCapStd,MonVolStd ";//涓�鑷�
+		String producerSqlF=" order by MonCapStd,MonVolStd ";//涓嶄竴鑷�
+		if(binf.getBattProducer().equals("1")){
+			sql+=producerSqlT;
+		}else{
+			sql+=producerSqlF;
+		}
+		List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%"}, new CallBack() {
+			
+			public List getResults(ResultSet rs) {
+				List list=new ArrayList();
+				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"));
+						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();
 		

--
Gitblit v1.9.1