@@ -126,11 +126,11 @@ public List<Repository> getSimpleReposByTagNameAndSortPagination(
126126 // TODO Auto-generated method stub
127127
128128 Map <String , Object > map = new HashMap <String , Object >();
129- if (!tag_name .get (0 ).equals ("all" ))
129+ if (!tag_name .get (0 ).equals ("all" ))
130130 map .put ("tag" , tag_name .get (0 ));
131- if (!tag_name .get (1 ).equals ("all" ))
131+ if (!tag_name .get (1 ).equals ("all" ))
132132 map .put ("language" , tag_name .get (1 ));
133- if (!tag_name .get (2 ).equals ("all" ))
133+ if (!tag_name .get (2 ).equals ("all" ))
134134 map .put ("year" , tag_name .get (2 ));
135135 map .put ("beginItem" , begin );
136136 map .put ("itemsPerPage" , itemsPerPage );
@@ -140,24 +140,27 @@ public List<Repository> getSimpleReposByTagNameAndSortPagination(
140140 "repo.getSimpleReposByTagNameSortGeneralPagination" , map );
141141 } else if (type == Sort .STAR ) {
142142 map .put ("type" , "stargazers" );
143- return sqlSession .selectList (
144- "repo.getSimpleReposByTagNameSortPagination" , map );
145143 } else if (type == Sort .FORK ) {
146144 map .put ("type" , "fork_num" );
147- return sqlSession .selectList (
148- "repo.getSimpleReposByTagNameSortPagination" , map );
149- } else {
145+ } else if (type == Sort .CONTRIBUTOR ) {
150146 map .put ("type" , "contributor" );
151- return sqlSession . selectList (
152- "repo.getSimpleReposByTagNameSortPagination" , map );
147+ } else {
148+ map . put ( "type" , "hot" );
153149 }
150+ return sqlSession .selectList (
151+ "repo.getSimpleReposByTagNameSortPagination" , map );
154152 }
155153
156154 @ Override
157155 public int getResultCountPagination (List <String > tagName , Sort type ) {
158156 // TODO Auto-generated method stub
159157 Map <String , Object > map = new HashMap <String , Object >();
160- map .put ("name" , tagName );
158+ if (!tagName .get (0 ).equals ("all" ))
159+ map .put ("tag" , tagName .get (0 ));
160+ if (!tagName .get (1 ).equals ("all" ))
161+ map .put ("language" , tagName .get (1 ));
162+ if (!tagName .get (2 ).equals ("all" ))
163+ map .put ("year" , tagName .get (2 ));
161164 return sqlSession .selectList ("repo.getSimpleReposByTagName" , map )
162165 .size ();
163166 }
@@ -173,7 +176,7 @@ public List<Integer> getStatCounts(String table) {
173176 // TODO Auto-generated method stub
174177 Map <String , Object > map = new HashMap <String , Object >();
175178 map .put ("table" , table );
176- return sqlSession .selectList ("repo.getStatCounts" ,map );
179+ return sqlSession .selectList ("repo.getStatCounts" , map );
177180 }
178181
179182 @ Override
@@ -182,6 +185,6 @@ public List<String> getStatTypes(String table, String column) {
182185 Map <String , Object > map = new HashMap <String , Object >();
183186 map .put ("table" , table );
184187 map .put ("column" , column );
185- return sqlSession .selectList ("repo.getStatTypes" ,map );
188+ return sqlSession .selectList ("repo.getStatTypes" , map );
186189 }
187190}
0 commit comments