@Test public void isNotExistByNameTest() throws Exception { DasGroup group = DasGroup.builder().group_name("name").build(); Assert.assertTrue(groupService.isNotExistByName(group)); }
public boolean isNotExistByName(DasGroup group) throws SQLException { Long n = groupDao.getCountByName(group.getGroup_name()); Long i = groupDao.getCountByIdAndName(group.getId(), group.getGroup_name()); if (n == 0 || (n == 1 && i == 1)) { return true; } return false; }
GroupService { public boolean isNotExistByName(DasGroup group) throws SQLException { Long n = groupDao.getCountByName(group.getGroup_name()); Long i = groupDao.getCountByIdAndName(group.getId(), group.getGroup_name()); if (n == 0 || (n == 1 && i == 1)) { return true; } return false; } }
GroupService { public boolean isNotExistByName(DasGroup group) throws SQLException { Long n = groupDao.getCountByName(group.getGroup_name()); Long i = groupDao.getCountByIdAndName(group.getId(), group.getGroup_name()); if (n == 0 || (n == 1 && i == 1)) { return true; } return false; }  }
GroupService { public boolean isNotExistByName(DasGroup group) throws SQLException { Long n = groupDao.getCountByName(group.getGroup_name()); Long i = groupDao.getCountByIdAndName(group.getId(), group.getGroup_name()); if (n == 0 || (n == 1 && i == 1)) { return true; } return false; }  ValidatorChain validatePermision(LoginUser user, Errors errors); boolean addDalGroup(LoginUser user, DasGroup group); boolean updateDalGroup(LoginUser user, DasGroup group); boolean isInSuperGroup(String userNo); boolean isInCurrentGroup(Long userId, int currentGroupId); ListResult<DalGroupView> findGroupPageList(Paging<DasGroup> paging); boolean isNotExistByName(DasGroup group); boolean isNotExistInProjectAndGroup(String name); int initAdminGroup(); }
GroupService { public boolean isNotExistByName(DasGroup group) throws SQLException { Long n = groupDao.getCountByName(group.getGroup_name()); Long i = groupDao.getCountByIdAndName(group.getId(), group.getGroup_name()); if (n == 0 || (n == 1 && i == 1)) { return true; } return false; }  ValidatorChain validatePermision(LoginUser user, Errors errors); boolean addDalGroup(LoginUser user, DasGroup group); boolean updateDalGroup(LoginUser user, DasGroup group); boolean isInSuperGroup(String userNo); boolean isInCurrentGroup(Long userId, int currentGroupId); ListResult<DalGroupView> findGroupPageList(Paging<DasGroup> paging); boolean isNotExistByName(DasGroup group); boolean isNotExistInProjectAndGroup(String name); int initAdminGroup();  }