public static void testSaveEpgModel() { ApplicationContext context = new FileSystemXmlApplicationContext("classpath:spring-config.xml"); IEpgModelDao epgModelDao = (IEpgModelDao) context.getBean("epgModelDao"); ITvListDao tvListDao = (ITvListDao) context.getBean("tvListDao"); TvListRequestAckData tvList = tvListDao.findTvListByDay("2013-04-10"); epgModelDao.saveEpgModelsByTvList(tvList); }
/** @param args */ public static void main(String[] args) { // String s = "经典剧场:飞虎神鹰22"; ApplicationContext context = new FileSystemXmlApplicationContext("classpath:spring-config.xml"); IEpgModelDao epgDao = (IEpgModelDao) context.getBean("epgModelDao"); List<EpgModelDistinctId> ids = epgDao.groupByNameAndWikiId(); for (EpgModelDistinctId id : ids) { String name = id.getName(); if (name.contains(":")) { if (name.contains("剧场:")) { name = name.substring(name.indexOf(":") + 1, name.length()); } else if (name.contains("连续剧:")) { name = name.substring(name.indexOf(":") + 1, name.length()); } else if (name.contains("影院:")) { name = name.substring(name.indexOf(":") + 1, name.length()); } else if (name.contains("电影:")) { name = name.substring(name.indexOf(":") + 1, name.length()); } else if (name.contains("养生")) { name = name.substring(name.indexOf(":") + 1, name.length()); } else if (name.contains("故事")) { name = name.substring(name.indexOf(":") + 1, name.length()); } } } }
public static void testGroupEpgModel() { ApplicationContext context = new FileSystemXmlApplicationContext("classpath:spring-config.xml"); IEpgModelDao epgModelDao = (IEpgModelDao) context.getBean("epgModelDao"); System.out.println(epgModelDao.groupByNameAndWikiId()); }
public static void testFindEpgModel() { ApplicationContext context = new FileSystemXmlApplicationContext("classpath:spring-config.xml"); IEpgModelDao epgModelDao = (IEpgModelDao) context.getBean("epgModelDao"); System.out.println(epgModelDao.findEpgModelById("5166512454eab35400499bcc")); }