import sqlite3


def get_directories_for_department(c: sqlite3.Cursor, department: int) -> list:
    """Gets the list of directories for a department.

    :param c: An SQLite3 cursor.
    :param department: The department number.
    :return: The list of directories. Empty list if there is no directory for this department.
    :rtype: list
    """

    c.execute("""
    SELECT dpt.id as dpt_id, dpt.name as dpt_name, dpt.number as dpt_number,
    dir.id as dir_id, dir.name as dir_name, dir.acronyme as dir_acr
    FROM
    (
        SELECT id, name, number
        FROM departments
        WHERE number=?
        UNION
        SELECT id, name, number
        FROM departments
        WHERE parent_number=?
    ) dpt
    JOIN departments_directories dd ON dd.department_id = dpt.id
    JOIN directories dir ON dd.directory_id = dir.id
    """, (department, department))

    return c.fetchall()