ServerGroupDao extends BaseDao { public List<Server> serversNoGroup(Integer appGroupId) throws SQLException { String cond = StringUtils.EMPTY; if (null != appGroupId && appGroupId > 0) { cond = " and id != " + appGroupId; } String sql = "select id, name, comment, insert_time, update_time from server_group where id not in (select server_group_id from app_group where server_group_id != 0 " + cond + ")"; return this.queryBySql(sql, Server.class); }  Long insertServerGroup(ServerGroup serverGroup); ServerGroup getServerGroupById(Long id); List<ServerGroup> getAllServerGroups(); Long getCountByName(String name); Long getCountByIdAndName(Long id, String name); int updateServerGroup(ServerGroup serverGroup); int deleteServerGroup(ServerGroup serverGroup); int deleteServerGroupAndServerAndServerConfigByServerGroupId(Long serverGroupId); List<Server> serversNoGroup(Integer appGroupId); Long getServerGroupTotalCount(Paging<ServerGroup> paging); List<ServerGroupView> findServerGroupPageList(Paging<ServerGroup> paging);  }
@Test public void serversNoGroup() throws Exception { List<Server> list = serverGroupDao.serversNoGroup(3); System.out.println("serversNoGroup :-------> " + list); Assert.assertTrue(list.size() > 0); }