| | |
| | | ","+binf.getBattGroupId()+","+binf.getBattGroupNum()+",'"+binf.getBattGroupName()+"',"+binf.getFloatVolLevel()+","+binf.getOfflineVolLevel()+","+binf.getBattFloatCurrent()+
|
| | | ","+binf.getMonCount()+","+binf.getMonCapStd()+","+binf.getMonVolStd()+","+binf.getMonResStd()+","+binf.getMonSerStd()+","+binf.getMonVolLowToAvg()+
|
| | | ",'"+binf.getBattProducer()+"','"+binf.getBattModel()+"','"+DAOHelper.sdf.format(binf.getBattProductDate())+"','"+DAOHelper.sdf.format(binf.getBattInUseDate())+"',"+binf.getLoad_curr()+",'"+binf.getInstall_user()+"',"+binf.getDisCurrMax()+",'"+binf.getStation_phone()+"',"+binf.getStation_install()+")";
|
| | | |
| | | /*String baoji_sql="REPLACE into db_user.tb_user_battgroup_baojigroup_battgroup(baoji_group_id,StationId,BattGroupId) " + |
| | | " SELECT baoji_group_id,'"+binf.getStationId()+"',"+binf.getBattGroupId()+" from db_user.tb_user_battgroup_baojigroup ";
|
| | | sql_str.add(baoji_sql);*/
|
| | | if(binf.getStationId().equals(maxs)){
|
| | | maxs++;
|
| | | }
|
| | |
| | | //查询管理的机房(左侧导航第四层,查所有的机房,num中存放uid)
|
| | | public List serchStationName3(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,StationName5,stationid,fbsdeviceid,FBSDeviceName " +
|
| | | String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,StationName5,stationid,fbsdeviceid,FBSDeviceName,Station_install " +
|
| | | " FROM db_battinf.tb_battinf " +
|
| | | " where 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=?" +
|
| | |
| | | batt.setStationId(rs.getString("stationId"));
|
| | | batt.setFBSDeviceName(rs.getString("fBSDeviceName"));
|
| | | batt.setFBSDeviceId(rs.getInt("fBSDeviceId"));
|
| | | batt.setStation_install(rs.getInt("station_install"));
|
| | | list.add(batt);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | |
| | | //查询管理的机房(左侧导航第四层,查所有的机房)
|
| | | public List serchStationName3_all(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,StationName5,stationid,fbsdeviceid,FBSDeviceName " +
|
| | | String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,StationName5,stationid,fbsdeviceid,FBSDeviceName,station_install " +
|
| | | " FROM db_battinf.tb_battinf " +
|
| | | " where StationName1 like ? and StationName2 like ? and StationName5 like ? " +
|
| | | " ORDER BY CONVERT( StationName USING gbk ) COLLATE gbk_chinese_ci ASC ";
|
| | |
| | | batt.setStationId(rs.getString("stationId"));
|
| | | batt.setFBSDeviceName(rs.getString("fBSDeviceName"));
|
| | | batt.setFBSDeviceId(rs.getInt("fBSDeviceId"));
|
| | | batt.setStation_install(rs.getInt("station_install"));
|
| | | list.add(batt);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | |
| | | });
|
| | | return list;
|
| | | }
|
| | | //查询battinf中最大的battgroupid
|
| | | //查询出当前存在内存中最大的电池组id(很重要**********)
|
| | | public int searchMaxBattgroupId(){
|
| | | String sql=" select max(battgroupId) as id from db_battinf.tb_battinf limit 1";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() {
|
| | | |
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()){
|
| | | int battgroupid=1010000;
|
| | | if(rs.getString("id")!=null){
|
| | | battgroupid=rs.getInt("id");
|
| | | }
|
| | | list.add(battgroupid);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | int battgroupid=0;
|
| | | if(list!=null&&list.size()>0){
|
| | | battgroupid=(Integer) list.get(list.size()-1);
|
| | | }
|
| | | return battgroupid;
|
| | | }
|
| | |
|
| | | //批量设置放电参数时,根据省市区,电池单体型号(伏数),组数筛选出电池组
|
| | | public List serchByDischarge(Object obj) {
|
| | | BattInf binf=(BattInf) obj;
|
| | | Page page=binf.getPage();
|
| | | Connection conn=DBUtil.getConn();
|
| | | String numberSql=" SELECT FOUND_ROWS() number";
|
| | | String sql=" select SQL_CALC_FOUND_ROWS * from db_battinf.tb_battinf "
|
| | | + " where StationName1 like ? and StationName2 like ? and StationName3 like ? and StationName5 like ? "
|
| | | + " and GroupIndexInFBSDevice=? and MonVolStd=? "
|
| | | + " order by StationId asc,GroupIndexInFBSDevice asc "
|
| | | + " limit ?,? ";
|
| | | List<BattInf> list=DAOHelper.executeQueryLimit(sql, conn, new Object[] {"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationName5()+"%",binf.getGroupIndexInFBSDevice(),binf.getMonVolStd(),(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
|
| | | |
| | | @Override
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()) {
|
| | | BattInf binf = new BattInf();
|
| | | 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.setStationName4(rs.getString("stationName4"));
|
| | | binf.setStationName5(rs.getString("stationName5"));
|
| | | binf.setStationIp(rs.getString("stationIp"));
|
| | | binf.setFBSDeviceId(rs.getInt("fBSDeviceId"));
|
| | | |
| | | binf.setFbsDeviceIp(rs.getString("fbsDeviceIp"));
|
| | | binf.setFbsDeviceIp_YM(rs.getString("fbsDeviceIp_YM"));
|
| | | binf.setFbsDeviceIp_WG(rs.getString("fbsDeviceIp_WG"));
|
| | | binf.setFBSDeviceName(rs.getString("fBSDeviceName"));
|
| | | binf.setGroupIndexInFBSDevice(rs.getInt("groupIndexInFBSDevice"));
|
| | | binf.setBattGroupId(rs.getInt("battGroupId"));
|
| | | binf.setBattGroupNum(rs.getInt("battGroupNum"));
|
| | | binf.setBattGroupName(rs.getString("battGroupName"));
|
| | | binf.setFloatVolLevel(rs.getFloat("floatVolLevel"));
|
| | | binf.setOfflineVolLevel(rs.getFloat("offlineVolLevel"));
|
| | | binf.setBattFloatCurrent(rs.getFloat("battFloatCurrent"));
|
| | | binf.setMonCount(rs.getInt("monCount"));
|
| | | binf.setMonCapStd(rs.getFloat("monCapStd"));
|
| | | binf.setMonVolStd(rs.getFloat("monVolStd"));
|
| | | binf.setMonResStd(rs.getFloat("monResStd"));
|
| | | binf.setMonSerStd(rs.getFloat("monSerStd"));
|
| | | binf.setMonVolLowToAvg(rs.getFloat("monVolLowToAvg"));
|
| | | binf.setBattProducer(rs.getString("battProducer"));
|
| | | binf.setBattModel(rs.getString("battModel"));
|
| | | binf.setBattProductDate(rs.getDate("battProductDate"));
|
| | | binf.setBattInUseDate(rs.getDate("battInUseDate"));
|
| | | binf.setLoad_curr(rs.getFloat("load_curr"));
|
| | | binf.setInstall_user(rs.getString("install_user"));
|
| | | binf.setDisCurrMax(rs.getFloat("disCurrMax"));
|
| | | binf.setStation_phone(rs.getString("station_phone"));
|
| | | binf.setStation_install(rs.getInt("station_install"));
|
| | | list.add(binf);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | //去掉limit条件后的总数
|
| | | int number=LimitNumberFactory.GetLimtitNumber(conn, numberSql);
|
| | | //System.out.println("number: "+number);
|
| | | if(list!=null&&list.size()>0){
|
| | | list.get(list.size()-1).setNum(number);
|
| | | }
|
| | | return list;
|
| | | }
|
| | |
|
| | | public static void main(String[] args) throws ParseException {
|
| | | //new BattInfImpl().searchAll();
|
| | |
|
| | |
| | | binf.setBattGroupId(1000001);
|
| | | binf.setStationName("广西省-百色-GX百色乐业县立新小区WF-BTS设备");
|
| | | binf.setStationName1("");
|
| | | binf.setStationName2("");
|
| | | binf.setStationName2("百色");
|
| | | binf.setStationName3("");
|
| | | binf.setStationName5("");
|
| | | binf.setBattGroupName("");
|
| | | binf.setBattProducer("1");
|
| | | binf.setStationId("42000575");
|
| | | binf.setGroupIndexInFBSDevice(0);
|
| | | binf.setMonVolStd(2f);
|
| | | User_inf uinf=new User_inf();
|
| | | uinf.setUId(1002);
|
| | |
|
| | |
| | | System.out.println(list.size());*/
|
| | | /*int nums=biml.serchByInstall_count(uinf);
|
| | | System.out.println(nums);*/
|
| | | boolean bl=biml.judgeBattInOrNot(binf);
|
| | | System.out.println(bl);
|
| | | /*boolean bl=biml.judgeBattInOrNot(binf);
|
| | | System.out.println(bl);*/
|
| | | List<BattInf> list=biml.serchByDischarge(binf);
|
| | | for (BattInf b : list) {
|
| | | System.out.println(b);
|
| | | }
|
| | | System.out.println(list.size());
|
| | | }
|
| | |
|
| | | public List getResults(ResultSet rs) {
|