| | |
| | | //查询所有的城市(三级)
|
| | | public List serchCounty(Object obj){
|
| | | Sensor_inf sinf=(Sensor_inf) obj;
|
| | | String sql=" select distinct county from db_sensor.tb_sensor_inf where province like ? and city like ? order by province asc";
|
| | | String sql=" select distinct county,sensor_dev_id,province,device_name from db_sensor.tb_sensor_inf where province like ? and city like ? order by province asc";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+sinf.getProvince()+"%","%"+sinf.getCity()+"%"}, new CallBack() {
|
| | |
|
| | | @Override
|
| | |
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()){
|
| | | String county=rs.getString("county");
|
| | | list.add(county);
|
| | | Sensor_inf s=new Sensor_inf();
|
| | | s.setSensor_dev_id(rs.getInt("sensor_dev_id"));
|
| | | s.setProvince(rs.getString("province"));
|
| | | s.setCity(rs.getString("city"));
|
| | | s.setCounty(rs.getString("county"));
|
| | | s.setDevice_name(rs.getString("device_name"));
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|