| | |
| | | //查询所有的设备(四级)
|
| | | public List serchDevice(Object obj){
|
| | | Sensor_inf sinf=(Sensor_inf) obj;
|
| | | String sql=" select distinct sensor_dev_id,num,province,city,county,device_name from db_sensor.tb_sensor_inf where province like ? and city like ? and county like ? order by province asc";
|
| | | String sql=" select distinct sensor_dev_id,num,province,city,county,airtmp_alarm,airhum_alarm,smoke_alarm,device_name from db_sensor.tb_sensor_inf where province like ? and city like ? and county like ? order by province asc";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+sinf.getProvince()+"%","%"+sinf.getCity()+"%","%"+sinf.getCounty()+"%"}, new CallBack() {
|
| | |
|
| | | @Override
|
| | |
| | | s.setProvince(rs.getString("province"));
|
| | | s.setCity(rs.getString("city"));
|
| | | s.setCounty(rs.getString("county"));
|
| | | s.setAirtmp_alarm(rs.getFloat("airtmp_alarm"));
|
| | | s.setAirhum_alarm(rs.getFloat("airhum_alarm"));
|
| | | s.setSmoke_alarm(rs.getInt("smoke_alarm"));
|
| | | s.setDevice_name(rs.getString("device_name"));
|
| | | list.add(s);
|
| | | }
|
| | |
| | |
|
| | | public static void main(String[] args) {
|
| | | Sensor_infImpl simpl=new Sensor_infImpl();
|
| | | List list=simpl.serchProvice();
|
| | | //List list=simpl.serchProvice();
|
| | | Sensor_inf sinf=new Sensor_inf();
|
| | | sinf.setSensor_dev_id(291200001);
|
| | | List<Sensor_inf> list=simpl.serchByCondition(sinf);
|
| | | for (Sensor_inf s : list) {
|
| | | System.out.println(s);
|
| | | }
|
| | | System.out.println(list.size());
|
| | | }
|
| | |
|