File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
java/ru/mystamps/web/dao/impl Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,8 @@ public String findLastCreatedByUser(Integer userId) {
223223 return jdbcTemplate .queryForObject (
224224 findLastCreatedByUserSql ,
225225 Collections .singletonMap ("created_by" , userId ),
226- String .class );
226+ String .class
227+ );
227228 } catch (EmptyResultDataAccessException ignored ) {
228229 return null ;
229230 }
@@ -237,10 +238,9 @@ public String findPopularCountryInCollection(Integer userId) {
237238 try {
238239 return jdbcTemplate .queryForObject (
239240 findPopularCountryInCollectionSql ,
240- Collections .< String , Object > emptyMap ( ),
241+ Collections .singletonMap ( "user_id" , userId ),
241242 String .class
242243 );
243-
244244 } catch (EmptyResultDataAccessException ignored ) {
245245 return null ;
246246 }
Original file line number Diff line number Diff line change @@ -92,10 +92,12 @@ country.find_last_created_by_user = \
9292 LIMIT 1
9393
9494country.find_popular_country_from_user_collection = \
95- SELECT c .slug \
95+ SELECT co .slug \
9696 FROM collections c \
9797 JOIN collections_series cs ON c.id = cs.collection_id \
98- WHERE c.user_id = :user_id \
99- GROUP BY country_id \
100- ORDER BY COUNT(*) DESC\
101- LIMIT 1
98+ JOIN series s ON s.id = cs.series_id \
99+ JOIN countries co ON co.id = s.country_id \
100+ WHERE c.user_id = :user_id \
101+ GROUP BY co.id \
102+ ORDER BY COUNT(*) DESC \
103+ LIMIT 1
You can’t perform that action at this time.
0 commit comments