|
@@ -561,4 +561,22 @@ public class BrandServiceImpl implements BrandService {
|
|
|
}
|
|
|
return vos;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<TimeVo> searchNewByYears(Integer years) {
|
|
|
+ // 默认3年
|
|
|
+ if (years == null)
|
|
|
+ years = 3;
|
|
|
+ if ("".equals(years.toString()))
|
|
|
+ years = 3;
|
|
|
+
|
|
|
+ List<TimeVo> vos = new ArrayList<>();
|
|
|
+ for (int i = 0; i < years; i++) {
|
|
|
+ TimeVo timeVo = new TimeVo();
|
|
|
+ timeVo.setTime(DateUtil.offset(DateUtil.date(), DateField.YEAR, -i).toString("yyyy"));
|
|
|
+ timeVo.setCount(brandMapper.selectCountByYear(timeVo.getTime(), null));
|
|
|
+ vos.add(timeVo);
|
|
|
+ }
|
|
|
+ return vos;
|
|
|
+ }
|
|
|
}
|