| | |
| | | " 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 ) " ;
|
| | | //System.out.println(sql);
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
|
| | |
|
| | |
| | | "and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ? and db_battinf.tb_battinf.stationname5 like ? ";
|
| | |
|
| | | //选取蓄电池组条件
|
| | | String idSqlT=" and db_battinf.tb_battinf.battgroupid!=? ";
|
| | | String idSqlF=" and db_battinf.tb_battinf.battgroupid=? ";
|
| | | String idSqlT=" and db_battinf.tb_battinf.battgroupid!=? and db_battinf.tb_battinf.Station_install=1 ";
|
| | | String idSqlF=" and db_battinf.tb_battinf.battgroupid=? and db_battinf.tb_battinf.Station_install=1 ";
|
| | | if(binf.getBattGroupId()==0){
|
| | | baseSql+=idSqlT;
|
| | | }else{
|
| | |
| | | }
|
| | | return list;
|
| | | }
|
| | |
|
| | |
|
| | | |
| | | //查询存在落后单体得机房个数
|
| | | public int searchBadBattInStation(Object obj) {
|
| | | User_inf uinf=(User_inf) obj;
|
| | | String sql=" select count(distinct db_battinf.tb_battinf.stationid) as nums from db_battinf.tb_battinf where station_install=1 " +
|
| | | " and db_battinf.tb_battinf.battgroupid in (select distinct tb_badbatt_mon.BattGroupId from web_site.tb_badbatt_mon) " +
|
| | | " and db_battinf.tb_battinf.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=? ) ";
|
| | | //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();
|
| | | try {
|
| | | while(rs.next()){
|
| | | list.add(rs.getInt("nums"));
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | int nums=0;//最后的结果
|
| | | if(list!=null&&list.size()>0){
|
| | | nums=(Integer) list.get(list.size()-1);
|
| | | }
|
| | | return nums;
|
| | | }
|
| | | public static void main(String[] args) throws ParseException {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | Date date1 = sdf.parse("2000-01-01");
|
| | |
| | | bmd.setBinf(binf);
|
| | | bmd.setPage(page);
|
| | | bmd.setUinf(uinf);
|
| | | List<Batt_Maint_Dealarm> list=bimpl.serchByInfo(bmd);
|
| | | /*List<Batt_Maint_Dealarm> list=bimpl.serchByInfo(bmd);
|
| | | for (Batt_Maint_Dealarm b : list) {
|
| | | System.out.println(b);
|
| | | }
|
| | | }*/
|
| | | int nums=bimpl.searchBadBattInStation(uinf);
|
| | | System.out.println(nums);
|
| | | }
|
| | |
|
| | |
|