81041
2018-11-03 3b20007f7b2c3d8b233860d4d2acb3384cb7744d
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();
@@ -3742,12 +3752,12 @@
   //电池配组管理(重要)
   public List serchMakeGroup(Object obj){
      BattInf binf=(BattInf) obj;
      String sql="SELECT distinct BattGroupId,battgroupname,stationid,stationname1,stationname2,stationname,stationname3,BattProducer,MonVolStd,MonCapStd,monCount " +
      String sql="SELECT distinct BattGroupId,battgroupname,stationid,stationname1,stationname2,stationname5,stationname,stationname3,BattProducer,MonVolStd,MonCapStd,monCount " +
            " ,battinf_re.old_stationname,old_battgroupname,old_battproducer,old_stationid,old_battgroupid,old_monum,new_stationname,new_battgroupname,new_battproducer,new_stationid,new_battgroupid,new_monum,rebuild_time,rebuild_uid,rebuild_address,rebuild_clear_type " +
            " 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 ?  ";
            " 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=?" +
@@ -3761,7 +3771,7 @@
      }else{
         sql+=producerSqlF;
      }
      List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%",binf.getNum()}, new CallBack() {
      List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%","%"+binf.getStationName5()+"%",binf.getNum()}, new CallBack() {
         
         public List getResults(ResultSet rs) {
            List<BattInf> list=new ArrayList();
@@ -3776,6 +3786,7 @@
                  binf.setStationName1(rs.getString("stationName1"));
                  binf.setStationName2(rs.getString("stationName2"));
                  binf.setStationName3(rs.getString("stationName3"));
                  binf.setStationName5(rs.getString("stationName5"));
                  binf.setBattProducer(rs.getString("battProducer"));
                  binf.setMonVolStd(rs.getFloat("monVolStd"));
                  binf.setMonCapStd(rs.getFloat("monCapStd"));
@@ -3822,18 +3833,18 @@
   //电池配组管理(重要)
   public List serchGroupByInfor(Object obj){
      BattInf binf=(BattInf) obj;
      String sql="SELECT distinct BattGroupId,battgroupname,stationid,stationname1,stationname2,stationname,stationname3,BattProducer,MonVolStd,MonCapStd,monCount " +
      String sql="SELECT distinct BattGroupId,battgroupname,stationid,stationname1,stationname2,stationname,stationname3,stationname5,BattProducer,MonVolStd,MonCapStd,monCount " +
            " ,battinf_re.old_stationname,old_battgroupname,old_battproducer,old_stationid,old_battgroupid,old_monum,new_stationname,new_battgroupname,new_battproducer,new_stationid,new_battgroupid,new_monum,rebuild_time,rebuild_uid,rebuild_address,rebuild_clear_type " +
            " 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 stationname1 like ? and stationname2 like ? and stationname3 like ?  and battgroupname like ?  and battgroupid=? ";
            " where stationname1 like ? and stationname2 like ? and stationname3 like ?  and stationname5 like ? and battgroupname like ?  and battgroupid=? ";
      //用户管理
      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=?" +
            " ) ";
      sql+=userSql;
      List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getBattGroupName()+"%",binf.getBattGroupId(),binf.getNum()}, new CallBack() {
      List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationName5()+"%","%"+binf.getBattGroupName()+"%",binf.getBattGroupId(),binf.getNum()}, new CallBack() {
         
         public List getResults(ResultSet rs) {
            List<BattInf> list=new ArrayList();
@@ -3848,6 +3859,7 @@
                  binf.setStationName1(rs.getString("stationName1"));
                  binf.setStationName2(rs.getString("stationName2"));
                  binf.setStationName3(rs.getString("stationName3"));
                  binf.setStationName5(rs.getString("stationName5"));
                  binf.setBattProducer(rs.getString("battProducer"));
                  binf.setMonVolStd(rs.getFloat("monVolStd"));
                  binf.setMonCapStd(rs.getFloat("monCapStd"));