// 获取近2年年份 Calendar cal = Calendar.getInstance(); Long year = Long.valueOf(cal.get(cal.YEAR)); queryMap.put("year1", year - 1); queryMap.put("year2", year - 2);