packagecom.gsafety.opinion.pc.util;importjava.util.HashMap;importjava.util.List;importjava.util.Map;importjavax.annotation.PostConstruct;importorg.springframework.beans.factory.annotation.Autowired;importorg.springframework.stereotype.Component;importcom.gsafety.opinion.pc.mapper.CountriesMapper;importcom.gsafety.opinion.pc.mapper.EventTypeMapper;importcom.gsafety.opinion.pc.mapper.LocationPlaceMapper;importcom.gsafety.opinion.pc.po.Countries;importcom.gsafety.opinion.pc.po.EventType;importcom.gsafety.opinion.pc.po.LocationPlace;
@Componentpublic classPOCacheUtils {public static Map countriesMap = new HashMap();public static Map locationPlacesMap = new HashMap();public static Map eventTypeCodeMap = new HashMap();public static Map eventTypeNameMap = new HashMap();
@AutowiredprivateCountriesMapper countriesMapper;
@AutowiredprivateLocationPlaceMapper locationPlaceMapper;
@AutowiredprivateEventTypeMapper eventTypeMapper;
@PostConstructpublic voidinit(){
List countries=countriesMapper.queryAll();for(Countries tr:countries){
countriesMap.put(tr.getCode(), tr);
}
List locationPlace=locationPlaceMapper.queryAll();for(LocationPlace tr:locationPlace){
locationPlacesMap.put(tr.getCode(), tr);
}
List eventType=eventTypeMapper.queryAll();for(EventType tr:eventType){
eventTypeCodeMap.put(tr.getEventCode(), tr);
eventTypeNameMap.put(tr.getEventName(), tr);
}//List EventTypeNames=eventTypeMapper.queryAllName();
}
}