| | |
| | | public List<Company> getCompanyList( String deviceCompanyId){
|
| | | List<Company> result=new ArrayList<Company>();
|
| | | Company company=null;
|
| | | String sql="select * from company where is_synchron='N' and device_company_id="+deviceCompanyId;
|
| | | String sql="select * from company where is_synchron='N' and device_company_id="+Integer.parseInt(deviceCompanyId);
|
| | | Cursor c =MainActivity.getInstance().db.rawQuery(sql,new String[]{});
|
| | | if(c.moveToFirst()){
|
| | | company=new Company();
|
| | |
| | | company.setDeviceCompanyId(c.getString(c.getColumnIndex("device_company_id")));
|
| | | company.setIsSynchron(c.getString(c.getColumnIndex("is_synchron")));
|
| | | company.setUpdateTime(c.getString(c.getColumnIndex("update_time")));
|
| | | company.setIsValid(c.getString(c.getColumnIndex("is_valid")));
|
| | | company.setCreateTime(c.getString(c.getColumnIndex("create_time")));
|
| | | result.add(company);
|
| | | }
|
| | | return result;
|
| | |
| | | }
|
| | |
|
| | | //删除已上传给你服务器的数据
|
| | | public void delCompanyList(String deviceCompanyId){
|
| | | String sql="delete from company where is_synchron='N' and device_company_id="+deviceCompanyId;
|
| | | public void delCompanyList(){
|
| | | String sql="delete from company where is_synchron='N'";
|
| | | MainActivity.getInstance().db.execSQL(sql);
|
| | | }
|
| | |
|
| | | //获取未同步数据总数
|
| | | public int getSynDataCount(){
|
| | | String sql="select count(*) from company where is_synchron='N' ";
|
| | | Cursor c =MainActivity.getInstance().db.rawQuery(sql,new String[]{});
|
| | | c.moveToFirst();
|
| | | return c.getInt(0);
|
| | | }
|
| | |
|
| | | }
|