81041
2018-11-02 ef0d9a4480f35f34d4c41b9b09876f9e9e02c947
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);
               }
@@ -3452,7 +3462,7 @@
            " FROM db_battinf.tb_battinf " +
            " where StationName1 like ? and StationName2 like ?  " +
            " ORDER BY CONVERT( StationName USING gbk ) COLLATE gbk_chinese_ci ASC ";
      List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%"},new CallBack() {
      List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%"},new CallBack() {
         
         public List getResults(ResultSet rs) {
            List list=new ArrayList();
@@ -3747,7 +3757,7 @@
            " from db_battinf.tb_battinf " +
            " left outer join (select * from db_battinf.tb_battinf_rebuild where tb_battinf_rebuild.rebuild_clear_type=1 ) as battinf_re " +
            " on BattGroupId=battinf_re.new_battgroupid or BattGroupId=battinf_re.old_battgroupid " +
            " where stationname2 like ?  stationname5 like ?  ";
            " where stationname2 like ?  and stationname5 like ?  ";
      //用户管理
      String userSql=" and StationId in(" +
            " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id  and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +