xuxiuxi
2017-07-23 3ad6cbe55a4c63f4b64f6c999bf3db0a2b0187a4
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/sqlite/CheckInDao.java
@@ -160,7 +160,7 @@
        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 {
@@ -181,19 +181,9 @@
                    " 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";