//数据库查询
@Autowired
private ClassRoomMessageMapper classRoomMessageMapper;
@Autowired
private UserMapper userMapper;
@Autowired
private HistoryMapper historyMapper;
//工具类
private Date date = new Date();
//简化数据库列表
private Map<String,Object> map = new HashMap<>();
//状态图
private int state[][] = {{1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1}};
//获取非空的教室集
public void setMap(){
List<String> ClassRoomNameList = historyMapper.getAllClassRoomName();
for (String name:ClassRoomNameList) {
List<ApplicationEventHistory> historiesList = historyMapper.getSpecifyTimePeriod(getYear(),getMonth(),getDay(),name);
for (ApplicationEventHistory history:historiesList) {
int day = getDay() - history.getDay();
int starTime = history.getStartTime();
int endTime = history.getEndTime();
for (int i = starTime; i <= endTime; i++) {
state[day][i] = 0;
}
}
map.put(name,state);
}
}