标签:air,list,List,两张,ele,合并,airs,VO,eles From: https://www.cnblogs.com/sensenh/p/17130695.html
@Override
public List<TbRemouldAirELe> findAll() {
List<TbRemouldAirELe> list = new ArrayList<>();
List<TbRemouldAir> airs = tbRemouldAirMapper.selectList(null);
List<TbRemouldEle> eles = tbRemouldEleMapper.selectList(null);
int forSize = Math.max(airs.size(), eles.size());
for (int i = 0; i < forSize; i++) {
TbRemouldAirELe r = new TbRemouldAirELe();
TbRemouldAir air = airs.get(i);
TbRemouldEle ele = eles.get(i);
if (!ObjectUtils.isEmpty(air)) {
BeanUtils.copyProperties(air,r);
}
if (!ObjectUtils.isEmpty(ele)) {
BeanUtils.copyProperties(ele,r);
}
list.add(r);
}
return list;
}