@Test public void isNotExistByNameTest() throws SQLException { Project project = Project.builder().id(1L).name("name").build(); Assert.assertTrue(projectService.isNotExistByName(project)); }
public boolean isNotExistByName(Project project) throws SQLException { Long n = projectDao.getCountByName(project.getName()); Long i = projectDao.getCountByIdAndName(project.getId(), project.getName()); if (n == 0 || (n == 1 && i == 1)) { return true; } return false; }
ProjectService { public boolean isNotExistByName(Project project) throws SQLException { Long n = projectDao.getCountByName(project.getName()); Long i = projectDao.getCountByIdAndName(project.getId(), project.getName()); if (n == 0 || (n == 1 && i == 1)) { return true; } return false; } }
ProjectService { public boolean isNotExistByName(Project project) throws SQLException { Long n = projectDao.getCountByName(project.getName()); Long i = projectDao.getCountByIdAndName(project.getId(), project.getName()); if (n == 0 || (n == 1 && i == 1)) { return true; } return false; }  }
ProjectService { public boolean isNotExistByName(Project project) throws SQLException { Long n = projectDao.getCountByName(project.getName()); Long i = projectDao.getCountByIdAndName(project.getId(), project.getName()); if (n == 0 || (n == 1 && i == 1)) { return true; } return false; }  ValidatorChain validatePermision(LoginUser user, Project project, Errors errors); ServiceResult<String> insertProject(Project project); ServiceResult<String> updateProject(Project project); ServiceResult deleteCheck(Long projectId); ServiceResult<String> deleteProject(Project project); ListResult<ProjectView> findProjectPageList(Paging<ProjectModel> paging); boolean isExistByAppId(String appid); boolean isNotExistByAppId(Project project); boolean isNotExistByName(Project project); ServiceResult generateProjectXml(LoginUser user, Long projectId, String codeGenFilePath); ServiceResult<String> addDataCenter(LoginUser user, Project project); ServiceResult<String> updateDataCenter(LoginUser user, Project oldProject, ProjectView oldProjectView, Project newProject); ServiceResult<String> deleteDataCenter(LoginUser user, Project projec); ServiceResult<String> syncProject(LoginUser user, Project project); ConfigCkeckResult<List<ConfigDataResponse>> getCheckData(LoginUser user, Project project); ServiceResult getProjectButton(LoginUser user); }
ProjectService { public boolean isNotExistByName(Project project) throws SQLException { Long n = projectDao.getCountByName(project.getName()); Long i = projectDao.getCountByIdAndName(project.getId(), project.getName()); if (n == 0 || (n == 1 && i == 1)) { return true; } return false; }  ValidatorChain validatePermision(LoginUser user, Project project, Errors errors); ServiceResult<String> insertProject(Project project); ServiceResult<String> updateProject(Project project); ServiceResult deleteCheck(Long projectId); ServiceResult<String> deleteProject(Project project); ListResult<ProjectView> findProjectPageList(Paging<ProjectModel> paging); boolean isExistByAppId(String appid); boolean isNotExistByAppId(Project project); boolean isNotExistByName(Project project); ServiceResult generateProjectXml(LoginUser user, Long projectId, String codeGenFilePath); ServiceResult<String> addDataCenter(LoginUser user, Project project); ServiceResult<String> updateDataCenter(LoginUser user, Project oldProject, ProjectView oldProjectView, Project newProject); ServiceResult<String> deleteDataCenter(LoginUser user, Project projec); ServiceResult<String> syncProject(LoginUser user, Project project); ConfigCkeckResult<List<ConfigDataResponse>> getCheckData(LoginUser user, Project project); ServiceResult getProjectButton(LoginUser user);  }