| | |
| | |
|
| | | }
|
| | |
|
| | | //查询所有的机房
|
| | | //查询所有的省份(左侧导航第一层,查所有的省份,num中存放uid)
|
| | | public List serchAllStation(Object obj){
|
| | | User_inf uinf=(User_inf) obj;
|
| | | String sql="select DISTINCT stationid,StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationName6,StationName7,StationName8,StationName9,fBSDeviceId " +
|
| | | BattInf binf=(BattInf) obj;;
|
| | | String sql="select DISTINCT StationName " +
|
| | | " 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() {
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum()},new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | String conStr="-";//连接机房名称的符号
|
| | | try {
|
| | | while(rs.next()){
|
| | | BattInf batt = new BattInf();
|
| | | String stationName="";
|
| | | if(!rs.getString("StationName1").trim().equals("")){
|
| | | stationName+=rs.getString("StationName1");
|
| | | try {
|
| | | while(rs.next()){
|
| | | BattInf batt = new BattInf();
|
| | | batt.setStationName1(rs.getString("stationName1"));
|
| | | list.add(batt);
|
| | | }
|
| | | if(!rs.getString("StationName2").trim().equals("")){
|
| | | stationName+=conStr;
|
| | | stationName+=rs.getString("StationName2");
|
| | | }
|
| | | if(!rs.getString("StationName3").trim().equals("")){
|
| | | stationName+=conStr;
|
| | | stationName+=rs.getString("StationName3");
|
| | | }
|
| | | if(!rs.getString("StationName4").trim().equals("")){
|
| | | stationName+=conStr;
|
| | | stationName+=rs.getString("StationName4");
|
| | | }
|
| | | if(!rs.getString("StationName5").trim().equals("")){
|
| | | stationName+=conStr;
|
| | | stationName+=rs.getString("StationName5");
|
| | | }
|
| | | if(!rs.getString("StationName6").trim().equals("")){
|
| | | stationName+=conStr;
|
| | | stationName+=rs.getString("StationName6");
|
| | | }
|
| | | if(!rs.getString("StationName7").trim().equals("")){
|
| | | stationName+=conStr;
|
| | | stationName+=rs.getString("StationName7");
|
| | | }
|
| | | if(!rs.getString("StationName8").trim().equals("")){
|
| | | stationName+=conStr;
|
| | | stationName+=rs.getString("StationName8");
|
| | | }
|
| | | if(!rs.getString("StationName9").trim().equals("")){
|
| | | stationName+=conStr;
|
| | | stationName+=rs.getString("StationName9");
|
| | | }
|
| | | batt.setStationName(stationName);
|
| | | batt.setStationId(rs.getString("StationId"));
|
| | | batt.setFBSDeviceId(rs.getInt("fBSDeviceId"));
|
| | | list.add(batt);
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | } );
|
| | | return list;
|
| | | }
|
| | | //根据机房id查询机房下的电池组信息
|
| | | //查询管理的市(左侧导航第二层,查所有的市,num中存放uid)
|
| | | |
| | | //查询管理的市(左侧导航第二层,查所有的市,num中存放uid)
|
| | | public List serchStationName2(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="select DISTINCT StationName2 " +
|
| | | " 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 StationName1 like ?";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),"%"+binf.getStationName1()+"%"},new CallBack() {
|
| | | |
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()){
|
| | | BattInf batt = new BattInf();
|
| | | batt.setStationName2(rs.getString("stationName2"));
|
| | | list.add(batt);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | } );
|
| | | return list;
|
| | | }
|
| | | //查询管理的机房(左侧导航第三层,查所有的机房,num中存放uid)
|
| | | public List serchStationName3(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="select DISTINCT StationName3,stationid,fbsdeviceid " +
|
| | | " 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 StationName1 like ? and StationName2 like ? ";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%"},new CallBack() {
|
| | | |
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()){
|
| | | BattInf batt = new BattInf();
|
| | | batt.setStationName3(rs.getString("stationName3"));
|
| | | batt.setStationId(rs.getString("stationId"));
|
| | | batt.setFBSDeviceId(rs.getInt("fBSDeviceId"));
|
| | | list.add(batt);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | } );
|
| | | return list;
|
| | | }
|
| | | |
| | | |
| | | //根据机房id查询机房下的电池组信息(左侧导航第四层,根据机房查询下面的电池组,num中存放uid)
|
| | | public List serchBattByStation(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="select DISTINCT StationName,StationId,StationIP,FBSDeviceId,BattGroupName,BattGroupName1,BattGroupName2,MonCount,battgroupId,MonCapStd,MonVolStd,MonResStd,MonSerStd,BattProducer,BattInUseDate,GroupIndexInFBSDevice " +
|
| | | "from db_battinf.tb_battinf where stationid=? " +
|
| | | "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=?" +
|
| | | " ) " +
|
| | | "ORDER BY StationName1,battgroupId ";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{binf.getStationId()},new CallBack() {
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{binf.getNum(),binf.getStationId()},new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list = new ArrayList();
|
| | | String conStr="-";//连接机房名称的符号
|
| | | try {
|
| | | while (rs.next()) {
|
| | | BattInf batt = new BattInf();
|