| | |
| | |
|
| | | import cn.com.basic.face.base.MainActivity;
|
| | | import cn.com.basic.face.discern.entity.Device;
|
| | | import cn.com.basic.face.discern.query.item.DeviceQueryItem;
|
| | |
|
| | | /**
|
| | | * 设备Dao
|
| | |
| | | * @param belongId 所属设备Id(主设备)
|
| | | * @return
|
| | | */
|
| | | public List<Device> loadCamera(String type, String belongId) {
|
| | | public List<DeviceQueryItem> loadCamera(String type, String belongId) {
|
| | |
|
| | | List<Device> list = new ArrayList<Device>();
|
| | | List<DeviceQueryItem> list = new ArrayList<DeviceQueryItem>();
|
| | |
|
| | |
|
| | | try {
|
| | |
| | | sb.append(" AND a.belong_id = ").append(belongId) ;
|
| | | }
|
| | |
|
| | | Device aqi = null;
|
| | | DeviceQueryItem aqi = null;
|
| | |
|
| | | Cursor c = MainActivity.getInstance().db.rawQuery(sb.toString(), new String[]{});
|
| | | while (c.moveToNext()) {
|
| | | aqi = new Device();
|
| | | aqi = new DeviceQueryItem();
|
| | | aqi.setDeviceId(c.getString(c.getColumnIndex("device_id")));
|
| | | aqi.setCompanyId(c.getString((c.getColumnIndex("company_id"))));
|
| | | aqi.setDeviceName(c.getString((c.getColumnIndex("device_name"))));
|
| | |
| | | device.setType(c.getString(c.getColumnIndex("type")));
|
| | | device.setSchoolName(c.getString(c.getColumnIndex("school_name")));
|
| | | device.setScrappedDate(c.getString(c.getColumnIndex("scrapped_date")));
|
| | | device.setIsValid(c.getString(c.getColumnIndex("is_valid")));
|
| | | device.setCreateTime(c.getString(c.getColumnIndex("create_time")));
|
| | | result.add(device);
|
| | | }
|
| | | return result;
|
| | |
| | | public int getSynDataCount(){
|
| | | String sql="select count(*) from device where is_synchron='N' ";
|
| | | Cursor c =MainActivity.getInstance().db.rawQuery(sql,new String[]{});
|
| | | return c.getCount();
|
| | | c.moveToFirst();
|
| | | return c.getInt(0);
|
| | | }
|
| | |
|
| | | }
|