|
@@ -3,7 +3,6 @@ package com.ruoyi.zdsz.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.ruoyi.common.core.domain.PageQuery;
|
|
@@ -243,21 +242,13 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public TableDataInfo<ZEngineeringIndustryTypeVo> queryNameByType(ZEngineeringIndustryBo bo, PageQuery pageQuery) {
|
|
|
- QueryWrapper<ZEngineeringIndustry> zEngineeringIndustryQueryWrapper = buildListByType(bo);
|
|
|
-
|
|
|
- IPage<ZEngineeringIndustry> page = new Page<>(pageQuery.getPageNum(), pageQuery.getPageSize());
|
|
|
- IPage<ZEngineeringIndustry> result = baseMapper.selectPage(page, zEngineeringIndustryQueryWrapper);
|
|
|
-
|
|
|
- List<ZEngineeringIndustryTypeVo> voList = result.getRecords().stream()
|
|
|
- .map(record -> {
|
|
|
- ZEngineeringIndustryTypeVo vo = new ZEngineeringIndustryTypeVo();
|
|
|
- vo.setId(record.getId());
|
|
|
- vo.setName(record.getEnginName());
|
|
|
- return vo;
|
|
|
- })
|
|
|
+ public List<ZEngineeringIndustryTypeVo> queryNameByType(ZEngineeringIndustryBo bo) {
|
|
|
+ QueryWrapper<ZEngineeringIndustry> zEngineeringIndustryTypeVoQueryWrapper = buildListByType(bo);
|
|
|
+ List<ZEngineeringIndustry> zEngineeringIndustryVos = baseMapper.selectList(zEngineeringIndustryTypeVoQueryWrapper);
|
|
|
+ List<ZEngineeringIndustryTypeVo> zEngineeringIndustryTypeVos = zEngineeringIndustryVos.stream()
|
|
|
+ .map(ZEngineeringIndustryTypeVo::new)
|
|
|
.collect(Collectors.toList());
|
|
|
- return new TableDataInfo<>(voList, (int)result.getTotal());
|
|
|
+ return zEngineeringIndustryTypeVos;
|
|
|
}
|
|
|
|
|
|
private QueryWrapper<ZEngineeringIndustry> buildListByType(ZEngineeringIndustryBo bo) {
|