| | |
| | | public List searchAll() {
|
| | | String sql=" select distinct db_sensor.tb_sensor_mapinfo.num,db_sensor.tb_sensor_mapinfo.sensor_dev_id,longitude,latitude,address "
|
| | | + " ,record_time,airtmp,airhum,smoke,water,lightintensity "
|
| | | + " ,province,city,county,device_name "
|
| | | + " ,province,city,county,device_name,airtmp_alarm,airhum_alarm,smoke_alarm "
|
| | | + " ,CO2concentration,COconcentration,CH4concentration,O2concentration,dev_commcount,dev_errcommcount "
|
| | | + " from db_sensor.tb_sensor_mapinfo,db_sensor.tb_sensor_state,db_sensor.tb_sensor_inf "
|
| | | + " where db_sensor.tb_sensor_mapinfo.sensor_dev_id=db_sensor.tb_sensor_state.sensor_dev_id "
|
| | | + " and db_sensor.tb_sensor_mapinfo.sensor_dev_id=db_sensor.tb_sensor_inf.sensor_dev_id ";
|
| | | List list=(List) DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() {
|
| | | |
| | | List list= DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() {
|
| | |
|
| | | @Override
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | sinf.setCity(rs.getString("city"));
|
| | | sinf.setCounty(rs.getString("county"));
|
| | | sinf.setDevice_name(rs.getString("device_name"));
|
| | | sinf.setAirtmp_alarm(rs.getFloat("airtmp_alarm"));
|
| | | sinf.setAirhum_alarm(rs.getFloat("airhum_alarm"));
|
| | | sinf.setSmoke_alarm(rs.getInt("smoke_alarm"));
|
| | |
|
| | | sinfo.setSinf(sinf);
|
| | |
|
| | |
| | |
|
| | | public static void main(String[] args) {
|
| | | Sensor_mapinfoImpl simpl=new Sensor_mapinfoImpl();
|
| | | List<Sensor_mapinfo> list=(List) simpl.searchAll();
|
| | | /*for (Sensor_mapinfo s : list) {
|
| | | List<Sensor_mapinfo> list=simpl.searchAll();
|
| | | for (Sensor_mapinfo s : list) {
|
| | | System.out.println(s);
|
| | | }*/
|
| | | }
|
| | | }
|
| | | }
|