优化
This commit is contained in:
+13
-25
@@ -109,37 +109,25 @@ public class RegionSellStatServiceImpl implements RegionSellStatService {
|
||||
|
||||
@Override
|
||||
public List<RegionSellStat> findNearCityStat(final String city, final String region, final Integer startDate, final int count) {
|
||||
return CacheUtils.getValue(this.getClass(), "findNearRegionStat",city+"_"+startDate, CacheUtils.CachePolicyEnum.LONG,
|
||||
new Closure<List<RegionSellStat>, String>() {
|
||||
@Override
|
||||
public List<RegionSellStat> execute(String input) {
|
||||
List<QueryParam> q = new ArrayList<QueryParam>(5);
|
||||
q.add(new QueryParam("city", city));
|
||||
q.add(new QueryParam("region", region));
|
||||
q.add(new QueryParam("date", QueryParam.GREATER_THAN_EQUAL_OPERATOR, startDate));
|
||||
List<QueryParam> q = new ArrayList<QueryParam>(5);
|
||||
q.add(new QueryParam("city", city));
|
||||
q.add(new QueryParam("region", region));
|
||||
q.add(new QueryParam("date", QueryParam.GREATER_THAN_EQUAL_OPERATOR, startDate));
|
||||
|
||||
List<SortParam> s = new ArrayList<SortParam>();
|
||||
s.add(new SortParam("date", false));
|
||||
return regionSellStatDao.findAllByParams(q, s, count);
|
||||
}
|
||||
});
|
||||
List<SortParam> s = new ArrayList<SortParam>();
|
||||
s.add(new SortParam("date", false));
|
||||
return regionSellStatDao.findAllByParams(q, s, count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegionSellStat findStartStat(final String city, final String region) {
|
||||
return CacheUtils.getValue(this.getClass(), "findStartStat",city, CacheUtils.CachePolicyEnum.LONG,
|
||||
new Closure<RegionSellStat, String>() {
|
||||
@Override
|
||||
public RegionSellStat execute(String input) {
|
||||
List<QueryParam> q = new ArrayList<QueryParam>(5);
|
||||
q.add(new QueryParam("city", city));
|
||||
q.add(new QueryParam("region", region));
|
||||
List<QueryParam> q = new ArrayList<QueryParam>(5);
|
||||
q.add(new QueryParam("city", city));
|
||||
q.add(new QueryParam("region", region));
|
||||
|
||||
List<SortParam> s = new ArrayList<SortParam>();
|
||||
s.add(new SortParam("date", true));
|
||||
return regionSellStatDao.findFirstByParams(q, s);
|
||||
}
|
||||
});
|
||||
List<SortParam> s = new ArrayList<SortParam>();
|
||||
s.add(new SortParam("date", true));
|
||||
return regionSellStatDao.findFirstByParams(q, s);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user