From 97d959c1583cdf7a36781ff8dfe2cfac28bb5799 Mon Sep 17 00:00:00 2001 From: 81041 <81041@192.168.10.30> Date: 星期三, 14 十一月 2018 16:37:12 +0800 Subject: [PATCH] //实时监测中的查询实时组端信息<-------跨域-----------> --- gx_tieta/src/com/fgkj/dao/impl/Batt_rtstateDAOImpl.java | 51 ++++++++++++++++++++++++- gx_tieta/src/com/fgkj/services/Batt_rtstateService.java | 13 +++++- 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/gx_tieta/src/com/fgkj/dao/impl/Batt_rtstateDAOImpl.java b/gx_tieta/src/com/fgkj/dao/impl/Batt_rtstateDAOImpl.java index e848fa2..56f9959 100644 --- a/gx_tieta/src/com/fgkj/dao/impl/Batt_rtstateDAOImpl.java +++ b/gx_tieta/src/com/fgkj/dao/impl/Batt_rtstateDAOImpl.java @@ -83,6 +83,47 @@ } }); } + //瀹炴椂鐩戞祴<-------璺ㄥ煙-----------> + public List serchByCondition_ky(Object obj) { + Batt_rtstate br=(Batt_rtstate)obj; + String sql="select num,BattGroupId,batt_count,rec_datetime,group_vol,online_vol,group_curr,batt_state," + + "batt_test_type,batt_test_starttime,batt_test_recordtime,batt_test_tlong," + + "batt_test_cap,batt_real_cap,batt_rest_cap,batt_rest_power1_time,batt_rest_power2_time" + + " from db_ram_db.tb_batt_rtstate where BattGroupId=?"; + return DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{br.getBattGroupId()}, new CallBack() { + + public List getResults(ResultSet rs) { + List list=new ArrayList(); + try { + while(rs.next()){ + Batt_rtstate b=new Batt_rtstate(); + b.setNum(rs.getInt("num")); + b.setBattGroupId(rs.getInt("BattGroupId")); + b.setBatt_count(rs.getInt("batt_count")); + b.setRec_datetime(rs.getTimestamp("rec_datetime")); + b.setOnline_vol(rs.getFloat("online_vol")); + b.setGroup_vol(rs.getFloat("group_vol")); + b.setGroup_curr(rs.getFloat("group_curr")); + b.setBatt_state(rs.getInt("batt_state")); + b.setBatt_test_type(rs.getInt("batt_test_type")); + b.setBatt_test_starttime(rs.getTimestamp("batt_test_starttime")); + b.setBatt_test_recordtime(rs.getTimestamp("batt_test_recordtime")); + b.setBatt_test_tlong(rs.getInt("batt_test_tlong")); + b.setBatt_test_cap(rs.getFloat("batt_test_cap")); + b.setBatt_real_cap(rs.getFloat("batt_real_cap")); + b.setBatt_rest_cap(rs.getFloat("batt_rest_cap")); + b.setBatt_rest_power1_time(rs.getInt("batt_rest_power1_time")); + b.setBatt_rest_power2_time(rs.getInt("batt_rest_power2_time")); + //System.out.println(b); + list.add(b); + } + } catch (Exception e) { + e.printStackTrace(); + } + return list; + } + }); + } //娴嬭瘯鏁版嵁鈥斺�斿疄鏃舵煡璇腑宸︿笅瑙掔殑鍏呮斁鐢电粺璁�(鏃�) public List serchDisOrChargr(){ String sql=" SELECT db_ram_db.tb_batt_rtstate.battgroupid,batt_test_type,stationid " + @@ -715,6 +756,12 @@ /*List<Batt_rtstate> list=bimpl.serchDisOrChargrNew(uinf); for (Batt_rtstate b : list) { System.out.println(b); - }*/ -} + }*/ + Batt_rtstate br=new Batt_rtstate(); + br.setBattGroupId(1002101); + List<Batt_rtstate> list=bimpl.serchByCondition_ky(br); + for (Batt_rtstate b : list) { + System.out.println(b); + } + } } diff --git a/gx_tieta/src/com/fgkj/services/Batt_rtstateService.java b/gx_tieta/src/com/fgkj/services/Batt_rtstateService.java index 5138344..e523bc0 100644 --- a/gx_tieta/src/com/fgkj/services/Batt_rtstateService.java +++ b/gx_tieta/src/com/fgkj/services/Batt_rtstateService.java @@ -23,7 +23,7 @@ model=new ServiceModel(); dao=BaseDAOFactory.getBaseDAO(BaseDAO.BATT_RTSTATE); } - + //瀹炴椂鐩戞祴涓殑鏌ヨ瀹炴椂缁勭淇℃伅 public ServiceModel serchByCondition(Object obj){ List list=dao.serchByCondition(obj); if(list!=null && list.size()>0){ @@ -33,7 +33,16 @@ //System.out.println(list); return model; } - + //瀹炴椂鐩戞祴涓殑鏌ヨ瀹炴椂缁勭淇℃伅<-------璺ㄥ煙-----------> + public ServiceModel serchByCondition_ky(Object obj){ + List list=((Batt_rtstateDAOImpl)dao).serchByCondition_ky(obj); + if(list!=null && list.size()>0){ + model.setCode(1); + model.setData(list); + } + //System.out.println(list); + return model; + } //9.1鏍规嵁鏌ヨ鐢垫睜缁勫崟浣撶殑瀹炴椂鏁版嵁(鐢垫睜鍗曚綋瀹炴椂淇℃伅) public ServiceModel serchByMons(Object obj){ List<Batt_State> list=(new Batt_rtstateDAOImpl()).serchMons(obj); -- Gitblit v1.9.1