81041
2018-11-02 ef0d9a4480f35f34d4c41b9b09876f9e9e02c947
修改添加全区全市全省电池组的方法serchbatt
1个文件已修改
16 ■■■■ 已修改文件
gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
@@ -387,11 +387,11 @@
        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!=? ";//全部
@@ -408,6 +408,14 @@
            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!=? ";//全部
@@ -428,7 +436,7 @@
        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();
@@ -439,6 +447,8 @@
                    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);
                    }