| | |
| | | }
|
| | | 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";
|
| | |
| | | //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);
|
| | | }
|