//
QueryFilter queryFilter0 = new QueryFilter();
queryFilter0.addCommand(new Command("busStatus", Op.EQ, "0"));
int taxStatus0 = taxInfoDao.getCount(queryFilter0);
int businessStatus0 = businessInfoDao.getCount(queryFilter0);
int socialSecurityStatus0 = socialSecurityDao.getCount(queryFilter0);
int status0 = taxStatus0 + businessStatus0 + socialSecurityStatus0;
//
QueryFilter queryFilter1 = new QueryFilter();
queryFilter1.addCommand(new Command("busStatus", Op.EQ, "1"));
int taxStatus1 = taxInfoDao.getCount(queryFilter1);
int businessStatus1 = businessInfoDao.getCount(queryFilter1);
int socialSecurityStatus1 = socialSecurityDao.getCount(queryFilter1);
int status1 = taxStatus1 + businessStatus1 + socialSecurityStatus1;
//
QueryFilter queryFilter2 = new QueryFilter();
queryFilter2.addCommand(new Command("busStatus", Op.EQ, "2"));
int taxStatus2 = taxInfoDao.getCount(queryFilter2);
int businessStatus2 = businessInfoDao.getCount(queryFilter2);
int socialSecurityStatus2 = socialSecurityDao.getCount(queryFilter2);
int status2 = taxStatus2 + businessStatus2 + socialSecurityStatus2;
//
QueryFilter queryFilter3 = new QueryFilter();
queryFilter3.addCommand(new Command("busStatus", Op.EQ, "3"));
int taxStatus3 = taxInfoDao.getCount(queryFilter3);
int businessStatus3 = businessInfoDao.getCount(queryFilter3);
int socialSecurityStatus3 = socialSecurityDao.getCount(queryFilter3);
int status3 = taxStatus3 + businessStatus3 + socialSecurityStatus3;
there are four groups of such code from status0 to status3.
does java have this function? write a function that uses a for loop
JSONObject result = new JSONObject();
for(int i = 0; i < 4 ;iPP){
QueryFilter queryFilteri = new QueryFilter();
queryFilteri.addCommand(new Command("busStatus", Op.EQ, "i"));
int taxStatusi = taxInfoDao.getCount(queryFilteri);
int businessStatusi = businessInfoDao.getCount(queryFilteri);
int socialSecurityStatusi = socialSecurityDao.getCount(queryFilteri);
int result = taxStatusi + businessStatusi + socialSecurityStatusi;
result.put("statusi", statusi);
}
of course I"m wrong to write this, but is there any function that can implement this function?