package com.example.web.dao;

import com.example.web.pojo.Department;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

public class DepartmentDao {
    //模拟数据库数据
    private static Map<Integer, Department>departments = null;

    static {
        departments =new HashMap<Integer,Department>();
        departments.put(101,new Department(101,"jad"));
    }
    public Collection<Department> getDepartments(){
        return departments.values();
    }
    public Department getDepartment(Integer id){
        return departments.get(id);
    }
}
