private long getlistByType(JSONObject jsonObject, String type, List<JSONObject> list) {
long count = -1;
//欠租
if ("arrear".equals(type)) {
list = rentorderDao.listRiskOrderCar(jsonObject);
count = rentorderDao.listCountRiskOrderCar(jsonObject);
}
//保险到期
else if ("insurance".equals(type)) {
list = customerCarDao.listInsuranceRisk(jsonObject);
count = customerCarDao.listCountInsuranceRisk(jsonObject);
}
//年检到期
else if ("yearlyReview".equals(type)) {
list = customerCarDao.listYearlyReviewRiskList(jsonObject);
count = customerCarDao.listCountYearlyReviewRiskList(jsonObject);
}
//违章
else if ("peccancy".equals(type)) {
list = customerCarDao.listPeccancyRiskList(jsonObject);
count = customerCarDao.listCouuntPeccancyRiskList(jsonObject);
}
//超速
else if ("speeding".equals(type)) {
list = gpsAlertDao.speedingList(jsonObject);
count = gpsAlertDao.speedingCount(jsonObject);
}
//设备离线
else if ("offline".equals(type)) {
list = gpsAlertDao.offlineList(jsonObject);
count = gpsAlertDao.offlineCount(jsonObject);
}
return count;
}
调用该方法的list还是为没有值
因为是引用数据类型,是一个list的引用 ,调用dao的方法之后重新指向一个新的值,所以原来的那个值从来没有改变。
所以要怎么要将这个方法抽象出来呢