| | |
| | | } |
| | | return num; |
| | | } |
| | | //13,14,17,36,94-SubTablePageInfoUtils.java;88行 |
| | | public int getCount_stationId(DevAlarmPar param){ |
| | | String sql="SELECT count(distinct history.num) as number FROM db_alarm."+param.getRecordYear()+" history,db_battinf.tb_battinf " + |
| | | " where history.dev_id=db_battinf.tb_battinf.FbsDeviceId "; |
| | | /*if(param.getStationName1()!=null){ |
| | | if(param.getStationName1().equals("")){ |
| | | sql+=" and stationName1!='"+param.getStationName1()+"' "; |
| | | }else{ |
| | | sql+=" and stationName1='"+param.getStationName1()+"' "; |
| | | } |
| | | } |
| | | if(param.getStationName()!=null){ |
| | | if(param.getStationName().equals("")){ |
| | | sql+=" and stationName!='"+param.getStationName()+"' "; |
| | | }else{ |
| | | sql+=" and stationName='"+param.getStationName()+"' "; |
| | | } |
| | | }*/ |
| | | if(param.getStationId()!=null){ |
| | | if(param.getStationId().equals("")){ |
| | | sql+=" and stationId!='"+param.getStationId()+"' "; |
| | | }else{ |
| | | sql+=" and stationId='"+param.getStationId()+"' "; |
| | | } |
| | | } |
| | | sql+=" and alm_start_time >='"+ThreadLocalUtil.format(param.getAlmStartTime(),1)+"' and alm_start_time <='"+ThreadLocalUtil.format(param.getAlmStartTime1(),1)+"' "; |
| | | sql+=" and history.dev_id in(select distinct db_battinf.tb_battinf.FbsDeviceId " + |
| | | " from " + |
| | | " db_battinf.tb_battinf,db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr,db_user.tb_user_inf " + |
| | | " 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="+param.getUId()+")"; |
| | | List list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | LinkedList<Object> temp = new LinkedList<>(); |
| | | try { |
| | | while (rs.next()) |
| | | temp.add(rs.getInt("number")); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return temp; |
| | | } |
| | | }); |
| | | int num =0; |
| | | if(list!=null){ |
| | | num= (int) list.get(0); |
| | | } |
| | | return num; |
| | | } |
| | | |
| | | //15,41-PwrdevTimeOutAlarmService.java;28行 47行 |
| | | public List getList(int uId,String alarmParamTableName){ |
| | |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | public List getList2_stationId(DevAlarmPar param){ |
| | | String sql=" SELECT history.num,dev_id,dev_ip,alm_type,alm_level,alm_start_time,alm_end_time,alm_is_confirmed,alm_confirmed_time,alm_cleared_type,alm_severity, " + |
| | | " db_battinf.tb_battinf.stationName,stationName1,stationName2,stationName3,stationName5,db_battinf.tb_battinf.stationName4 as dev_name " + |
| | | " FROM db_alarm."+param.getRecordYear()+" history,db_battinf.tb_battinf " + |
| | | " where history.dev_id=db_battinf.tb_battinf.FbsDeviceId "; |
| | | /*if(param.getStationName1()!=null){ |
| | | if(param.getStationName1().equals("")){ |
| | | sql+=" and stationName1!='"+param.getStationName1()+"' "; |
| | | }else{ |
| | | sql+=" and stationName1='"+param.getStationName1()+"' "; |
| | | } |
| | | } |
| | | if(param.getStationName()!=null){ |
| | | if(param.getStationName().equals("")){ |
| | | sql+=" and stationName!='"+param.getStationName()+"' "; |
| | | }else{ |
| | | sql+=" and stationName='"+param.getStationName()+"' "; |
| | | } |
| | | }*/ |
| | | if(param.getStationId()!=null){ |
| | | if(param.getStationId().equals("")){ |
| | | sql+=" and stationId!='"+param.getStationId()+"' "; |
| | | }else{ |
| | | sql+=" and stationId='"+param.getStationId()+"' "; |
| | | } |
| | | } |
| | | sql+=" and alm_start_time >='"+ThreadLocalUtil.format(param.getAlmStartTime(),1)+"' and alm_start_time <='"+ThreadLocalUtil.format(param.getAlmStartTime1(),1)+"' "; |
| | | sql+=" and history.dev_id in(select distinct db_battinf.tb_battinf.FbsDeviceId " + |
| | | " from " + |
| | | " db_battinf.tb_battinf,db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr,db_user.tb_user_inf " + |
| | | " 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="+param.getUId()+") " + |
| | | " ORDER BY alm_start_time desc ,dev_name asc limit "+param.getLimitStart()+","+param.getLimitEnd()+" "; |
| | | List list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List<DevalarmDataHistory> list=new ArrayList<>(); |
| | | while (rs.next()){ |
| | | DevalarmDataHistory ph=new DevalarmDataHistory(); |
| | | ph.setNum(rs.getLong("num")); |
| | | ph.setDevId(rs.getInt("dev_id")); |
| | | ph.setDevIp(rs.getString("dev_ip")); |
| | | ph.setAlmType(rs.getInt("alm_type")); |
| | | ph.setAlmLevel(rs.getInt("alm_level")); |
| | | ph.setAlmStartTime(rs.getTimestamp("alm_start_time")); |
| | | ph.setAlmEndTime(rs.getTimestamp("alm_end_time")); |
| | | ph.setAlmIsConfirmed(rs.getInt("alm_is_confirmed")); |
| | | ph.setAlmConfirmedTime(rs.getTimestamp("alm_confirmed_time")); |
| | | ph.setAlmClearedType(rs.getInt("alm_cleared_type")); |
| | | ph.setDevName(rs.getString("dev_name")); |
| | | ph.setStationName(rs.getString("stationName")); |
| | | ph.setStationName1(rs.getString("stationName1")); |
| | | ph.setStationName2(rs.getString("stationName2")); |
| | | ph.setStationName3(rs.getString("stationName3")); |
| | | ph.setStationName5(rs.getString("stationName5")); |
| | | list.add(ph); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | //16,19,30,61,105,111,123-SubTablePageInfoUtils.java;188行 422行 |
| | | public List getList2(DevAlarmPar param){ |
| | | String sql=" SELECT history.num,dev_id,dev_ip,alm_type,alm_level,alm_start_time,alm_end_time,alm_is_confirmed,alm_confirmed_time,alm_cleared_type,alm_severity, " + |