改造城市排行
This commit is contained in:
+2
@@ -43,4 +43,6 @@ public interface CitySellStatService {
|
||||
* @return
|
||||
*/
|
||||
CitySellStat findStartStat(String city);
|
||||
|
||||
List<CitySellStat> findCityOrderByAvgPrice(final String city, final Integer startDate, final int count) ;
|
||||
}
|
||||
|
||||
+15
-1
@@ -106,7 +106,7 @@ public class CitySellStatServiceImpl implements CitySellStatService {
|
||||
|
||||
@Override
|
||||
public List<CitySellStat> findNearCityStat(final String city, final Integer startDate, final int count) {
|
||||
return CacheUtils.getValue(this.getClass(), "findNearRegionStat",city+"_"+startDate, CachePolicyEnum.LONG,
|
||||
return CacheUtils.getValue(this.getClass(), "findNearCityStat",city+"_"+startDate, CachePolicyEnum.LONG,
|
||||
new Closure<List<CitySellStat>, String>() {
|
||||
@Override
|
||||
public List<CitySellStat> execute(String input) {
|
||||
@@ -136,4 +136,18 @@ public class CitySellStatServiceImpl implements CitySellStatService {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CitySellStat> findCityOrderByAvgPrice(final String city, final Integer startDate, final int count) {
|
||||
List<QueryParam> q = new ArrayList<QueryParam>();
|
||||
if (StringUtils.isNotBlank(city)) {
|
||||
q.add(new QueryParam("city", city));
|
||||
}
|
||||
q.add(new QueryParam("date", QueryParam.GREATER_THAN_EQUAL_OPERATOR, startDate));
|
||||
|
||||
List<SortParam> s = new ArrayList<SortParam>();
|
||||
s.add(new SortParam("avgPrice", false));
|
||||
return citySellStatDao.findAllByParams(q, s, count);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user