@Test public void testWC4_SelectWordCountByWord_查询词频统计结果0查询某个词频结果() { assertEquals(13, wordCount.selectWordCountByWord("词语1")); assertEquals(15, wordCount.selectWordCountByWord("词语2")); assertEquals(9, wordCount.selectWordCountByWord("词语3")); }
public int selectWordCountByWord(String word) { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { WordCountDao wordCountDao = sqlSession.getMapper(WordCountDao.class); return wordCountDao.selectWordCountByWord(word); } }
WordCount { public int selectWordCountByWord(String word) { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { WordCountDao wordCountDao = sqlSession.getMapper(WordCountDao.class); return wordCountDao.selectWordCountByWord(word); } } }
WordCount { public int selectWordCountByWord(String word) { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { WordCountDao wordCountDao = sqlSession.getMapper(WordCountDao.class); return wordCountDao.selectWordCountByWord(word); } } WordCount(MybatisConfig.ServerEnum server); }
WordCount { public int selectWordCountByWord(String word) { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { WordCountDao wordCountDao = sqlSession.getMapper(WordCountDao.class); return wordCountDao.selectWordCountByWord(word); } } WordCount(MybatisConfig.ServerEnum server); void addWordCountByOne(String word); void deleteWordCount(String word); void insertWordCount(String tablename, String word, int count); boolean isWordCountExisted(String word); int selectWordCountByWord(String word); List<WordAndCount> selectWordCountTopN(int N); void updateWordCount(String word, int count); }
WordCount { public int selectWordCountByWord(String word) { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { WordCountDao wordCountDao = sqlSession.getMapper(WordCountDao.class); return wordCountDao.selectWordCountByWord(word); } } WordCount(MybatisConfig.ServerEnum server); void addWordCountByOne(String word); void deleteWordCount(String word); void insertWordCount(String tablename, String word, int count); boolean isWordCountExisted(String word); int selectWordCountByWord(String word); List<WordAndCount> selectWordCountTopN(int N); void updateWordCount(String word, int count);  }