From fa00382db413a8489d07983b66f0869305b51a9a Mon Sep 17 00:00:00 2001
From: 81041 <81041@DESKTOP-025NVD9>
Date: 星期五, 11 一月 2019 11:35:54 +0800
Subject: [PATCH] 批量读取系统参数

---
 gx_tieta/src/com/fgkj/dao/impl/Batttestdata_infDAOImpl.java |   69 +++++++++++++++++++++++++++++++++-
 1 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/gx_tieta/src/com/fgkj/dao/impl/Batttestdata_infDAOImpl.java b/gx_tieta/src/com/fgkj/dao/impl/Batttestdata_infDAOImpl.java
index 0371f9a..4403217 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/Batttestdata_infDAOImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/Batttestdata_infDAOImpl.java
@@ -206,7 +206,63 @@
 			}
 		});
 	}
-
+	//鍘嗗彶鏁版嵁鏌ヨ<-------璺ㄥ煙----------->
+	public List serchByCondition_ky(Object obj) {
+	    final Batttestdata_inf bti=(Batttestdata_inf)obj;
+		String sql="select num,BattGroupId,test_record_count,test_record_count_ex,test_type,record_time_interval,data_new,data_available,record_num,test_starttime,test_starttime_ex,test_starttype,record_time,test_timelong,test_stoptype,group_vol,test_curr,test_cap,max_monnum,max_monvol,min_monnum,min_monvol,mon_num,mon_vol,upload_usr_id " +
+				" from db_batt_testdata.tb_batttestdata_inf where BattGroupId=?  " +
+				" and  db_batt_testdata.tb_batttestdata_inf.data_available=1 " +
+				" order by test_type asc,test_starttime desc ";
+		return DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{bti.getBattGroupId()}, new CallBack() {
+			
+			public List getResults(ResultSet rs) {
+				List list=new ArrayList();
+				try {
+					while(rs.next()){
+						Batttestdata_inf b=new Batttestdata_inf();
+						b.setNum(rs.getInt("num"));
+						b.setBattGroupId(rs.getInt("BattGroupId"));
+						b.setTest_record_count(rs.getInt("test_record_count"));
+						b.setTest_record_count_ex(rs.getInt("test_record_count_ex"));
+						b.setTest_type(rs.getInt("test_type"));
+						b.setRecord_time_interval(rs.getInt("record_time_interval"));
+						b.setData_new(rs.getInt("data_new"));
+						b.setData_available(rs.getInt("data_available"));						
+						b.setRecord_num(rs.getInt("record_num"));
+						b.setTest_starttime(rs.getTimestamp("test_starttime"));
+						b.setTest_starttime_ex(rs.getTimestamp("test_starttime_ex"));
+						b.setTest_starttype(rs.getInt("test_starttype"));
+						b.setRecord_time(rs.getTimestamp("record_time"));
+						b.setTest_timelong(rs.getInt("test_timelong"));
+						b.setTest_stoptype(rs.getInt("test_stoptype"));
+						//鏀剧數缁堟鍘熷洜
+						
+						if(bti.getNum()/100000==6185){
+							b.setTest_stoptype_reason(BattTestData.getStopType_6185(b.getTest_stoptype()));							
+						}else if(bti.getNum()/100000==4016){
+							b.setTest_stoptype_reason(BattTestData.getStopType_4016(b.getTest_stoptype()));
+						}else{
+							b.setTest_stoptype_reason(BattTestData.getStopType(b.getTest_starttype(), b.getTest_stoptype()));
+						}
+						b.setGroup_vol(rs.getFloat("group_vol"));
+						b.setTest_curr(rs.getFloat("test_curr"));
+						b.setTest_cap(rs.getFloat("test_cap"));
+						b.setMax_monnum(rs.getInt("max_monnum"));
+						b.setMax_monvol(rs.getFloat("max_monvol"));
+						b.setMin_monnum(rs.getInt("min_monnum"));
+						b.setMin_monvol(rs.getFloat("min_monvol"));
+						b.setMon_num(rs.getInt("mon_num"));
+						b.setMon_vol(rs.getFloat("mon_vol"));
+						b.setUpload_usr_id(rs.getInt("upload_usr_id"));
+						list.add(b);
+					}
+				} catch (SQLException e) {
+					e.printStackTrace();
+				} 
+				return list;
+			}
+		});
+	}
 	//6.2鏍规嵁battgroupi鍜宼est_starttime鏌est_record_count
 	public List serchTest_record_count(Object obj) {
 		Batttestdata_inf tdata=(Batttestdata_inf)obj;
@@ -1017,11 +1073,20 @@
 		Batt_Maint_Dealarm bmd=new Batt_Maint_Dealarm();
 		bmd.setTdata(tdata);
 		bmd.setBinf(binf);
-		List<Batt_Maint_Dealarm> list=bimpl.serchByInfo(bmd);
+		/*List<Batt_Maint_Dealarm> list=bimpl.serchByInfo(bmd);
 		for (Batt_Maint_Dealarm b : list) {
 			System.out.println(b);
 		}
 		System.out.println(list.size());
+        */
+		Batttestdata_inf tinf=new Batttestdata_inf();
+		tinf.setBattGroupId(1002095);
+		tinf.setNum(910000577);
+		List<Batttestdata_inf> list=bimpl.serchByCondition_ky(tinf);
+		for (Batttestdata_inf b : list) {
+			System.out.println(b);
+		}
+		System.out.println(list.size());
 
 	}
 

--
Gitblit v1.9.1