use of com.po.Movie in project Movie by batsqd.
the class MovieInfoService method getMoviesOrderByReleaseTimeToPage.
public ArrayList<Movie> getMoviesOrderByReleaseTimeToPage(String movie_genres, int begain, int end) {
ApplicationContext ac = ApplicationContextUtil.getApplicationContext();
MovieMapper movieMapper = (MovieMapper) ac.getBean("movieMapper");
HashMap<String, Object> parameter = new HashMap<String, Object>();
///////--
parameter.put("movie_genres", "%" + movie_genres + "%");
parameter.put("begain", begain);
parameter.put("end", end);
ArrayList<Movie> moviesList = movieMapper.selectMoviesByReleaseTimeLimit(parameter);
return moviesList;
}
use of com.po.Movie in project Movie by batsqd.
the class MovieInfoService method getMoviesBySearchKeyWordToPage.
public ArrayList<Movie> getMoviesBySearchKeyWordToPage(String keyWord, int begain, int end) {
ApplicationContext ac = ApplicationContextUtil.getApplicationContext();
MovieMapper movieMapper = (MovieMapper) ac.getBean("movieMapper");
HashMap<String, Object> parameter = new HashMap<String, Object>();
parameter.put("keyWord", "%" + keyWord + "%");
parameter.put("begain", begain);
parameter.put("end", end);
ArrayList<Movie> moviesList = movieMapper.selectMoviesBySearchKeyWordLimit(parameter);
return moviesList;
}
use of com.po.Movie in project Movie by batsqd.
the class MovieInfoService method getMoviesByGenresToPage.
public ArrayList<Movie> getMoviesByGenresToPage(String movie_genres, int begain, int end) {
ApplicationContext ac = ApplicationContextUtil.getApplicationContext();
MovieMapper movieMapper = (MovieMapper) ac.getBean("movieMapper");
HashMap<String, Object> parameter = new HashMap<String, Object>();
//movie_genres
parameter.put("movie_genres", "%" + movie_genres + "%");
parameter.put("begain", begain);
parameter.put("end", end);
ArrayList<Movie> moviesList = movieMapper.selectMoviesByGenresAndLimit(parameter);
return moviesList;
}
use of com.po.Movie in project Movie by batsqd.
the class MovieController method getHotMovies.
@RequestMapping("getHotMovies.action")
public ModelAndView getHotMovies() {
long l = System.currentTimeMillis();
Date date = new Date(l);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
String rating_time = dateFormat.format(date);
ApplicationContext ac = ApplicationContextUtil.getApplicationContext();
WatchMovieMapper watchMovieMapper = (WatchMovieMapper) ac.getBean("watchMovieMapper");
HashMap<String, Object> parameter = new HashMap<String, Object>();
parameter.put("rating_time", rating_time);
parameter.put("hot_movie_nums", Configs.hot_movie_nums);
ArrayList<Integer> movie_id_List = (ArrayList<Integer>) watchMovieMapper.selectHotMovies(parameter);
MovieMapper movieMapper = (MovieMapper) ac.getBean("movieMapper");
List<Movie> moviesList = new ArrayList<Movie>();
for (int i = 0; i < movie_id_List.size(); i++) {
//此处拿到movie ID 去movie表查询List<movie>
Movie movie = movieMapper.selectMovieById(movie_id_List.get(i));
moviesList.add(movie);
}
ModelAndView modelAndView = new ModelAndView();
modelAndView.addObject("moviesList", moviesList);
modelAndView.setViewName("/WEB-INF/jsp/hotMovies.jsp");
return modelAndView;
}
use of com.po.Movie in project Movie by batsqd.
the class MovieController method getMovieDetailAndCollectionFeedback.
@RequestMapping("getMovieDetailAndCollectFeedback.action")
public ModelAndView getMovieDetailAndCollectionFeedback(int movie_id, HttpSession session) {
ApplicationContext ac = ApplicationContextUtil.getApplicationContext();
MovieMapper movieMapper = (MovieMapper) ac.getBean("movieMapper");
Movie movie = movieMapper.selectMovieById(movie_id);
ModelAndView modelAndView = new ModelAndView();
session.setAttribute("movieDetail", movie);
//modelAndView.addObject("movieDetail", movie);
modelAndView.setViewName("/WEB-INF/jsp/userFeedback.jsp");
return modelAndView;
}
Aggregations