| | |
| | | }
|
| | | return number;
|
| | | }
|
| | | //查单体总数(已安装的单体)
|
| | | public int serchByInstall_count(Object obj){
|
| | | User_inf uinf=(User_inf) obj;
|
| | | 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()){
|
| | | nums=rs.getInt("nums");
|
| | | list.add(nums);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | |
| | | });
|
| | | int number=0;//存放总数
|
| | | if(list!=null&&list.size()>0){
|
| | | number=(Integer) list.get(list.size()-1);
|
| | | }
|
| | | return number;
|
| | | }
|
| | | //查询设备总数(全部)
|
| | | public List serchByDeviceId_all(Object obj){
|
| | | User_inf uinf=(User_inf) obj;
|
| | |
| | | //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);
|
| | | }
|
| | |
|
| | | public List getResults(ResultSet rs) {
|