def METHOD_NAME(user=None, user_id=0, user_table=""):
    # Don't use it again.
    result = {"user_list": [], "user_str": "", "user_condition_str": ""}
    if user is None:
        user = User.objects.filter(id=user_id).first()
    if not user:
        return result
    departments = user.get_relative_department()
    department_ids = list(departments.values_list("id", flat=True))
    department_ids_arr = ",".join(list(map(str, department_ids)))
    user_ids = list(User.objects.filter(department__in=departments).values_list("id", flat=True))
    result["user_list"] = user_ids
    user_ids_arr = list(map(str, user_ids))
    user_str = ",".join(user_ids_arr)
    result["user_str"] = user_str
    result["department_list"] = department_ids
    result["department_str"] = department_ids_arr
    if user_table:
        result["user_condition_str"] = f" and {user_table}.department_id in ({department_ids_arr})"
    return result