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