| | |
| | | return c.getInt(0) > 0 ? true : false;
|
| | | }
|
| | |
|
| | | public ResultBean findCheckInLeftListById(long registerId) {
|
| | | public ResultBean findCheckInLeftVisitorListByVisitorId(long registerId) {
|
| | | SQLiteDatabase db = MainActivity.getInstance().db;
|
| | | ResultBean resultBean = new ResultBean();
|
| | | try {
|
| | |
| | | " LEFT JOIN company d ON d.company_id = a.company_id" +
|
| | | " LEFT JOIN department b ON a.department_id = b.dept_id" +
|
| | | " LEFT JOIN post e ON e.post_id = a.post_id" +
|
| | | " LEFT JOIN ( SELECT register_id, device_company_id from employee ) f ON f.register_id = a.register_id" +
|
| | | " WHERE" +
|
| | | " 1 = 1";
|
| | | String deviceCompanyId = BaseApplication.getInstance().getAndroidDevice().getCompanyId();
|
| | | if(true) {
|
| | | sql += " AND f.device_company_id = " + deviceCompanyId;
|
| | | }else{
|
| | | sql += " AND ( f.device_company_id != " + deviceCompanyId+" OR f.device_company_id IS NULL"+")";
|
| | | }
|
| | |
|
| | | if("" != null && !"".trim().isEmpty()) {
|
| | | sql += " AND a.register_id='"+ registerId + "'";
|
| | | }
|
| | | sql+=" order by a.name_en";
|
| | |
|
| | | String count = "select count(*) as count from (" + sql + " ) _table";
|