星伟
2018-09-30 ea7102bdbdb56abfc1201489de7ff51d0b42ff07
gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
@@ -29,6 +29,7 @@
import com.fgkj.dto.Batt_Maint_Dealarm;
import com.fgkj.dto.Batt_maint_inf;
import com.fgkj.dto.Batt_maintenance_inf;
import com.fgkj.dto.Batttestdata;
import com.fgkj.dto.Batttestdata_inf;
import com.fgkj.dto.Batttestdatastop;
import com.fgkj.dto.Limit;
@@ -3478,6 +3479,47 @@
      return nums;
   }
    
   //电池配组管理(重要)
   public List serchMakeGroup(Object obj){
      BattInf binf=(BattInf) obj;
      String sql="SELECT distinct BattGroupId,stationid,stationname1,stationname2,stationname,stationname3,BattProducer,MonVolStd,MonCapStd,monCount from db_battinf.tb_battinf where stationname2 like ? ";
      //选中品牌一致
      String producerSqlT=" order by BattProducer,MonCapStd,MonVolStd ";//一致
      String producerSqlF=" order by MonCapStd,MonVolStd ";//不一致
      if(binf.getBattProducer().equals("1")){
         sql+=producerSqlT;
      }else{
         sql+=producerSqlF;
      }
      List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%"}, new CallBack() {
         public List getResults(ResultSet rs) {
            List list=new ArrayList();
            try {
               while(rs.next()){
                  BattInf binf=new BattInf();
                  binf.setBattGroupId(rs.getInt("battGroupId"));
                  binf.setStationId(rs.getString("stationId"));
                  binf.setStationName(rs.getString("stationName"));
                  binf.setStationName1(rs.getString("stationName1"));
                  binf.setStationName2(rs.getString("stationName2"));
                  binf.setStationName3(rs.getString("stationName3"));
                  binf.setBattProducer(rs.getString("battProducer"));
                  binf.setMonVolStd(rs.getFloat("monVolStd"));
                  binf.setMonCapStd(rs.getFloat("monCapStd"));
                  binf.setMonCount(rs.getInt("monCount"));
                  list.add(binf);
               }
            } catch (SQLException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
            }
            return list;
         }
      });
      return list;
   }
   public static void main(String[] args) throws ParseException {
      //new BattInfImpl().searchAll();