@Test public void deleteByProjectAndUserIdS() throws Exception { Set<Long> userIds = new HashSet<>(); userIds.add(1L); userIds.add(2L); int count = userProjectDao.deleteByProjectAndUserIdS(1L, userIds); System.out.println("deleteByProjectAndUserIdS :-------> " + count); Assert.assertTrue(count > 0); }
public int deleteByProjectAndUserIdS(Long projectId, Set<Long> userIds) throws SQLException { String sql = "DELETE FROM user_project WHERE project_id = " + projectId + " and user_id in (" + StringUtil.joinCollectByComma(userIds) + ") "; return this.updataBysql(sql); }
UserProjectDao extends BaseDao { public int deleteByProjectAndUserIdS(Long projectId, Set<Long> userIds) throws SQLException { String sql = "DELETE FROM user_project WHERE project_id = " + projectId + " and user_id in (" + StringUtil.joinCollectByComma(userIds) + ") "; return this.updataBysql(sql); } }
UserProjectDao extends BaseDao { public int deleteByProjectAndUserIdS(Long projectId, Set<Long> userIds) throws SQLException { String sql = "DELETE FROM user_project WHERE project_id = " + projectId + " and user_id in (" + StringUtil.joinCollectByComma(userIds) + ") "; return this.updataBysql(sql); }  }
UserProjectDao extends BaseDao { public int deleteByProjectAndUserIdS(Long projectId, Set<Long> userIds) throws SQLException { String sql = "DELETE FROM user_project WHERE project_id = " + projectId + " and user_id in (" + StringUtil.joinCollectByComma(userIds) + ") "; return this.updataBysql(sql); }  Long insertUserProject(UserProject userProject); int[] insertUserProjectList(List<UserProject> userProjects); int updateUserProject(UserProject userProject); int deleteUserProjectByProjectId(Long project_id); int deleteByProjectAndUserIdS(Long projectId, Set<Long> userIds); List<UserProject> getUsersByProjectId(Long projectId); UserProject getMinUserProjectByProjectId(Long project_id); }
UserProjectDao extends BaseDao { public int deleteByProjectAndUserIdS(Long projectId, Set<Long> userIds) throws SQLException { String sql = "DELETE FROM user_project WHERE project_id = " + projectId + " and user_id in (" + StringUtil.joinCollectByComma(userIds) + ") "; return this.updataBysql(sql); }  Long insertUserProject(UserProject userProject); int[] insertUserProjectList(List<UserProject> userProjects); int updateUserProject(UserProject userProject); int deleteUserProjectByProjectId(Long project_id); int deleteByProjectAndUserIdS(Long projectId, Set<Long> userIds); List<UserProject> getUsersByProjectId(Long projectId); UserProject getMinUserProjectByProjectId(Long project_id);  }