| | |
| | | return list;
|
| | | }
|
| | |
|
| | | //5.3添加选取电池组或者机房或者维护区
|
| | | //5.3添加选取电池组或者机房或者维护区或者全区县
|
| | | public List serchBatt(Object obj) {
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="";
|
| | | String baseSql="select distinct(battgroupid),stationid,stationname,stationname1,battgroupname from db_battinf.tb_battinf " +
|
| | | String baseSql="select distinct(battgroupid),stationid,stationname,stationname1,stationname2,stationname5,battgroupname from db_battinf.tb_battinf " +
|
| | | "where ";
|
| | | //用于维护区
|
| | | String station1SqlT=" stationname1!=? ";//全部
|
| | |
| | | baseSql+=station2SqlT;
|
| | | }else{
|
| | | baseSql+=station2SqlF;
|
| | | }
|
| | | //用于区县
|
| | | String station5SqlT=" and stationname5!=? ";//全部
|
| | | String station5SqlF=" and stationname5=? ";
|
| | | if(binf.getStationName5().equals("")){
|
| | | baseSql+=station5SqlT;
|
| | | }else{
|
| | | baseSql+=station5SqlF;
|
| | | }
|
| | | //用于机房站点
|
| | | String stationSqlT=" and stationname!=? ";//全部
|
| | |
| | | String endSql=" order by stationid ";
|
| | | sql=baseSql+endSql;
|
| | | //System.out.println(sql);
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationName1(),binf.getStationName2(),binf.getStationName(),binf.getBattGroupId()}, new CallBack() {
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationName1(),binf.getStationName2(),binf.getStationName5(),binf.getStationName(),binf.getBattGroupId()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | |
| | | binf.setStationId(rs.getString("StationId"));
|
| | | binf.setStationName(rs.getString("stationName"));
|
| | | binf.setStationName1(rs.getString("stationName1"));
|
| | | binf.setStationName2(rs.getString("stationName2"));
|
| | | binf.setStationName5(rs.getString("stationName5"));
|
| | | binf.setBattGroupName(rs.getString("battGroupName"));
|
| | | list.add(binf);
|
| | | }
|