diff --git a/src/com/hellogithub/dao/projectDao.java b/src/com/hellogithub/dao/projectDao.java index 69aba00..cfe2ed3 100644 --- a/src/com/hellogithub/dao/projectDao.java +++ b/src/com/hellogithub/dao/projectDao.java @@ -50,7 +50,7 @@ public class projectDao { return projectEntity.getPeriodicals(); } /** - * 返回最所有项目总数 + * 返回所有项目总数 * * */ @@ -118,7 +118,7 @@ public class projectDao { try { Connection conn = JdbcUtils.getConnection(); QueryRunner runner = new QueryRunner(); - String sql = "select * from project where projectId in (select projectId from project_category where categoryId=?) order by startNum"; + String sql = "select * from project where projectId in (select projectId from project_category where categoryId=?) order by lookCount"; projectEntityList = runner.query(conn, sql, new BeanListHandler<>(projectEntity.class),cateid); conn.close(); } catch (SQLException e) { @@ -126,13 +126,13 @@ public class projectDao { } return projectEntityList; } - public List retMostStar(String id ){ + public List retMostStar( ){ List projectEntityList; try { Connection conn = JdbcUtils.getConnection(); QueryRunner runner = new QueryRunner(); - String sql = "select * from project where categoryId = ? order by lookCount desc"; - projectEntityList = runner.query(conn, sql, new BeanListHandler<>(projectEntity.class),id); + String sql = "select * from project order by lookCount desc"; + projectEntityList = runner.query(conn, sql, new BeanListHandler<>(projectEntity.class)); conn.close(); } catch (SQLException e) { throw new RuntimeException(e); diff --git a/src/com/hellogithub/service/projectService.java b/src/com/hellogithub/service/projectService.java index c7313ee..844455c 100644 --- a/src/com/hellogithub/service/projectService.java +++ b/src/com/hellogithub/service/projectService.java @@ -109,7 +109,7 @@ public class projectService { } return projectEntityList; } - public List retSelcetByStar(int cate,String id){ + public List retSelcetByStar(int cate){ Map dataMap=new HashMap<>(); dataMap.put(1,"C项目"); dataMap.put(2,"C#项目"); @@ -131,7 +131,7 @@ public class projectService { List projectEntityList; if (cate == 0){ - projectEntityList =projectDao.retMostStar(id); + projectEntityList =projectDao.retMostStar(); for(int i =0;i