From aaa3e16cabaf5d70520634eaff6f8c83653000a8 Mon Sep 17 00:00:00 2001 From: 81041 <81041@192.168.10.25> Date: 星期一, 22 十月 2018 10:38:12 +0800 Subject: [PATCH] 查询信息 --- gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 44 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 b8f8349..c0b3de1 100644 --- a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java +++ b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java @@ -230,6 +230,48 @@ } 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); + + } + } 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; + } //娣诲姞鐢垫睜缁勬椂鏌ヨ鍑烘渶澶х殑鏈烘埧id鍜岀數姹犵粍id public List searchMaxId(){ String sql="select max(stationid) as maxs,max(battgroupid) as maxb from db_battinf.tb_battinf limit 1"; @@ -3811,8 +3853,9 @@ //List<BattInf> list = biml.serchByConditionNew(bmd); //List<BattInf> list=biml.serchByTestType(bmd); //List<BattInf> list=biml.serchGroupAssess(bmd); - List<BattInf> list=biml.serchMakeGroup(binf); + //List<BattInf> list=biml.serchMakeGroup(binf); //List<BattInf> list=biml.serchGroupByInfor(binf); + List<BattInf> list=biml.searchInform1(bmd); for (BattInf b : list) { System.out.println(b); } -- Gitblit v1.9.1