| | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.fgkj.dao.BaseDAO; |
| | |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | //设备实时数据显示(前100笔数据服务器的时间) |
| | | @Override |
| | | public List serchByInfo(Object obj) { |
| | | // TODO Auto-generated method stub |
| | | return null; |
| | | Ac230v_ups ac=(Ac230v_ups) obj; |
| | | Date date=new Date(); |
| | | String table=DAOHelper.sdf_withOut.format(date); |
| | | String sql=" select * from db_partinsystem_history.ac230v_ups_"+ac.getDev_id()+"_"+table+" where dev_id=? limit 0,100"; |
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{ac.getDev_id()}, new CallBack() { |
| | | |
| | | @Override |
| | | public List getResults(ResultSet rs) { |
| | | List list=new ArrayList(); |
| | | try { |
| | | while(rs.next()){ |
| | | Ac230v_ups a=new Ac230v_ups(); |
| | | a.setDev_id(rs.getInt("dev_id")); |
| | | a.setRecord_time(rs.getTimestamp("record_time")); |
| | | a.setDCInput_vol(rs.getFloat("dCInput_vol")); |
| | | a.setACInput_vol(rs.getFloat("aCInput_vol")); |
| | | a.setBatt_vol(rs.getFloat("batt_vol")); |
| | | a.setBatt_curr(rs.getFloat("batt_curr")); |
| | | a.setACOutput_vol(rs.getFloat("aCOutput_vol")); |
| | | a.setACOutput_curr(rs.getFloat("aCOutput_curr")); |
| | | a.setDCOutput_vol(rs.getFloat("dCOutput_vol")); |
| | | a.setDCBus_vol(rs.getFloat("dCBus_vol")); |
| | | a.setRadiator_tmp(rs.getFloat("radiator_tmp")); |
| | | a.setThyristor_tmp(rs.getFloat("thyristor_tmp")); |
| | | a.setTransfor_tmp(rs.getFloat("transfor_tmp")); |
| | | a.setACInduc_tmp(rs.getFloat("aCInduc_tmp")); |
| | | a.setDCInduc_tmp(rs.getFloat("dCInduc_tmp")); |
| | | a.setEnviron_tmp(rs.getFloat("environ_tmp")); |
| | | a.setPower_state_code(rs.getInt("power_state_code")); |
| | | a.setError_code(rs.getInt("error_code")); |
| | | a.setWork_state(rs.getInt("work_state")); |
| | | a.setFault_state(rs.getInt("fault_state")); |
| | | |
| | | list.add(a); |
| | | } |
| | | } catch (SQLException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | } |