首页 > 其他分享 >两张表合并到一个VO里面

两张表合并到一个VO里面

时间:2023-02-17 16:45:10浏览次数:42  
标签:air list List 两张 ele 合并 airs VO eles


@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;
}

标签:air,list,List,两张,ele,合并,airs,VO,eles
From: https://www.cnblogs.com/sensenh/p/17130695.html

相关文章