{"size": 916, "ext": "js", "max_stars_repo_path": "db/index.js", "max_stars_repo_name": "ldw5/EmployeeSystem", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "db/index.js", "max_issues_repo_name": "ldw5/EmployeeSystem", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "db/index.js", "max_forks_repo_name": "ldw5/EmployeeSystem", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 33.9259259259, "max_line_length": 374, "alphanum_fraction": 0.673580786}
const server = require("../server")


class Team{
    constructor(server)
    {this.server = server;}

    viewDart(){
        return this.server.query(
            'SELECT * FROM department'
        )
    }
    viewEmploy(){
        return this.server.query(
            'SELECT employee.id, employee.first_name, employee.last_name, roles.title, department.name AS department, roles.salary, CONCAT(manager.first_name, manager.last_name) AS manager FROM employee LEFT JOIN roles on employee.role_id = roles.id LEFT JOIN department on roles.department_id = department.id LEFT JOIN employee manager on manager.id = employee.manager_id;'
        )
    }
    viewRole(){
        return this.server.query(
            'SELECT roles.id, roles.title, department.name AS department, roles.salary FROM roles LEFT JOIN department on roles.department_id = department.id;'
        )
    }
}


module.exports = new Team(server);
