| | |
| | |
|
| | | import javax.persistence.Id;
|
| | | import javax.sql.ConnectionEvent;
|
| | | import javax.swing.text.StyledEditorKit.BoldAction;
|
| | |
|
| | | import sun.security.action.GetBooleanAction;
|
| | |
|
| | | import com.fgkj.actions.ActionUtil;
|
| | | import com.fgkj.dao.BaseDAO;
|
| | | import com.fgkj.dao.BattinfGroupFactory;
|
| | | import com.fgkj.dao.CallBack;
|
| | | import com.fgkj.dao.DAOHelper;
|
| | | import com.fgkj.dao.FBS9100_ComBase;
|
| | |
| | | import com.fgkj.dto.Batttestdata;
|
| | | import com.fgkj.dto.Batttestdata_inf;
|
| | | import com.fgkj.dto.Batttestdatastop;
|
| | | import com.fgkj.dto.Database_backup;
|
| | | import com.fgkj.dto.Limit;
|
| | | import com.fgkj.dto.Page;
|
| | | import com.fgkj.dto.RoleLimit;
|
| | |
| | | //获取当前最大的stationid和battgroupid
|
| | | int maxs=42000000;//最大stationid
|
| | | int maxb=1000001;//最大battgroupid
|
| | | List maxList=(new BattInfImpl()).searchMaxId();
|
| | | if(maxList!=null&&maxList.size()>0){
|
| | | maxs=BattinfGroupFactory.searchStationId();
|
| | | maxb=BattinfGroupFactory.searchMaxBattgroupId();
|
| | | /*if(maxList!=null&&maxList.size()>0){
|
| | | maxs=(Integer) maxList.get(0)+1;
|
| | | maxb=(Integer) maxList.get(1)+1;
|
| | | }
|
| | | //maxb=(Integer) maxList.get(1)+1;
|
| | | }*/
|
| | | if(list!=null && list.size()>0){
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | BattInf binf=list.get(i);
|
| | |
| | | String sql = "insert into db_battinf.tb_battinf(" +
|
| | | "StationId,StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,FbsDeviceIp,FbsDeviceIp_YM,FbsDeviceIp_WG,"
|
| | | + "FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" +
|
| | | ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,install_user,DisCurrMax,station_phone" +
|
| | | ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,install_user,DisCurrMax,station_phone,Station_install" +
|
| | | ") values('"+binf.getStationId()+"','"+binf.getStationName()+"','"+binf.getStationName1()+"','"+binf.getStationName2()+"','"+binf.getStationName3()+"','"+binf.getStationName4()+"','"+binf.getStationName5()+
|
| | | "','"+binf.getStationIp()+"',"+binf.getFBSDeviceId()+",'"+binf.getFbsDeviceIp()+"','"+binf.getFbsDeviceIp_YM()+"','"+binf.getFbsDeviceIp_WG()+"','"+binf.getFBSDeviceName()+"',"+binf.getGroupIndexInFBSDevice()+
|
| | | ","+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.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++;
|
| | | }
|
| | | maxb++;
|
| | | sql_str.add(sql);
|
| | | |
| | | String baoji_sql_main="REPLACE into db_user.tb_user_battgroup_baojigroup_battgroup(baoji_group_id,StationId,BattGroupId) values('100011','"+binf.getStationId()+"',"+binf.getBattGroupId()+")";
|
| | | sql_str.add(baoji_sql_main);
|
| | | |
| | | // System.out.println(baoji_sql_main);
|
| | | 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_usr where uid="+((User_inf)ActionUtil.getUser()).getUId();
|
| | | sql_str.add(baoji_sql);
|
| | | {
|
| | | String msg="添加"+binf.getStationName()+"机房"+binf.getBattGroupId()+"电池组的信息";
|
| | | User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Increase, msg);
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | boolean bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
|
| | | Boolean bl=false;
|
| | | boolean en=BattinfGroupFactory.backup_battinf();
|
| | | if(en){
|
| | | bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
|
| | | }else{
|
| | | return false;
|
| | | }
|
| | | (new User_logService()).addPro(listU);//将用户的操作记录下来
|
| | | return bl;
|
| | |
|
| | |
| | | if(list!=null&&list.size()>0){
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | BattInf binf=list.get(i);
|
| | | //验证新添加的机房是否存在
|
| | | /*//验证新添加的机房是否存在
|
| | | List listS=(new BattInfImpl()).judgeBatt(binf);
|
| | | if(listS!=null&&listS.size()>0){
|
| | | binf.setStationId((String) listS.get(listS.size()-1));
|
| | | }else{
|
| | | //获取当前最大的stationid
|
| | | List maxList=(new BattInfImpl()).searchMaxId();
|
| | | int maxs=BattinfGroupFactory.searchStationId();
|
| | | binf.setStationId(String.valueOf(maxs));
|
| | | if(maxList!=null&&maxList.size()>0){
|
| | | int maxs=(Integer) maxList.get(0)+1;
|
| | | binf.setStationId(String.valueOf(maxs));
|
| | | }
|
| | | }
|
| | | String sql = "update db_battinf.tb_battinf set StationId='"+binf.getStationId()+"',StationName='"+binf.getStationName()+"',StationName1='"+binf.getStationName1()+"',StationName2='"+binf.getStationName2()+"',StationName3='"+binf.getStationName3()+"',StationName4='"+binf.getStationName4()+"',StationName5='"+binf.getStationName5()+"',StationIp='"+binf.getStationIp()+"',FBSDeviceId="+binf.getFBSDeviceId()+",FbsDeviceIp='"+binf.getFbsDeviceIp()+"',"
|
| | | }*/
|
| | | /*String sql = "update db_battinf.tb_battinf set StationId='"+binf.getStationId()+"',StationName='"+binf.getStationName()+"',StationName1='"+binf.getStationName1()+"',StationName2='"+binf.getStationName2()+"',StationName3='"+binf.getStationName3()+"',StationName4='"+binf.getStationName4()+"',StationName5='"+binf.getStationName5()+"',StationIp='"+binf.getStationIp()+"',FBSDeviceId="+binf.getFBSDeviceId()+",FbsDeviceIp='"+binf.getFbsDeviceIp()+"',"
|
| | | + "FBSDeviceName='"+binf.getFBSDeviceName()+"',GroupIndexInFBSDevice="+binf.getGroupIndexInFBSDevice()+",BattGroupNum="+binf.getBattGroupNum()+",BattGroupName='"+binf.getBattGroupName()+"',FloatVolLevel="+binf.getFloatVolLevel()+",OfflineVolLevel="+binf.getOfflineVolLevel()+",BattFloatCurrent="+binf.getBattFloatCurrent()+"," +
|
| | | "MonCount="+binf.getMonCount()+",MonCapStd="+binf.getMonCapStd()+",monVolStd="+binf.getMonVolStd()+",monResStd="+binf.getMonResStd()+",MonSerStd="+binf.getMonSerStd()+",MonVolLowToAvg="+binf.getMonVolLowToAvg()+",BattProducer='"+binf.getBattProducer()+"',BattModel='"+binf.getBattModel()+"',BattProductDate='"+DAOHelper.sdf.format(binf.getBattProductDate())+"',BattInUseDate='"+DAOHelper.sdf.format(binf.getBattInUseDate())+"', "
|
| | | +" Load_curr="+binf.getLoad_curr()+",install_user='"+binf.getInstall_user()+"',DisCurrMax="+binf.getDisCurrMax()+",station_phone='"+binf.getStation_phone()+"' where battgroupId="+binf.getBattGroupId();
|
| | | +" Load_curr="+binf.getLoad_curr()+",install_user='"+binf.getInstall_user()+"',DisCurrMax="+binf.getDisCurrMax()+",station_phone='"+binf.getStation_phone()+"',Station_install="+binf.getStation_install()+" where battgroupId="+binf.getBattGroupId();*/
|
| | | String sql = "replace into db_battinf.tb_battinf(" +
|
| | | "StationId,StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,FbsDeviceIp,FbsDeviceIp_YM,FbsDeviceIp_WG,"
|
| | | + "FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" +
|
| | | ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,install_user,DisCurrMax,station_phone,Station_install" +
|
| | | ") values('"+binf.getStationId()+"','"+binf.getStationName()+"','"+binf.getStationName1()+"','"+binf.getStationName2()+"','"+binf.getStationName3()+"','"+binf.getStationName4()+"','"+binf.getStationName5()+
|
| | | "','"+binf.getStationIp()+"',"+binf.getFBSDeviceId()+",'"+binf.getFbsDeviceIp()+"','"+binf.getFbsDeviceIp_YM()+"','"+binf.getFbsDeviceIp_WG()+"','"+binf.getFBSDeviceName()+"',"+binf.getGroupIndexInFBSDevice()+
|
| | | ","+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()+")";
|
| | | |
| | | sql_str.add(sql);
|
| | | {
|
| | | String msg="修改"+binf.getStationName()+"机房"+binf.getBattGroupId()+"电池组的信息";
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | Boolean bl=false;
|
| | | boolean en=BattinfGroupFactory.backup_battinf();
|
| | | if(en){
|
| | | bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
|
| | | }else{
|
| | | return false;
|
| | | }
|
| | | (new User_logService()).addPro(listU);//将用户的操作记录下来
|
| | | Boolean bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
|
| | | return bl;
|
| | | }
|
| | | //修改电池信息配置(ip地址,掩码和网关)
|
| | |
| | | boolean bl=DAOHelper.executeUpdate(DBUtil.getConn(), sql, null);
|
| | | return bl;
|
| | | }
|
| | | |
| | | //设置电池组充电电流阈值
|
| | | public boolean update_charge(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql = "update db_battinf.tb_battinf set charge_curr_max=? where BattGroupId=?";
|
| | | boolean bl=DAOHelper.executeUpdate(DBUtil.getConn(), sql, new Object[]{binf.getCharge_curr_max(),binf.getBattGroupId()});
|
| | | return bl;
|
| | | }
|
| | | //删除电池组(多个)
|
| | | public boolean del(Object obj) {
|
| | | List<BattInf> list=(List<BattInf>) obj;
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | Boolean bl=false;
|
| | | boolean en=BattinfGroupFactory.backup_battinf();
|
| | | if(en){
|
| | | bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
|
| | | }else{
|
| | | return false;
|
| | | }
|
| | | (new User_logService()).addPro(listU);//将用户的操作记录下来
|
| | | Boolean bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
|
| | | return bl;
|
| | | }
|
| | | //根据维护区和机房名称查询电池组信息(电池组信息配置)
|
| | |
| | | Page page=bmd.getPage();
|
| | | Connection conn= DBUtil.getConn();
|
| | | String numberSql=" SELECT FOUND_ROWS() number";
|
| | | String sql="select SQL_CALC_FOUND_ROWS distinct(StationId),StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,FbsDeviceIp_YM,FbsDeviceIp_WG,FbsDeviceIp,"
|
| | | String sql="select SQL_CALC_FOUND_ROWS distinct(StationId),StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,FbsDeviceIp_YM,FbsDeviceIp_WG,FbsDeviceIp,"
|
| | | + "FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" +
|
| | | ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,install_user,DisCurrMax,station_phone " +
|
| | | ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,install_user,DisCurrMax,station_phone,Station_install " +
|
| | | " From db_battinf.tb_battinf " +
|
| | | " Where StationName like ? and StationName1 like ? and StationName2 like ? and StationName5 like ? " +
|
| | | " order by StationId " +
|
| | |
| | | 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.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);
|
| | |
|
| | | }
|
| | |
| | | return list;
|
| | | }
|
| | | //添加电池组时查询出最大的机房id和电池组id
|
| | | public List searchMaxId(){
|
| | | String sql="select max(stationid) as maxs,max(battgroupid) as maxb from db_battinf.tb_battinf limit 1";
|
| | | public int searchMaxId(){
|
| | | String sql="select max(StationId) as id from db_battinf.tb_battinf limit 1";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | try {
|
| | |
|
| | | while(rs.next()){
|
| | | int maxs=42000000;
|
| | | int maxb=1000001;
|
| | | if(rs.getString("maxs") != null){
|
| | | maxs=Integer.parseInt(rs.getString("maxs"));
|
| | | int maxs=42010000;
|
| | | //int maxb=1000001;
|
| | | if(rs.getString("id") != null){
|
| | | maxs=Integer.parseInt(rs.getString("id"));
|
| | | }
|
| | | if(rs.getInt("maxb")!=0){
|
| | | /*if(rs.getInt("maxb")!=0){
|
| | | maxb=rs.getInt("maxb");
|
| | | }
|
| | | }*/
|
| | | list.add(maxs);
|
| | | list.add(maxb);
|
| | | //list.add(maxb);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | int stationid=0;
|
| | | if(list!=null&&list.size()>0){
|
| | | stationid=(Integer) list.get(list.size()-1);
|
| | | }
|
| | | return stationid;
|
| | | }
|
| | | //查询出当前存在内存中最大的设备的id(很重要**********)
|
| | | public int searchMaxdevId_binf(){
|
| | | String sql="select max(FbsDeviceId) 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 dev_id=0;
|
| | | if(rs.getString("id")!=null){}
|
| | | dev_id=rs.getInt("id");
|
| | | list.add(dev_id);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | int dev_id=0;
|
| | | if(list!=null&&list.size()>0){
|
| | | dev_id=(Integer) list.get(list.size()-1);
|
| | | }
|
| | | return dev_id;
|
| | | }
|
| | | //判断新增的机房是否存在
|
| | | public List judgeBatt(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="select distinct(StationId) "
|
| | | + "from db_battinf.tb_battinf where stationname=? limit 1";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationName()}, new CallBack() {
|
| | | |
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()){
|
| | | String stationid=rs.getString("stationid");
|
| | | list.add(stationid);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | |
| | | });
|
| | | return list;
|
| | | }
|
| | | //判断新增的电池组是否存在
|
| | | public List judgeBatt(Object obj){
|
| | | |
| | | //判断新增的机房是否存在
|
| | | public boolean judgeBattInOrNot(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="select distinct stationid from db_battinf.tb_battinf where stationname=? limit 1";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationName()}, new CallBack() {
|
| | |
| | | return list;
|
| | | }
|
| | | });
|
| | | return list;
|
| | | if(list!=null&&list.size()>0){
|
| | | return true;
|
| | | }else{
|
| | | return false;
|
| | | }
|
| | | }
|
| | | //0.4根据城市名称查电池组
|
| | | public List search(Object obj){
|
| | |
| | | public int serchByDeviceId(Object obj){
|
| | | User_inf uinf=(User_inf) obj;
|
| | | String sql=" SELECT COUNT(DISTINCT fbsdeviceid) number FROM db_battinf.tb_battinf " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
|
| | | " left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
|
| | | " where db_user.tb_user_inf.uid=? and db_battinf.tb_battinf.Station_install=1 " +
|
| | | " limit 1";
|
| | | " 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=? " +
|
| | | " ) " +
|
| | | " and db_battinf.tb_battinf.station_install=1";
|
| | | List<BattInf> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | }
|
| | | return number;
|
| | | }
|
| | | //查询设备总数(全部)
|
| | | public int serchByDeviceId_all(Object obj){
|
| | | //查单体总数(已安装的单体)
|
| | | public int serchByInstall_count(Object obj){
|
| | | User_inf uinf=(User_inf) obj;
|
| | | String sql=" SELECT COUNT(DISTINCT fbsdeviceid) number FROM db_battinf.tb_battinf " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
|
| | | " left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
|
| | | " where db_user.tb_user_inf.uid=? " +
|
| | | " limit 1";
|
| | | List<BattInf> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
|
| | | String sql=" SELECT sum(moncount) as nums 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=? " +
|
| | | " ) " +
|
| | | " and db_battinf.tb_battinf.station_install=1";
|
| | | //System.out.println(sql);
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | int nums=0;//单体总数
|
| | | try {
|
| | | while(rs.next()){
|
| | | BattInf binf=new BattInf();
|
| | | binf.setNum(rs.getInt("number"));
|
| | | list.add(binf);
|
| | | nums=rs.getInt("nums");
|
| | | list.add(nums);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | |
| | | });
|
| | | int number=0;//存放总数
|
| | | if(list!=null&&list.size()>0){
|
| | | number=list.get(list.size()-1).getNum();
|
| | | number=(Integer) list.get(list.size()-1);
|
| | | }
|
| | | return number;
|
| | | }
|
| | | //查询设备总数(全部)
|
| | | public List serchByDeviceId_all(Object obj){
|
| | | User_inf uinf=(User_inf) obj;
|
| | | String sql=" SELECT DISTINCT fbsdeviceid,station_install,monvolstd 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=? " +
|
| | | " ) ";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
|
| | | |
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | int num_2_install=0;//2v已安装
|
| | | int num_2=0;//2v全部
|
| | | int num_12_install=0;//12v已安装
|
| | | int num_12=0;//12v全部
|
| | | int num_install=0;//已安装
|
| | | int num=0;//全部
|
| | | try {
|
| | | while(rs.next()){
|
| | | int insatll=rs.getInt("station_install");
|
| | | float monvolstd=rs.getFloat("monvolstd");
|
| | | if(insatll==1){
|
| | | num_install+=1;
|
| | | if(monvolstd==2.0){
|
| | | num_2_install+=1;
|
| | | }else{
|
| | | num_12_install+=1;
|
| | | }
|
| | | }
|
| | | if(monvolstd==2.0){
|
| | | num_2+=1;
|
| | | }else{
|
| | | num_12+=1;
|
| | | }
|
| | | num+=1;
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | list.add(num_2_install);
|
| | | list.add(num_2);
|
| | | list.add(num_12_install);
|
| | | list.add(num_12);
|
| | | list.add(num_install);
|
| | | list.add(num);
|
| | | return list;
|
| | | }
|
| | | |
| | | });
|
| | | return list;
|
| | | }
|
| | | //-----------根据蓄电池组查不重复的MonCount(monNum)(单体编号)
|
| | | public List serchByMonNum(Object obj){
|
| | |
| | | " where db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId " +
|
| | | " and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
|
| | | " and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
|
| | | " and db_user.tb_user_inf.uid=?" +
|
| | | " and db_user.tb_user_inf.uid=? and db_battinf.tb_battinf.Station_install=1 " +
|
| | | " limit 1";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
|
| | |
|
| | |
| | | //查询管理的机房(左侧导航第四层,查所有的机房,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";SQL_CALC_FOUND_ROWS*/
|
| | | String sql=" select distinct(StationId),StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,"
|
| | | + "FBSDeviceName,GroupIndexInFBSDevice,db_battinf.tb_battinf.battgroupId,battGroupName,battGroupNum" +
|
| | | ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,Load_curr,DisCurrMax"
|
| | | + ",db_ram_db.tb_fbs9100_state.dev_version "
|
| | | + " from db_battinf.tb_battinf,db_ram_db.tb_fbs9100_state "
|
| | | + " where db_battinf.tb_battinf.FBSDeviceId=db_ram_db.tb_fbs9100_state.dev_id "
|
| | | + " and GroupIndexInFBSDevice=? and MonVolStd=? and Station_install=1 ";
|
| | | //+ " limit ?,? ";StationName1 like ? and StationName2 like ? and StationName3 like ? and StationName5 like ? "
|
| | | //,(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%",
|
| | | //条件
|
| | | String sql0=" and stationid=? "; //具体机房
|
| | | String sql1=" and stationname1=? ";//省
|
| | | String sql2=" and stationname2=? ";//市
|
| | | String sql5=" and stationname5=? ";//区县
|
| | | switch (binf.getNum()) {
|
| | | case 0:
|
| | | sql+=sql0;
|
| | | break;
|
| | | case 1:
|
| | | sql+=sql1;
|
| | | break;
|
| | | case 2:
|
| | | sql+=sql2;
|
| | | break;
|
| | | case 5:
|
| | | sql+=sql5;
|
| | | break;
|
| | | default:
|
| | | return null;
|
| | | }
|
| | | |
| | | //排序
|
| | | String orderSql=" order by StationId asc,GroupIndexInFBSDevice asc ";
|
| | | sql+=orderSql;
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[] {binf.getGroupIndexInFBSDevice(),binf.getMonVolStd(),binf.getStationName()}, new CallBack() {
|
| | | |
| | | @Override
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()) {
|
| | | BattInf binf = new BattInf();
|
| | | binf.setNum(0);
|
| | | 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.setBattGroupNum(rs.getInt("battGroupNum"));
|
| | | 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.setInstall_user(rs.getString("install_user"));*/
|
| | | binf.setLoad_curr(rs.getFloat("load_curr"));
|
| | | |
| | | binf.setDisCurrMax(rs.getFloat("disCurrMax"));
|
| | | /*binf.setStation_phone(rs.getString("station_phone"));
|
| | | binf.setStation_install(rs.getInt("station_install"));*/
|
| | | |
| | | |
| | | binf.setStationName9(rs.getString("dev_version"));
|
| | | 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 List serchByBatt_param(Object obj) {
|
| | | BattInf binf=(BattInf) obj;
|
| | | //Page page=binf.getPage();
|
| | | /*Connection conn=DBUtil.getConn();
|
| | | String numberSql=" SELECT FOUND_ROWS() number";SQL_CALC_FOUND_ROWS*/
|
| | | String sql=" select distinct(db_battinf.tb_battinf.StationId),StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,"
|
| | | + "FBSDeviceName,battGroupNum" +
|
| | | ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,Load_curr,DisCurrMax,montmpstd,floatVolLevel,offlineVolLevel,battFloatCurrent"
|
| | | + ",db_ram_db.tb_fbs9100_state.dev_version "
|
| | | + " from db_battinf.tb_battinf,db_ram_db.tb_fbs9100_state "
|
| | | + " where db_battinf.tb_battinf.FBSDeviceId=db_ram_db.tb_fbs9100_state.dev_id "
|
| | | + " and MonVolStd=? and Station_install=1 ";
|
| | | //+ " limit ?,? ";StationName1 like ? and StationName2 like ? and StationName3 like ? and StationName5 like ? "
|
| | | //,(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%",
|
| | | //条件
|
| | | String sql0=" and db_battinf.tb_battinf.stationid=? "; //具体机房
|
| | | String sql1=" and stationname1=? ";//省
|
| | | String sql2=" and stationname2=? ";//市
|
| | | String sql5=" and stationname5=? ";//区县
|
| | | switch (binf.getNum()) {
|
| | | case 0:
|
| | | sql+=sql0;
|
| | | break;
|
| | | case 1:
|
| | | sql+=sql1;
|
| | | break;
|
| | | case 2:
|
| | | sql+=sql2;
|
| | | break;
|
| | | case 5:
|
| | | sql+=sql5;
|
| | | break;
|
| | | default:
|
| | | return null;
|
| | | }
|
| | | |
| | | //排序
|
| | | String orderSql=" order by StationId asc,GroupIndexInFBSDevice asc ";
|
| | | sql+=orderSql;
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[] {binf.getMonVolStd(),binf.getStationName()}, new CallBack() {
|
| | | |
| | | @Override
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()) {
|
| | | BattInf binf = new BattInf();
|
| | | binf.setNum(0);
|
| | | 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.setBattGroupNum(rs.getInt("battGroupNum"));
|
| | | |
| | | 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.setMonTmpStd(rs.getFloat("monTmpStd"));
|
| | | /*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.setInstall_user(rs.getString("install_user"));*/
|
| | | binf.setLoad_curr(rs.getFloat("load_curr"));
|
| | | |
| | | binf.setDisCurrMax(rs.getFloat("disCurrMax"));
|
| | | /*binf.setStation_phone(rs.getString("station_phone"));
|
| | | binf.setStation_install(rs.getInt("station_install"));*/
|
| | | |
| | | |
| | | binf.setStationName9(rs.getString("dev_version"));
|
| | | 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 List serchBySys_param(Object obj) {
|
| | | BattInf binf=(BattInf) obj;
|
| | | //Page page=binf.getPage();
|
| | | /*Connection conn=DBUtil.getConn();
|
| | | String numberSql=" SELECT FOUND_ROWS() number";SQL_CALC_FOUND_ROWS*/
|
| | | String sql=" select distinct(tb_battinf.StationId),StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,"
|
| | | + "FBSDeviceName,count(FBSDeviceId) as batt_num" +
|
| | | ",MonCount,monVolStd,monResStd,MonSerStd,Load_curr,DisCurrMax,montmpstd,floatVolLevel,offlineVolLevel,battFloatCurrent"
|
| | | + ",GROUP_CONCAT(tb_battinf.MonCapStd order by groupIndexInFBSDevice separator '/' ) as moncapstds "
|
| | | + ",db_ram_db.tb_fbs9100_state.dev_version"
|
| | | + ",web_site.tb_batt_endurance.real_cap_group1 ,web_site.tb_batt_endurance.real_cap_group2,web_site.tb_batt_endurance.real_cap_group3,web_site.tb_batt_endurance.real_cap_group4 "
|
| | | + " from db_battinf.tb_battinf,db_ram_db.tb_fbs9100_state,web_site.tb_batt_endurance "
|
| | | + " where db_battinf.tb_battinf.FBSDeviceId=db_ram_db.tb_fbs9100_state.dev_id "
|
| | | + " and db_battinf.tb_battinf.FBSDeviceId=web_site.tb_batt_endurance.deviceid "
|
| | | + " and MonVolStd=? and Station_install=1 ";
|
| | | //+ " limit ?,? ";StationName1 like ? and StationName2 like ? and StationName3 like ? and StationName5 like ? "
|
| | | //,(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%",
|
| | | //条件
|
| | | String sql0=" and db_battinf.tb_battinf.stationid=? "; //具体机房
|
| | | String sql1=" and stationname1=? ";//省
|
| | | String sql2=" and stationname2=? ";//市
|
| | | String sql5=" and stationname5=? ";//区县
|
| | | switch (binf.getNum()) {
|
| | | case 0:
|
| | | sql+=sql0;
|
| | | break;
|
| | | case 1:
|
| | | sql+=sql1;
|
| | | break;
|
| | | case 2:
|
| | | sql+=sql2;
|
| | | break;
|
| | | case 5:
|
| | | sql+=sql5;
|
| | | break;
|
| | | default:
|
| | | return null;
|
| | | }
|
| | | |
| | | //排序
|
| | | String orderSql=" GROUP BY FBSDeviceId order by StationId asc,GroupIndexInFBSDevice asc ";
|
| | | sql+=orderSql;
|
| | | //System.out.println(sql);
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[] {binf.getMonVolStd(),binf.getStationName()}, new CallBack() {
|
| | | |
| | | @Override
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()) {
|
| | | BattInf binf = new BattInf();
|
| | | binf.setNum(0);
|
| | | 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.setBattGroupNum(rs.getInt("batt_num"));
|
| | | |
| | | 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.setMoncapstds(rs.getString("moncapstds"));
|
| | | binf.setReal_cap_group1(rs.getFloat("real_cap_group1"));
|
| | | binf.setReal_cap_group2(rs.getFloat("real_cap_group2"));
|
| | | binf.setReal_cap_group3(rs.getFloat("real_cap_group3"));
|
| | | binf.setReal_cap_group4(rs.getFloat("real_cap_group4"));
|
| | | |
| | | binf.setMonVolStd(rs.getFloat("monVolStd"));
|
| | | binf.setMonResStd(rs.getFloat("monResStd"));
|
| | | binf.setMonSerStd(rs.getFloat("monSerStd"));
|
| | | binf.setMonTmpStd(rs.getFloat("monTmpStd"));
|
| | | /*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.setInstall_user(rs.getString("install_user"));*/
|
| | | binf.setLoad_curr(rs.getFloat("load_curr"));
|
| | | |
| | | binf.setDisCurrMax(rs.getFloat("disCurrMax"));
|
| | | /*binf.setStation_phone(rs.getString("station_phone"));
|
| | | binf.setStation_install(rs.getInt("station_install"));*/
|
| | | |
| | | |
| | | binf.setStationName9(rs.getString("dev_version"));
|
| | | 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();
|
| | |
|
| | | BattInfImpl biml = new BattInfImpl();
|
| | | BattInf binf = new BattInf();
|
| | | binf.setNum(1002);
|
| | | binf.setNum(0);
|
| | | binf.setBattGroupId(1000001);
|
| | | binf.setStationName("");
|
| | | binf.setStationName("42000017");
|
| | | binf.setStationName1("");
|
| | | binf.setStationName2("");
|
| | | binf.setStationName3("");
|
| | | binf.setStationName5("");
|
| | | binf.setBattGroupName("");
|
| | | binf.setBattProducer("1");
|
| | | binf.setStationId("42000575");
|
| | | binf.setGroupIndexInFBSDevice(0);
|
| | | binf.setMonVolStd(12f);
|
| | | User_inf uinf=new User_inf();
|
| | | uinf.setUId(1002);
|
| | |
|
| | |
| | | //List<BattInf> list=biml.serchGroupByInfor(binf);
|
| | | //List<BattInf> list=biml.searchInform1(bmd);
|
| | | //<BattInf> list=biml.serchStationName5(binf);
|
| | | List<BattInf> list=biml.serchBattAllInfoByStationId(binf);
|
| | | /*List<BattInf> list=biml.serchBattAllInfoByStationId(binf);
|
| | | //List<BattInf> list=biml.searchInform_ky();
|
| | | for (BattInf b : list) {
|
| | | System.out.println(b);
|
| | | }
|
| | | System.out.println(list.size());
|
| | | System.out.println(list.size());*/
|
| | | /*int nums=biml.serchByInstall_count(uinf);
|
| | | System.out.println(nums);*/
|
| | | /*boolean bl=biml.judgeBattInOrNot(binf);
|
| | | System.out.println(bl);*/
|
| | | List<BattInf> list=biml.serchBySys_param(binf);
|
| | | for (BattInf b : list) {
|
| | | System.out.println(b);
|
| | | }
|
| | | /*List<BattInf> list=biml.serchByDischarge(binf);
|
| | | for (BattInf b : list) {
|
| | | System.out.println(b);
|
| | | }*/
|
| | | /*List list=biml.judgeBatt(binf);
|
| | | System.out.println(list);*/
|
| | | //System.out.println(list.size());
|
| | | }
|
| | |
|
| | | public List getResults(ResultSet rs) {
|