@Test public void changeServerGroup() throws Exception { Set<Long> appGroupIds = new HashSet<>(); appGroupIds.add(1L); appGroupIds.add(2L); int count = appGroupDao.changeServerGroup(2L, appGroupIds); System.out.println("changeServerGroup :-------> " + count); Assert.assertTrue(count > 0); }
public int changeServerGroup(Long newServerGroupId, Set<Long> appGroupIds) throws SQLException { if (CollectionUtils.isEmpty(appGroupIds)) { return 1; } String sql = "UPDATE app_group SET server_group_id = ? WHERE id in (" + StringUtil.joinCollectByComma(appGroupIds) + ") "; return this.updataBysql(sql, Parameter.integerOf(StringUtils.EMPTY, newServerGroupId)); }
AppGroupDao extends BaseDao { public int changeServerGroup(Long newServerGroupId, Set<Long> appGroupIds) throws SQLException { if (CollectionUtils.isEmpty(appGroupIds)) { return 1; } String sql = "UPDATE app_group SET server_group_id = ? WHERE id in (" + StringUtil.joinCollectByComma(appGroupIds) + ") "; return this.updataBysql(sql, Parameter.integerOf(StringUtils.EMPTY, newServerGroupId)); } }
AppGroupDao extends BaseDao { public int changeServerGroup(Long newServerGroupId, Set<Long> appGroupIds) throws SQLException { if (CollectionUtils.isEmpty(appGroupIds)) { return 1; } String sql = "UPDATE app_group SET server_group_id = ? WHERE id in (" + StringUtil.joinCollectByComma(appGroupIds) + ") "; return this.updataBysql(sql, Parameter.integerOf(StringUtils.EMPTY, newServerGroupId)); }  }
AppGroupDao extends BaseDao { public int changeServerGroup(Long newServerGroupId, Set<Long> appGroupIds) throws SQLException { if (CollectionUtils.isEmpty(appGroupIds)) { return 1; } String sql = "UPDATE app_group SET server_group_id = ? WHERE id in (" + StringUtil.joinCollectByComma(appGroupIds) + ") "; return this.updataBysql(sql, Parameter.integerOf(StringUtils.EMPTY, newServerGroupId)); }  Long insertAppGroup(AppGroup appGroup); AppGroup getAppGroupById(Long id); int updateAppGroup(AppGroup appGroup); int deleteAppGroup(AppGroup appGroup); Long getCountByName(String name); Long getCountByIdAndName(Long id, String name); int changeServerGroup(Long newServerGroupId, Set<Long> appGroupIds); List<AppGroup> getAppGroupsByServerGroupId(Long serverGroupId); Long getAppGroupTotalCount(Paging<AppGroup> paging); List<AppGroupView> findAppGroupPageList(Paging<AppGroup> paging); }
AppGroupDao extends BaseDao { public int changeServerGroup(Long newServerGroupId, Set<Long> appGroupIds) throws SQLException { if (CollectionUtils.isEmpty(appGroupIds)) { return 1; } String sql = "UPDATE app_group SET server_group_id = ? WHERE id in (" + StringUtil.joinCollectByComma(appGroupIds) + ") "; return this.updataBysql(sql, Parameter.integerOf(StringUtils.EMPTY, newServerGroupId)); }  Long insertAppGroup(AppGroup appGroup); AppGroup getAppGroupById(Long id); int updateAppGroup(AppGroup appGroup); int deleteAppGroup(AppGroup appGroup); Long getCountByName(String name); Long getCountByIdAndName(Long id, String name); int changeServerGroup(Long newServerGroupId, Set<Long> appGroupIds); List<AppGroup> getAppGroupsByServerGroupId(Long serverGroupId); Long getAppGroupTotalCount(Paging<AppGroup> paging); List<AppGroupView> findAppGroupPageList(Paging<AppGroup> paging);  }