DataBaseSetEntryDao extends BaseDao { public Long getCountByIdAndName(Long id, String name) throws SQLException { String sql = "SELECT count(1) FROM databasesetentry WHERE name='" + name + "' and id = " + id; return this.getCount(sql); }  Long insertDatabaseSetEntry(DatabaseSetEntry dbsetEntry); int[] insertDatabaseSetEntrylist(List<DatabaseSetEntry> dbsetEntryList); int updateDatabaseSetEntry(DatabaseSetEntry dbsetEntry); int deleteDatabaseSetEntryById(Long id); Long getCountByName(String name); Long getCountByIdAndName(Long id, String name); List<DatabaseSetEntry> getAllDbSetEntryByDbSetId(Long dbset_id); DatabaseSetEntry getDataBaseSetEntryById(Long id); DatabaseSetEntryView getDataBaseSetEntryByDbId(Long dataBaseId); List<DatabaseSetEntryView> getDataBaseSetEntryListByDbSetId(Long dbsetId); List<DatabaseSetEntry> getAllDbSetEntryByDbSetIds(List<Integer> dbset_ids); List<DatabaseSetEntry> getDatabaseSetEntrysByDbNames(List<String> names); Long getDbSetEntryTotalCount(Paging<DatabaseSetEntry> paging); List<DatabaseSetEntryView> findDbSetEntryPageList(Paging<DatabaseSetEntry> paging);  }
@Test public void getCountByIdAndName() throws Exception { Long count = dataBaseSetEntryDao.getCountByIdAndName(610L, "dbsetname"); System.out.println("getCountByIdAndName :-------> " + count); Assert.assertTrue(count > 0); }