From e3e09bc29f2ddc1600e27a8d0ec12981215e68b2 Mon Sep 17 00:00:00 2001 From: 81041 <81041@DESKTOP-025NVD9> Date: 星期三, 26 十二月 2018 11:33:22 +0800 Subject: [PATCH] 申请添加修改 --- gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java | 86 +++++++++++++++++++++++++++++++++++++++++- 1 files changed, 83 insertions(+), 3 deletions(-) diff --git a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java index 067fa8a..b39a55b 100644 --- a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java +++ b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java @@ -4373,6 +4373,78 @@ } return battgroupid; } + + //鎵归噺璁剧疆鏀剧數鍙傛暟鏃讹紝鏍规嵁鐪佸競鍖猴紝鐢垫睜鍗曚綋鍨嬪彿锛堜紡鏁帮級锛岀粍鏁扮瓫閫夊嚭鐢垫睜缁� + public List serchByDischarge(Object obj) { + BattInf binf=(BattInf) obj; + Connection conn=DBUtil.getConn(); + String numberSql=" SELECT FOUND_ROWS() number"; + String sql=" select SQL_CALC_FOUND_ROWS * from db_battinf.tb_battinf " + + " where StationName1 like ? and StationName2 like ? and StationName3 like ? and StationName5 like ? " + + " and GroupIndexInFBSDevice=? and MonVolStd=? " + + " order by StationId asc,GroupIndexInFBSDevice asc "; + List<BattInf> list=DAOHelper.executeQueryLimit(sql, conn, new Object[] {"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationName5()+"%",binf.getGroupIndexInFBSDevice(),binf.getMonVolStd()}, new CallBack() { + + @Override + public List getResults(ResultSet rs) { + List list=new ArrayList(); + try { + while(rs.next()) { + BattInf binf = new BattInf(); + 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.setStationName4(rs.getString("stationName4")); + binf.setStationName5(rs.getString("stationName5")); + binf.setStationIp(rs.getString("stationIp")); + binf.setFBSDeviceId(rs.getInt("fBSDeviceId")); + + binf.setFbsDeviceIp(rs.getString("fbsDeviceIp")); + binf.setFbsDeviceIp_YM(rs.getString("fbsDeviceIp_YM")); + binf.setFbsDeviceIp_WG(rs.getString("fbsDeviceIp_WG")); + binf.setFBSDeviceName(rs.getString("fBSDeviceName")); + binf.setGroupIndexInFBSDevice(rs.getInt("groupIndexInFBSDevice")); + binf.setBattGroupId(rs.getInt("battGroupId")); + binf.setBattGroupNum(rs.getInt("battGroupNum")); + binf.setBattGroupName(rs.getString("battGroupName")); + binf.setFloatVolLevel(rs.getFloat("floatVolLevel")); + binf.setOfflineVolLevel(rs.getFloat("offlineVolLevel")); + binf.setBattFloatCurrent(rs.getFloat("battFloatCurrent")); + binf.setMonCount(rs.getInt("monCount")); + binf.setMonCapStd(rs.getFloat("monCapStd")); + binf.setMonVolStd(rs.getFloat("monVolStd")); + binf.setMonResStd(rs.getFloat("monResStd")); + binf.setMonSerStd(rs.getFloat("monSerStd")); + binf.setMonVolLowToAvg(rs.getFloat("monVolLowToAvg")); + binf.setBattProducer(rs.getString("battProducer")); + binf.setBattModel(rs.getString("battModel")); + binf.setBattProductDate(rs.getDate("battProductDate")); + binf.setBattInUseDate(rs.getDate("battInUseDate")); + binf.setLoad_curr(rs.getFloat("load_curr")); + binf.setInstall_user(rs.getString("install_user")); + binf.setDisCurrMax(rs.getFloat("disCurrMax")); + binf.setStation_phone(rs.getString("station_phone")); + binf.setStation_install(rs.getInt("station_install")); + list.add(binf); + } + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return list; + } + }); + //鍘绘帀limit鏉′欢鍚庣殑鎬绘暟 + int number=LimitNumberFactory.GetLimtitNumber(conn, numberSql); + //System.out.println("number: "+number); + if(list!=null&&list.size()>0){ + list.get(list.size()-1).setNum(number); + } + return list; + } + public static void main(String[] args) throws ParseException { //new BattInfImpl().searchAll(); @@ -4382,11 +4454,14 @@ binf.setBattGroupId(1000001); binf.setStationName("骞胯タ鐪�-鐧捐壊-GX鐧捐壊涔愪笟鍘跨珛鏂板皬鍖篧F-BTS璁惧"); binf.setStationName1(""); - binf.setStationName2(""); + binf.setStationName2("鐧捐壊"); binf.setStationName3(""); + binf.setStationName5(""); binf.setBattGroupName(""); binf.setBattProducer("1"); binf.setStationId("42000575"); + binf.setGroupIndexInFBSDevice(0); + binf.setMonVolStd(2f); User_inf uinf=new User_inf(); uinf.setUId(1002); @@ -4423,8 +4498,13 @@ System.out.println(list.size());*/ /*int nums=biml.serchByInstall_count(uinf); System.out.println(nums);*/ - boolean bl=biml.judgeBattInOrNot(binf); - System.out.println(bl); + /*boolean bl=biml.judgeBattInOrNot(binf); + System.out.println(bl);*/ + List<BattInf> list=biml.serchByDischarge(binf); + for (BattInf b : list) { + System.out.println(b); + } + System.out.println(list.size()); } public List getResults(ResultSet rs) { -- Gitblit v1.9.1