UserProjectDao extends BaseDao { public UserProject getMinUserProjectByProjectId(Long project_id) throws SQLException { String sql = "SELECT id,project_id, user_id FROM user_project WHERE id=(SELECT min(id) FROM user_project WHERE project_id = ?)"; List<UserProject> list = this.queryBySql(sql, UserProject.class, Parameter.integerOf(StringUtils.EMPTY, project_id)); return CollectionUtils.isNotEmpty(list) ? list.get(0) : null; }  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);  }
@Test public void getMinUserProjectByProjectId() throws Exception { UserProject userProject = userProjectDao.getMinUserProjectByProjectId(39L); System.out.println("getMinUserProjectByProjectId :-------> " + userProject); Assert.assertTrue(userProject.getId() > 0); }