/** * 关联查询,获取用户职位信息 * * @return */ public Position getPosition() { Long positionid = getUserInfo().getLong("position_id"); Position position = Position.dao.findById(positionid); if (ValiKit.isNullOrEmpty(position)) { return null; } return position; }
/** * 关联查询,获取用户分公司信息 * * @return */ public Branch getBranch() { Long branchid = getUserInfo().getLong("branch_id"); Branch branch = Branch.dao.findById(branchid); if (ValiKit.isNullOrEmpty(branch)) { return null; } return branch; }
/** * 关联查询,获取用户部门信息 * * @return */ public Apartment getDepartment() { Long departmentid = getUserInfo().getLong("apartment_id"); Apartment department = Apartment.dao.findById(departmentid); if (ValiKit.isNullOrEmpty(department)) { return null; } return department; }
/** * 关联查询,获取用户详细信息 * * @return */ public UserInfo getUserInfo() { Long userid = getLong("id"); UserInfo userinfo = UserInfo.dao.findFirstBy("user_id=?", userid); if (ValiKit.isNullOrEmpty(userinfo)) { return null; } return userinfo; }